This repository was archived by the owner on Oct 20, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -100,20 +100,22 @@ Mss.dependencies.MssFragmentController = function() {
100100 return ;
101101 }
102102 // In case of live streams, update segment timeline according to DVR window
103- else if ( manifest . timeShiftBufferDepth && manifest . timeShiftBufferDepth > 0 ) {
103+ else if ( ( manifest . timeShiftBufferDepth && manifest . timeShiftBufferDepth > 0 ) || manifest . canSeek ) {
104104 // Get timestamp of the last segment
105105 segment = segments [ segments . length - 1 ] ;
106106 t = segment . t ;
107107
108108 // Determine the segments' availability start time
109109 availabilityStartTime = t - ( manifest . timeShiftBufferDepth * timescale ) ;
110110
111- // Remove segments prior to availability start time
112- segment = segments [ 0 ] ;
113- while ( segment . t < availabilityStartTime ) {
114- this . debug . log ( "[MssFragmentController][" + type + "] Remove segment - t = " + ( segment . t / timescale ) ) ;
115- segments . splice ( 0 , 1 ) ;
111+ if ( manifest . timeShiftBufferDepth > 0 ) {
112+ // Remove segments prior to availability start time
116113 segment = segments [ 0 ] ;
114+ while ( segment . t < availabilityStartTime ) {
115+ this . debug . log ( "[MssFragmentController][" + type + "] Remove segment - t = " + ( segment . t / timescale ) ) ;
116+ segments . splice ( 0 , 1 ) ;
117+ segment = segments [ 0 ] ;
118+ }
117119 }
118120
119121 // Update DVR window range => set range's end to end time of current segment
Original file line number Diff line number Diff line change @@ -567,6 +567,8 @@ Mss.dependencies.MssParser = function() {
567567 mpd . timescale = timescale ? parseFloat ( timescale ) : DEFAULT_TIME_SCALE ;
568568 var isLive = this . domParser . getAttributeValue ( smoothNode , 'IsLive' ) ;
569569 mpd . type = ( isLive !== null && isLive . toLowerCase ( ) === 'true' ) ? 'dynamic' : 'static' ;
570+ var canSeek = this . domParser . getAttributeValue ( smoothNode , 'CanSeek' ) ;
571+ mpd . canSeek = ( canSeek !== null && canSeek . toLowerCase ( ) === 'true' ) ;
570572 mpd . timeShiftBufferDepth = parseFloat ( this . domParser . getAttributeValue ( smoothNode , 'DVRWindowLength' ) ) / mpd . timescale ;
571573 var duration = parseFloat ( this . domParser . getAttributeValue ( smoothNode , 'Duration' ) ) ;
572574
You can’t perform that action at this time.
0 commit comments