@@ -45,7 +45,7 @@ QUnit.test('returns correct sync point for ProgramDateTime strategy', function(a
45
45
46
46
assert . equal ( syncPoint , null , 'no syncpoint when no date time to display time mapping' ) ;
47
47
48
- playlist . segments [ 0 ] . dateTimeObject = datetime ;
48
+ playlist . segments [ 0 ] . programDateTime = datetime . getTime ( ) ;
49
49
50
50
this . syncController . setDateTimeMappingForStart ( playlist ) ;
51
51
@@ -55,7 +55,7 @@ QUnit.test('returns correct sync point for ProgramDateTime strategy', function(a
55
55
56
56
assert . equal ( syncPoint , null , 'no syncpoint when datetimeObject not set on playlist' ) ;
57
57
58
- newPlaylist . segments [ 0 ] . dateTimeObject = new Date ( 2012 , 11 , 12 , 12 , 12 , 22 ) ;
58
+ newPlaylist . segments [ 0 ] . programDateTime = new Date ( 2012 , 11 , 12 , 12 , 12 , 22 ) . getTime ( ) ;
59
59
60
60
syncPoint = strategy . run ( this . syncController , newPlaylist , duration , timeline ) ;
61
61
@@ -78,7 +78,7 @@ QUnit.test('ProgramDateTime strategy finds nearest segment for sync', function(a
78
78
assert . equal ( syncPoint , null , 'no syncpoint when no date time to display time mapping' ) ;
79
79
80
80
playlist . segments . forEach ( ( segment , index ) => {
81
- segment . dateTimeObject = new Date ( 2012 , 11 , 12 , 12 , 12 , 12 + ( index * 10 ) ) ;
81
+ segment . programDateTime = new Date ( 2012 , 11 , 12 , 12 , 12 , 12 + ( index * 10 ) ) . getTime ( ) ;
82
82
} ) ;
83
83
84
84
this . syncController . setDateTimeMappingForStart ( playlist ) ;
@@ -90,7 +90,7 @@ QUnit.test('ProgramDateTime strategy finds nearest segment for sync', function(a
90
90
assert . equal ( syncPoint , null , 'no syncpoint when datetimeObject not set on playlist' ) ;
91
91
92
92
newPlaylist . segments . forEach ( ( segment , index ) => {
93
- segment . dateTimeObject = new Date ( 2012 , 11 , 12 , 12 , 12 , 22 + ( index * 10 ) ) ;
93
+ segment . programDateTime = new Date ( 2012 , 11 , 12 , 12 , 12 , 22 + ( index * 10 ) ) . getTime ( ) ;
94
94
} ) ;
95
95
96
96
syncPoint = strategy . run ( this . syncController , newPlaylist , duration , timeline , 170 ) ;
@@ -115,7 +115,7 @@ QUnit.test(
115
115
function ( assert ) {
116
116
const playlist = playlistWithDuration ( 40 ) ;
117
117
118
- playlist . segments [ 1 ] . dateTimeObject = new Date ( 2012 , 11 , 12 , 12 , 12 , 12 ) ;
118
+ playlist . segments [ 1 ] . programDateTime = new Date ( 2012 , 11 , 12 , 12 , 12 , 12 ) . getTime ( ) ;
119
119
120
120
this . syncController . setDateTimeMappingForStart ( playlist ) ;
121
121
@@ -125,7 +125,7 @@ QUnit.test(
125
125
'did not set datetime mapping'
126
126
) ;
127
127
128
- playlist . segments [ 0 ] . dateTimeObject = new Date ( 2012 , 11 , 12 , 12 , 12 , 2 ) ;
128
+ playlist . segments [ 0 ] . programDateTime = new Date ( 2012 , 11 , 12 , 12 , 12 , 2 ) . getTime ( ) ;
129
129
130
130
this . syncController . setDateTimeMappingForStart ( playlist ) ;
131
131
@@ -140,12 +140,12 @@ QUnit.test(
140
140
QUnit . test ( 'uses separate date time to display time mapping for each timeline' , function ( assert ) {
141
141
const playlist = playlistWithDuration ( 40 , { discontinuityStarts : [ 1 , 3 ] } ) ;
142
142
143
- playlist . segments [ 0 ] . dateTimeObject = new Date ( 2020 , 1 , 1 , 1 , 1 , 1 ) ;
143
+ playlist . segments [ 0 ] . programDateTime = new Date ( 2020 , 1 , 1 , 1 , 1 , 1 ) . getTime ( ) ;
144
144
// 20 seconds later (10 more than default)
145
- playlist . segments [ 1 ] . dateTimeObject = new Date ( 2020 , 1 , 1 , 1 , 1 , 21 ) ;
146
- playlist . segments [ 2 ] . dateTimeObject = new Date ( 2020 , 1 , 1 , 1 , 1 , 31 ) ;
145
+ playlist . segments [ 1 ] . programDateTime = new Date ( 2020 , 1 , 1 , 1 , 1 , 21 ) . getTime ( ) ;
146
+ playlist . segments [ 2 ] . programDateTime = new Date ( 2020 , 1 , 1 , 1 , 1 , 31 ) . getTime ( ) ;
147
147
// 30 seconds later (20 more than default)
148
- playlist . segments [ 3 ] . dateTimeObject = new Date ( 2020 , 1 , 1 , 1 , 2 , 1 ) ;
148
+ playlist . segments [ 3 ] . programDateTime = new Date ( 2020 , 1 , 1 , 1 , 2 , 1 ) . getTime ( ) ;
149
149
150
150
// after this call, the initial playlist mapping will be provided
151
151
this . syncController . setDateTimeMappingForStart ( playlist ) ;
@@ -165,7 +165,7 @@ QUnit.test('uses separate date time to display time mapping for each timeline',
165
165
assert . deepEqual (
166
166
this . syncController . timelineToDatetimeMappings ,
167
167
{
168
- 0 : - ( playlist . segments [ 0 ] . dateTimeObject . getTime ( ) / 1000 )
168
+ 0 : - ( playlist . segments [ 0 ] . programDateTime / 1000 )
169
169
} ,
170
170
'has correct mapping for timeline 0'
171
171
) ;
@@ -183,8 +183,8 @@ QUnit.test('uses separate date time to display time mapping for each timeline',
183
183
assert . deepEqual (
184
184
this . syncController . timelineToDatetimeMappings ,
185
185
{
186
- 0 : - ( playlist . segments [ 0 ] . dateTimeObject . getTime ( ) / 1000 ) ,
187
- 1 : - ( playlist . segments [ 1 ] . dateTimeObject . getTime ( ) / 1000 )
186
+ 0 : - ( playlist . segments [ 0 ] . programDateTime / 1000 ) ,
187
+ 1 : - ( playlist . segments [ 1 ] . programDateTime / 1000 )
188
188
} ,
189
189
'has correct mapping for timelines 0 and 1'
190
190
) ;
@@ -202,8 +202,8 @@ QUnit.test('uses separate date time to display time mapping for each timeline',
202
202
assert . deepEqual (
203
203
this . syncController . timelineToDatetimeMappings ,
204
204
{
205
- 0 : - ( playlist . segments [ 0 ] . dateTimeObject . getTime ( ) / 1000 ) ,
206
- 1 : - ( playlist . segments [ 1 ] . dateTimeObject . getTime ( ) / 1000 )
205
+ 0 : - ( playlist . segments [ 0 ] . programDateTime / 1000 ) ,
206
+ 1 : - ( playlist . segments [ 1 ] . programDateTime / 1000 )
207
207
} ,
208
208
'does not add a new timeline mapping when no disco'
209
209
) ;
@@ -221,9 +221,9 @@ QUnit.test('uses separate date time to display time mapping for each timeline',
221
221
assert . deepEqual (
222
222
this . syncController . timelineToDatetimeMappings ,
223
223
{
224
- 0 : - ( playlist . segments [ 0 ] . dateTimeObject . getTime ( ) / 1000 ) ,
225
- 1 : - ( playlist . segments [ 1 ] . dateTimeObject . getTime ( ) / 1000 ) ,
226
- 2 : - ( playlist . segments [ 3 ] . dateTimeObject . getTime ( ) / 1000 )
224
+ 0 : - ( playlist . segments [ 0 ] . programDateTime / 1000 ) ,
225
+ 1 : - ( playlist . segments [ 1 ] . programDateTime / 1000 ) ,
226
+ 2 : - ( playlist . segments [ 3 ] . programDateTime / 1000 )
227
227
} ,
228
228
'has correct mappings for timelines 0, 1, and 2'
229
229
) ;
@@ -241,7 +241,7 @@ QUnit.test('ProgramDateTime strategy finds nearest llhls sync point', function(a
241
241
assert . equal ( syncPoint , null , 'no syncpoint when no date time to display time mapping' ) ;
242
242
243
243
playlist . segments . forEach ( ( segment , index ) => {
244
- segment . dateTimeObject = new Date ( 2012 , 11 , 12 , 12 , 12 , 12 + ( index * 10 ) ) ;
244
+ segment . programDateTime = new Date ( 2012 , 11 , 12 , 12 , 12 , 12 + ( index * 10 ) ) . getTime ( ) ;
245
245
} ) ;
246
246
247
247
this . syncController . setDateTimeMappingForStart ( playlist ) ;
0 commit comments