4.2
This commit is contained in:
@@ -263,31 +263,20 @@
|
||||
getVideoList()
|
||||
}
|
||||
const getColletList = async () => {
|
||||
clearHlsRefs()
|
||||
params.businessVideoDisplayPosition = ''
|
||||
let res = await getColletListApi(params)
|
||||
videoList.value = res.data
|
||||
if(res.data.length){
|
||||
postVideoRemain()
|
||||
}
|
||||
total.value = res.total
|
||||
nextTick(() => {
|
||||
videoList.value.forEach(async (item, index) => {
|
||||
var video = document.getElementById(`video${index}`)
|
||||
const hls = new Hls({
|
||||
enableWorker: false, // 禁用 Worker 来避免额外的线程
|
||||
enableSoftwareAES: true, // 使用软件解码器以避免硬件解码的额外请求
|
||||
cache: true, // 启用缓存
|
||||
maxBufferLength: 10, // 最大缓冲长度(秒)
|
||||
maxMaxBufferLength: 15, // 缓冲区长度的上限
|
||||
maxBufferSize: 20 * 1000 * 1000 // 最大缓冲大小(字节)
|
||||
})
|
||||
console.log(item.hlsUrl);
|
||||
hls.loadSource(item.hlsUrl)
|
||||
hls.attachMedia(video)
|
||||
hls.on(Hls.Events.MANIFEST_PARSED, () => {
|
||||
video.play()
|
||||
})
|
||||
hlsRefs.push(hls)
|
||||
})
|
||||
initVideo()
|
||||
})
|
||||
}
|
||||
const handleNav = (e) => {
|
||||
clearInterval(timer)
|
||||
if (current.value == e) return
|
||||
clearHlsRefs()
|
||||
videoLog.value = 1
|
||||
@@ -383,7 +372,7 @@
|
||||
let res = await getVideoListApi(params)
|
||||
total.value = res.total
|
||||
if (res.data.length > 0) {
|
||||
// postVideoRemain()
|
||||
postVideoRemain()
|
||||
videoList.value = res.data
|
||||
nextTick(() => {
|
||||
videoList.value.forEach(async (x, index) => {
|
||||
|
||||
Reference in New Issue
Block a user