解决flvJs报 Failed to execute ‘appendBuffer’ on ‘SourceBuffer’的错误

0 点赞
0 条评论
725 次浏览
发布于 6 个月前

播放http-flv流一段时间后,视频会自动停止,控制台报错

flv.js:11403
[MSEController] > Failed to execute ‘appendBuffer’ on ‘SourceBuffer’: The HTMLMediaElement.error attribute is not null.
flv.js:1226
Uncaught (in promise) Error: Uncaught, unspecified “error” event. (MediaError) at EventEmitter.2.EventEmitter.emit (flv.js:1226) at EventEmitter. (flv.js:8876) at EventEmitter.2.EventEmitter.emit (flv.js:1245) at MSEController._doAppendSegments (flv.js:2804) at MSEController.appendMediaSegment (flv.js:2559) at EventEmitter. (flv.js:8940) at EventEmitter.2.EventEmitter.emit (flv.js:1248) at flv.js:3110 at

解决方案一

在配置那加上autoCleanupSourceBuffer

const ins = FlvJs.createPlayer({
  type: 'flv',
  url: 'url.flv',
  config: {
    autoCleanupSourceBuffer: true,
  },
});
ins.attachMediaElement(video);
ins.load();

解决方案二

在设置中关闭GPU加速(硬件加速)

重启浏览器解决~

版权所属:开发日记
转载时必须以链接形式注明原始出处及本声明。
"赞助我们,我们才能做的更多&更好"
赞助支持
还没有评论
写下你的评论...