This repository has been archived by the owner on Jan 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 795
Clear the blacklist for other playlists if final rendition errors #1083
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
49b97a9
resolve merge conflict
0c261e2
fix blacklistDuration option test case
f81badf
get playlist from masterPlaylistLoader
fd073d5
fix test case
02fba38
updating regarding the comments
8c431dc
test cases change
8991530
add a warning log and revise comment
83f429a
fix test case
f6a5b61
move comment and warn log out of loop
6275f13
change the positon if clearing warn log
b1443be
rephrase the comment
4f2c2cd
Merge remote-tracking branch 'upstream/master' into feature/un-blackl…
5f2aab3
resolve conflict
c074ec1
Merge branch 'master' into feature/un-blacklist-playlist
gesinger d478282
Resolve merge conflicts
gesinger 446a46a
Move check for final playlist media change to after string playlist r…
gesinger 09f2a6c
Fire a 'retryplaylist' event when clearing the blacklist
gesinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,7 +308,7 @@ export default class PlaylistLoader extends EventTarget { | |
* object to switch to | ||
* @return {Playlist} the current loaded media | ||
*/ | ||
media(playlist) { | ||
media(playlist, isFinalRendition) { | ||
// getter | ||
if (!playlist) { | ||
return this.media_; | ||
|
@@ -319,8 +319,6 @@ export default class PlaylistLoader extends EventTarget { | |
throw new Error('Cannot switch media playlist from ' + this.state); | ||
} | ||
|
||
const startingState = this.state; | ||
|
||
// find the playlist object if the target playlist has been | ||
// specified by URI | ||
if (typeof playlist === 'string') { | ||
|
@@ -330,6 +328,17 @@ export default class PlaylistLoader extends EventTarget { | |
playlist = this.master.playlists[playlist]; | ||
} | ||
|
||
window.clearTimeout(this.mediaUpdateTimeout); | ||
|
||
if (isFinalRendition) { | ||
const delay = (playlist.targetDuration / 2) * 1000 || 5 * 1000; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we will encounter this because of when this is called with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 updated |
||
|
||
this.mediaUpdateTimeout = | ||
window.setTimeout(this.media.bind(this, playlist, false), delay); | ||
return; | ||
} | ||
|
||
const startingState = this.state; | ||
const mediaChange = !this.media_ || playlist.uri !== this.media_.uri; | ||
|
||
// switch to fully loaded playlists immediately | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth adding a warning log here with something like
Clearing blacklist because last rendition is about to be blacklisted.