feat:视频列表现在分页操作

This commit is contained in:
zjc
2025-02-08 13:13:52 +08:00
parent 8db9625afb
commit c5d72d91e4
2 changed files with 60 additions and 70 deletions

View File

@@ -53,18 +53,12 @@
nextTick(() => {
list.value.forEach(async (item, index) => {
var video = document.getElementById(`video${index}`)
let res1 = await postRefreshApi({
type: 'hls',
businessVideoDisplayPosition: item.businessVideoDisplayPosition,
cameraIndexCode: item.cameraIndexCode
})
item.hlsUrl = res1.data.hlsUrl
const hls = new Hls({
maxBufferLength: 10, // 最大缓冲长度(秒)
maxMaxBufferLength: 15, // 缓冲区长度的上限
maxBufferSize: 20 * 1000 * 1000 // 最大缓冲大小(字节)
})
hls.loadSource(res1.data.hlsUrl)
hls.loadSource(item.hlsUrl)
hls.attachMedia(video)
hls.on(Hls.Events.MANIFEST_PARSED, () => {
video.play()