clappr-level-selector-plugin icon indicating copy to clipboard operation
clappr-level-selector-plugin copied to clipboard

Freeze while switching levels using level-selector plugin

Open remijulien opened this issue 9 years ago • 6 comments

Browser: Chrome 51.0.2704.84

OS: Mac OS X 10.11.5

Clappr Version: 0.2.54

Steps to reproduce:

  • launch this test page It is latest clappr with latest level-selector plugin loading an MBR HLS stream with a 5 minute DVR playlist.
  • repeatedly switch bitrate levels using the level selector
  • at some point the playback freezes, no error in console, the spinner appears and the playback button is present but inactive. Media segments continue to be downloaded.

Screenshot here

remijulien avatar Jun 08 '16 11:06 remijulien

@remijulien can you enable debug mode and post the log lines here? (at least the last 30)

//before you create your player
Clappr.Log.setLevel(Clappr.Log.LEVEL_DEBUG)

leandromoreira avatar Jun 08 '16 13:06 leandromoreira

here are two screenshots with debug mode on

the console error when playback freezes

more log lines

do you need the raw log lines as well ?

remijulien avatar Jun 08 '16 14:06 remijulien

@remijulien that "Dom " error is something with Chrome, they're already aware of it (actually they seem to fixed that too).

I went to the cdn added //cdn.jsdelivr.net/clappr.level-selector/latest/level-selector.min.js as external plugin [+] and copied (replacing the existent) this code:

var playerElement = document.getElementById("player-wrapper");

var player = new Clappr.Player({
  source: 'http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8',
  baseUrl: '/latest',
  plugins: [LevelSelector],
  poster: 'http://clappr.io/poster.png',
  mute: true,
  height: 360,
  width: 640
});

player.attachTo(playerElement);

And clicked run, then played and I think I could reproduce the same behavior. (it gets stucked... infinitely loading)

leandromoreira avatar Jun 08 '16 16:06 leandromoreira

But I really needed to change lots of quality I think it might be some race condition (you ask to switch a level, then you don't even wait for the end and try to change it again)

leandromoreira avatar Jun 08 '16 16:06 leandromoreira

I have a similar problem that may be caused by the same bug.

In my case, I have a single page application with one player, and a list of sources to select from (TV channels). The sources are HLS, but they don't actually provide different levels. We're using the level-selector plugin for some other part of the application, so it's not really relevant to this page, but it still causes it to freeze.

When the page loads, the player is created and one channel (HLS source) is selected. There are buttons that activate other channels. When clicking these buttons, and the player is already created, we call player.stop() and player.load() with the new source. After switching back and forward a few times, the browser freezes completely, and it appears like there is a Javascript locked in a loop somewhere. Removing the level-selector plugin makes the problem go away.

I will try to set up a minimal page to reproduce.

ropez avatar Oct 14 '16 09:10 ropez

It turns out my issue was caused by having two instances of the clappr javascript module. One imported by my app, and one imported by the plugin. I just need to find a proper solution to issue #40 then this won't be a problem

ropez avatar Oct 14 '16 12:10 ropez