1、Failed to read the 'buffered' property from 'SourceBuffer': This SourceBuffer has been removed from the parent media source
解决方法: 进入node_modules/flv.js/src/core/mse-controller.js文件中 在appendMediaSegment()和_needCleanupSourceBuffer()两个方法下第一行加入以下代码:
if (!this._mediaSource || this._mediaSource.readyState !== 'open') { return; }
2、Uncaught (in promise) Typerror: Failed to execute ‘remove’ on ‘Sourcebuffer’: The end value provided (-47.5442)2.5ac666e 15:33 0must be greater than the start value provided (0,08)
该错误原因是清理缓存时,flvJs配置中的autoCleanupMaxBackwardDuration和autoCleanupMinBackwardDuration设置的数值与业务的视频推流时清理缓存不合适导致,直接删除这两个配置,配置中设置以下三项即可
autoCleanupSourceBuffer: true, //对SourceBuffer进行自动清理缓存
enableStashBuffer: false, //关闭IO隐藏缓冲区
stashInitialSize: 128, //减少首帧显示等待时长