xgplayer icon indicating copy to clipboard operation
xgplayer copied to clipboard

触发 "SourceBuffer is full" 错误

Open cfam opened this issue 3 months ago • 1 comments

您使用的西瓜播放器版本是多少? What version of xgplayer are you using? 3.0.23 "xgplayer": "^3.0.23", "xgplayer-hls": "^3.0.23", "xgplayer-hls.js": "^3.0.23",

import Player from 'xgplayer' import TextTrack from "xgplayer/es/plugins/track"; import HlsPlugin from "xgplayer-hls"; import 'xgplayer/dist/index.min.css'

playerInstance.value = new Player({ id: props.playerId, lang: 'zh', // 设置界面语言为中文 volume: props.volume, autoplay: props.autoplay, screenShot: true, // 启用截图功能 url: vurl, poster: props.posterUrl, fluid: true, // 启用流式布局,自适应容器大小 playbackRate: props.playbackRates, loop: props.loop, muted: props.muted, plugins: [HlsPlugin, TextTrack], // 👇 关键:配置 HLS 缓冲区自动清理 hls: { backBufferLength: 30, // 保留最近 30 秒,之前的自动删除 maxBufferLength: 30, // 最大缓冲时长(秒) maxBufferSize: 60 * 1000000, // 最大缓冲区大小(60MB) }, progressDot: taskPointView,// 进度点 texttrack: Texttrack, keyShortcut: false, // 禁用快捷键 commonStyle: { ...defaultStyle, ...props.commonStyle } }) 播放视频是m3u8格式的视频,使用浏览器Microsoft Edge 版本 140.0.3485.81 (正式版本) (64 位) 播放时候向前拖动播放进度或向后拖动进度,就会出现错误: 向前拖动(seek forward)→ 缓冲新区段 → 再向后拖动(seek backward)→ 触发 "SourceBuffer is full" 错误

Uncaught (in promise) StreamingError2: Failed to execute 'appendBuffer' on 'SourceBuffer': The SourceBuffer is full, and cannot free space to append additional buffers. at MSE2._startQueue (mse.js:619:147) at MSE2._enqueueOp (mse.js:526:16) at MSE2.append (mse.js:386:19) at BufferService2._callee2$ (index.js:252:31) at tryCatch (_rollupPluginBabelHelpers.js:80:17) at Generator. (_rollupPluginBabelHelpers.js:169:22) at Generator.next (_rollupPluginBabelHelpers.js:107:21) at asyncGeneratorStep (_rollupPluginBabelHelpers.js:374:23) at _next (_rollupPluginBabelHelpers.js:392:9) at _rollupPluginBabelHelpers.js:397:7 请问上述问题如何解决

cfam avatar Sep 26 '25 08:09 cfam

@cfam 请问是否测试流的码率比较大?

gemxx avatar Sep 30 '25 03:09 gemxx