This repository was archived by the owner on Oct 20, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ Mss.dependencies.MssFragmentController = function() {
8888
8989 // Update segment timeline according to DVR window
9090 if ( manifest . timeShiftBufferDepth && manifest . timeShiftBufferDepth > 0 ) {
91- if ( segmentsUpdated ) {
91+ if ( segmentsUpdated && manifest . startOver !== true ) {
9292 // Get timestamp of the last segment
9393 segment = segments [ segments . length - 1 ] ;
9494 t = segment . t ;
Original file line number Diff line number Diff line change @@ -505,6 +505,15 @@ Mss.dependencies.MssParser = function() {
505505 mpd . type = ( isLive !== null && isLive . toLowerCase ( ) === 'true' ) ? 'dynamic' : 'static' ;
506506 mpd . timeShiftBufferDepth = parseFloat ( this . domParser . getAttributeValue ( smoothNode , 'DVRWindowLength' ) ) / TIME_SCALE_100_NANOSECOND_UNIT ;
507507 var duration = parseFloat ( this . domParser . getAttributeValue ( smoothNode , 'Duration' ) ) ;
508+
509+ // If live manifest with Duration and no DVRWindowLength, we consider it as a start-over manifest
510+ if ( mpd . type === "dynamic" && duration > 0 ) {
511+ mpd . timeShiftBufferDepth = duration / TIME_SCALE_100_NANOSECOND_UNIT ;
512+ duration = 0 ;
513+ mpd . startOver = true ;
514+ }
515+
516+ // Complete manifest/mpd initialization
508517 mpd . mediaPresentationDuration = ( duration === 0 ) ? Infinity : ( duration / TIME_SCALE_100_NANOSECOND_UNIT ) ;
509518 mpd . BaseURL = baseURL ;
510519 mpd . minBufferTime = MediaPlayer . dependencies . BufferExtensions . DEFAULT_MIN_BUFFER_TIME ;
Original file line number Diff line number Diff line change @@ -844,6 +844,7 @@ MediaPlayer = function () {
844844 {
845845 url : "[manifest url]",
846846 startTime : [start time in seconds (optional, only for static streams)],
847+ startOver : [true if start-over DVR stream (optional)],
847848 protocol : "[protocol type]", // 'HLS' to activate native support on Safari/OSx
848849 protData : {
849850 // one entry for each key system ('com.microsoft.playready' or 'com.widevine.alpha')
Original file line number Diff line number Diff line change @@ -269,6 +269,12 @@ MediaPlayer.dependencies.StreamController = function() {
269269 return false ;
270270 }
271271
272+ // Specific use case of "start-over" or "session DVR" live streams
273+ // We set this information in the manifest, to be used by MssFragmentController for DVR window updating
274+ if ( source . startOver ) {
275+ manifest . startOver = true ;
276+ }
277+
272278 this . debug . info ( "[StreamController] composeStreams" ) ;
273279
274280 if ( this . capabilities . supportsEncryptedMedia ( ) ) {
You can’t perform that action at this time.
0 commit comments