Skip to content

Commit

Permalink
Merge pull request video-dev#1622 from AvinashVmsrsr/loadError
Browse files Browse the repository at this point in the history
Emit 'loadError' instead of 'loadTimeout' when playlist request retries exhaust
  • Loading branch information
mangui authored Mar 23, 2018
2 parents 661d31e + 2f8d897 commit 29b0ce6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/loader/playlist-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class PlaylistLoader extends EventHandler {
}

loadtimeout (stats, context, networkDetails = null) {
this._handleNetworkError(context, networkDetails);
this._handleNetworkError(context, networkDetails, true);
}

_handleMasterPlaylist (response, stats, context, networkDetails) {
Expand Down Expand Up @@ -409,23 +409,23 @@ class PlaylistLoader extends EventHandler {
});
}

_handleNetworkError (context, networkDetails) {
_handleNetworkError (context, networkDetails, timeout = false) {
let details;
let fatal;

const loader = this.getInternalLoader(context);

switch (context.type) {
case ContextType.MANIFEST:
details = ErrorDetails.MANIFEST_LOAD_TIMEOUT;
details = (timeout ? ErrorDetails.MANIFEST_LOAD_TIMEOUT : ErrorDetails.MANIFEST_LOAD_ERROR);
fatal = true;
break;
case ContextType.LEVEL:
details = ErrorDetails.LEVEL_LOAD_TIMEOUT;
details = (timeout ? ErrorDetails.LEVEL_LOAD_TIMEOUT : ErrorDetails.LEVEL_LOAD_ERROR);
fatal = false;
break;
case ContextType.AUDIO_TRACK:
details = ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT;
details = (timeout ? ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT : ErrorDetails.AUDIO_TRACK_LOAD_ERROR);
fatal = false;
break;
default:
Expand Down

0 comments on commit 29b0ce6

Please sign in to comment.