Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

fix for loaded in player error state #60

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/videojs-hls.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,20 @@ var

// expose the HLS plugin state
player.hls.readyState = function() {
if (!player.hls.media) {
if (!player.hls.playlists.media()) {
return 0; // HAVE_NOTHING
}
return 1; // HAVE_METADATA
};

// loaded in error state fix
if (player.error() && player.error().code === 4 && srcUrl) {
player.error(null);
player.one('play', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be player.on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for first play only. per player.js instructions it should be player.one.

player.trigger('firstplay');
});
}

player.on('seeking', function() {
var currentTime = player.currentTime();
player.hls.mediaIndex = getMediaIndexByTime(player.hls.playlists.media(),
Expand Down