clappr / clappr-level-selector-plugin

Clappr Level Selector Plugin
MIT License
76 stars 56 forks source link

Setting a default quality doesn't stop the auto-switching #51

Closed DavidVentura closed 3 years ago

DavidVentura commented 7 years ago

Hi I'd like to allow my users to select a quality level but I don't want to have auto-switching enabled by default. Setting currentLevel: 1 doesn't really stop the auto-switching

joaopaulovieira commented 4 years ago

On the latest Clappr version, I don't reproduce this problem.

I tested with this code on http://clapr.io/demo (don't forget to import the level selector plugin on the page):

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

var player = new Clappr.Player({
  source: 'https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8',
  poster: 'http://clappr.io/poster.png',
  mute: true,
  height: 360,
  width: 640,
  plugins: {core: [LevelSelector]}
});

player.attachTo(playerElement);

player.core.activePlayback.on(Clappr.Events.PLAYBACK_LEVELS_AVAILABLE, function(levels) {
  player.core.activePlayback.currentLevel = 1
})