Flv.js记录(vue)
下载 npm install flv.js
插入 import flvjs from 'flv.js'
第一种报错:Failed to read the ‘buffered’ property from ‘SourceBuffer’: This SourceBuffer has been removed from the parent media source.

报错原因:一般是在flv源发生异常中断的时候产生的。错误提示大多数都在 mse-controller.js 这个模块中。
解决办法:在 mse-controller.js中(flv.js/src/core/mse-controller.js),appendMediaSegment()、_needCleanupSourceBuffer()这些方法的入口处调用检查以下MediaSource的合法性。(注意:如果cdn引入flv.min.js则无法通过这样修改,目前只有这一种解决办法)
下面 两处地方 加入以下代码
if (!this._mediaSource || this._mediaSource.readyState !== 'open') { return; }
第二中报错:出现以下警告
报错原因:应该是音视频不同步问题,需要设置flvjs的config.fixAudioTimestampGap = false才会音视频同步。
解决办法:将参数fixAudioTimestampGap设为false