flv.js icon indicating copy to clipboard operation
flv.js copied to clipboard

Uncaught TypeError: Cannot read property 'flushStashedSamples' of null

Open caobaojin opened this issue 4 years ago • 3 comments

When the FFmpeg push stream is abnormal, the client reports an ERROR: the attribute "FlushstashedSamples" cannot be found, and the ERROR event is not triggered

caobaojin avatar May 18 '21 01:05 caobaojin

Any can help?

eilskn avatar Sep 03 '21 09:09 eilskn

Same issue. Anyone solved this?

twilson90 avatar Oct 16 '21 11:10 twilson90

the best way is fix this problem at flvjs if you can't update flvjs, you might update as follow, to skip this temporaryly

// step1. add deferLoadAfterSourceOpen's config while createPlayer

this.player = flvjs.createPlayer({ type: "flv", isLive: true, url: "ws://localhost:9999/rtsp/xxx?url=rtsp://localhost:8554/rtsp/test_rtsp" }, { deferLoadAfterSourceOpen: false });

// step2. add following code after this.player.load()

let controller = this.player._transmuxer._controller let wsLoader = controller._ioctl._loader var oldWsOnCompleteFunc = wsLoader._onComplete wsLoader._onComplete = function() { if(!controller._remuxer) { controller._remuxer = { flushStashedSamples: function () { _this.loadingVisiable = false console.log("flushStashedSamples") } } } oldWsOnCompleteFunc() }

970655147 avatar Sep 11 '22 04:09 970655147