mediaelement / mediaelement-plugins

Plugins for the main mediaelement project
406 stars 138 forks source link

Changing HLS quality causes infinite buffering until play is pressed #91

Closed callumthomson closed 6 years ago

callumthomson commented 7 years ago

Hello,

I have a video with 2 HLS playlists as sources. One SD and one HD. The user can switch between them using the quality plugin. They work fine, but when I switch between them using the GUI, the video starts buffering indefinitely. The moment i press play the stream works fine, but until then it looks like the video is buffering and is not going to play.

Gungrave223 commented 7 years ago

you need to update the following in the quality.js file

if (quality === newQuality) {
    player.qualitiesButton.querySelector('button').innerHTML = src.title || getQualityNameFromValue(newQuality);
        media.pause();
        media.setSrc(src.src);
        media.load();
        media.dispatchEvent(mejs.Utils.createEvent('seeking', media));
        if (!paused) { //auto restart player after quality changes.
            media.setCurrentTime(currentTime);
            media.play();
        }
}
rafa8626 commented 7 years ago

Is this solution addressed in https://github.com/mediaelement/mediaelement-plugins/pull/93?

Gungrave223 commented 7 years ago

Yes it is.

rafa8626 commented 7 years ago

@callumthomson Once the PR is reviewed and merged, this issue will be closed