3a3037d0 by Brandon Bay Committed by Gary Katsevman

Adjusting live start time to 3 target durations

Changing the live start time from 30s to 3 target durations. Using 30s
as a fallback if the playlist does not define a target duration.
1 parent c54a2033
......@@ -91,9 +91,10 @@ videojs.Hls.prototype.src = function(src) {
videojs.Hls.setMediaIndexForLive = function(selectedPlaylist) {
var tailIterator = selectedPlaylist.segments.length,
tailDuration = 0;
tailDuration = 0,
targetTail = (selectedPlaylist.targetDuration || 10) * 3;
while (tailDuration < 30 && tailIterator > 0) {
while (tailDuration < targetTail && tailIterator > 0) {
tailDuration += selectedPlaylist.segments[tailIterator - 1].duration;
tailIterator--;
}
......
......@@ -39,5 +39,5 @@
"uri": "009.ts"
}
],
"targetDuration": 19
"targetDuration": 10
}
\ No newline at end of file
......
#EXTM3U
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:YES
#EXT-X-TARGETDURATION:19
#EXT-X-TARGETDURATION:10
#EXTINF:10,0
001.ts
#EXTINF:19,0
......