flowplayer / flowplayer-hlsjs

Flowplayer HLS.js plugin
MIT License
81 stars 35 forks source link

How to stop hlsjs (xhr-loader.js:77) load the data after shutdown method? #113

Closed SilverStone2104 closed 6 years ago

SilverStone2104 commented 6 years ago

Hello. I am creating the live-stream website with access to real cameras. There is a page (user cabinet) where some customer can watch video from all cameras he has access. He can see one player or gallery with four player at the same time. According to my logic, when user switch tabs (I use bootstrap), some players should be remove (shutdown method) and some create (using pure JavaScript installation). However, when I remove players, I can see in network that hlsjs (xhr-loader.js:77) still get data from the server. And yes, I tried to use Splash settings, but that didn`t help, the requests still go to the server. Hope that someone help me.

bbbo commented 6 years ago

does this happen as well if you use plain hls.js and a

SilverStone2104 commented 6 years ago

Hello bbbo. After I left this question, I made some research, and found that the problem was in using hls.js (hls-lite). I tried to use flowplayer.hlsjs and then I could use (flowplayer object).engine.hlsjs.stopLoad(). Before, when I had been usind hls.js, the (flowplayer object).engine.hlsjs(or hls) was undefined. There was not object hlsjs( or hls) in engine. Also I couldn’t get access to any hls event with hls.js. Yes, I initialize flowplayer and hls.js client library according to this hsljs-lite engine. But everything started working only, when tried flowplayer.hlsjs. If somebody know how access to (flowplayer object) .engine.hlsjs using the hls.js client library, I will be very grateful.

nnarhinen commented 6 years ago

You can access the Hls instance with flowplayer.engine('hlsjs-lite').hls

SilverStone2104 commented 6 years ago

@nnarhinen Ok, but this way I can get access to last installed flowplayer hls engine. I need something like this:

var api = flowplayer(element);
 if (api.engine('hlsjs-lite').hls) {
            api.engine('hlsjs-lite').hls.stopLoad()
 }

It's important because in some page I have 4 players and I need opportunity to stop loading tread for one specific player.

nnarhinen commented 6 years ago

Please move this discussion to the right repository: https://github.com/flowplayer/flowplayer

SilverStone2104 commented 6 years ago

@nnarhinen ok, I'll leave my question there.