@@ -134,6 +134,7 @@ shaka.dash.SegmentTemplate = class {
134
134
if ( ! segmentIndex ) {
135
135
shaka . log . debug ( `Creating TSI with end ${ periodEnd } ` ) ;
136
136
segmentIndex = new TimelineSegmentIndex (
137
+ context . dynamic ,
137
138
info ,
138
139
context . representation . originalId ,
139
140
context . bandwidth ,
@@ -148,7 +149,8 @@ shaka.dash.SegmentTemplate = class {
148
149
} else {
149
150
const tsi = /** @type {!TimelineSegmentIndex } */ ( segmentIndex ) ;
150
151
tsi . appendTemplateInfo (
151
- info , periodStart , periodEnd , initSegmentReference ) ;
152
+ info , periodStart , periodEnd , initSegmentReference ,
153
+ context . dynamic ) ;
152
154
153
155
const availabilityStart =
154
156
context . presentationTimeline . getSegmentAvailabilityStart ( ) ;
@@ -178,7 +180,7 @@ shaka.dash.SegmentTemplate = class {
178
180
if ( segmentIndex instanceof shaka . dash . TimelineSegmentIndex &&
179
181
segmentIndex . isEmpty ( ) ) {
180
182
segmentIndex . appendTemplateInfo ( info , periodStart ,
181
- periodEnd , initSegmentReference ) ;
183
+ periodEnd , initSegmentReference , context . dynamic ) ;
182
184
}
183
185
return Promise . resolve ( segmentIndex ) ;
184
186
} ,
@@ -723,7 +725,7 @@ shaka.dash.SegmentTemplate = class {
723
725
*/
724
726
shaka . dash . TimelineSegmentIndex = class extends shaka . media . SegmentIndex {
725
727
/**
726
- *
728
+ * @param { boolean } dynamic
727
729
* @param {!shaka.dash.SegmentTemplate.SegmentTemplateInfo } templateInfo
728
730
* @param {?string } representationId
729
731
* @param {number } bandwidth
@@ -735,11 +737,14 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
735
737
* @param {shaka.extern.aesKey|undefined } aesKey
736
738
* @param {number } segmentSequenceCadence
737
739
*/
738
- constructor ( templateInfo , representationId , bandwidth , getBaseUris ,
740
+ constructor ( dynamic , templateInfo , representationId , bandwidth , getBaseUris ,
739
741
urlParams , periodStart , periodEnd , initSegmentReference ,
740
742
aesKey , segmentSequenceCadence ) {
741
743
super ( [ ] ) ;
742
744
745
+ /** @private {boolean} */
746
+ this . dynamic_ = dynamic ;
747
+
743
748
/** @private {?shaka.dash.SegmentTemplate.SegmentTemplateInfo} */
744
749
this . templateInfo_ = templateInfo ;
745
750
@@ -839,9 +844,12 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
839
844
* @param {number } periodStart
840
845
* @param {number } periodEnd
841
846
* @param {shaka.media.InitSegmentReference } initSegmentReference
847
+ * @param {boolean } dynamic
842
848
*/
843
- appendTemplateInfo ( info , periodStart , periodEnd , initSegmentReference ) {
849
+ appendTemplateInfo ( info , periodStart , periodEnd , initSegmentReference ,
850
+ dynamic ) {
844
851
this . updateInitSegmentReference ( initSegmentReference ) ;
852
+ this . dynamic_ = dynamic ;
845
853
if ( ! this . templateInfo_ ) {
846
854
this . templateInfo_ = info ;
847
855
this . periodStart_ = periodStart ;
@@ -1033,7 +1041,7 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
1033
1041
if ( correctedPosition === this . getNumReferences ( ) - 1 &&
1034
1042
this . periodEnd_ !== Infinity ) {
1035
1043
// See https://github.com/shaka-project/shaka-player/issues/8672
1036
- if ( Math . abs ( segmentEnd - this . periodEnd_ ) > 0.1 ) {
1044
+ if ( this . dynamic_ && Math . abs ( segmentEnd - this . periodEnd_ ) > 0.1 ) {
1037
1045
segmentEnd = Math . min ( segmentEnd , this . periodEnd_ ) ;
1038
1046
} else {
1039
1047
segmentEnd = this . periodEnd_ ;
0 commit comments