@gcorevideo/player 2.22.15 → 2.22.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/clips/clips.ejs +1 -0
- package/assets/clips/clips.scss +23 -3
- package/assets/level-selector/list.ejs +9 -3
- package/assets/media-control/media-control.ejs +1 -9
- package/assets/media-control/media-control.scss +0 -25
- package/assets/media-control/width370.scss +4 -4
- package/dist/core.js +1 -1
- package/dist/index.css +602 -602
- package/dist/index.js +252 -229
- package/dist/player.d.ts +211 -144
- package/dist/plugins/index.css +1198 -1198
- package/dist/plugins/index.js +185 -167
- package/docs/api/{player.audioselector.md → player.audiotracks.md} +3 -3
- package/docs/api/player.contextmenu.md +2 -0
- package/docs/api/player.contextmenupluginsettings.md +2 -40
- package/docs/api/{player.contextmenupluginsettings.label.md → player.contextmenupluginsettings.options.md} +3 -3
- package/docs/api/player.md +78 -23
- package/docs/api/player.mediacontrol.md +8 -14
- package/docs/api/player.mediacontrolelement.md +4 -2
- package/docs/api/{player.contextmenupluginsettings.preventshowcontextmenu.md → player.mediacontrollayerelement.md} +5 -3
- package/docs/api/player.mediacontrolleftelement.md +16 -0
- package/docs/api/player.mediacontrolrightelement.md +16 -0
- package/docs/api/player.mediacontrolsettings.md +23 -0
- package/docs/api/{player.contextmenupluginsettings.url.md → player.menuoption.md} +10 -3
- package/docs/api/player.playbackrate.md +1 -1
- package/docs/api/player.playerconfig.md +1 -1
- package/docs/api/player.playerconfig.playbacktype.md +1 -1
- package/docs/api/{player.levelselector.events.md → player.qualitylevels.events.md} +2 -2
- package/docs/api/{player.levelselector.md → player.qualitylevels.md} +6 -6
- package/docs/api/{player.levelselectorpluginsettings.labels.md → player.qualitylevelspluginsettings.labels.md} +2 -2
- package/docs/api/{player.levelselectorpluginsettings.md → player.qualitylevelspluginsettings.md} +6 -6
- package/docs/api/{player.levelselectorpluginsettings.restrictresolution.md → player.qualitylevelspluginsettings.restrictresolution.md} +2 -2
- package/lib/plugins/clips/Clips.d.ts +21 -16
- package/lib/plugins/clips/Clips.d.ts.map +1 -1
- package/lib/plugins/clips/Clips.js +96 -98
- package/lib/plugins/clips/types.d.ts +19 -0
- package/lib/plugins/clips/types.d.ts.map +1 -0
- package/lib/plugins/clips/types.js +1 -0
- package/lib/plugins/clips/utils.d.ts +4 -0
- package/lib/plugins/clips/utils.d.ts.map +1 -0
- package/lib/plugins/clips/utils.js +36 -0
- package/lib/plugins/media-control/MediaControl.d.ts +4 -7
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +19 -31
- package/lib/plugins/utils.d.ts +9 -1
- package/lib/plugins/utils.d.ts.map +1 -1
- package/lib/plugins/utils.js +9 -10
- package/lib/plugins/vast-ads/loaderxml.js +2 -2
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +2 -5
- package/package.json +1 -1
- package/src/plugins/clips/Clips.ts +116 -135
- package/src/plugins/clips/__tests__/Clips.test.ts +72 -0
- package/src/plugins/clips/__tests__/__snapshots__/Clips.test.ts.snap +14 -0
- package/src/plugins/clips/types.ts +22 -0
- package/src/plugins/clips/utils.ts +54 -0
- package/src/plugins/level-selector/__tests__/__snapshots__/QualityLevels.test.ts.snap +18 -18
- package/src/plugins/media-control/MediaControl.ts +31 -58
- package/src/plugins/media-control/__tests__/__snapshots__/MediaControl.test.ts.snap +7 -35
- package/src/plugins/utils.ts +9 -7
- package/src/plugins/vast-ads/loaderxml.ts +2 -2
- package/src/testUtils.ts +2 -5
- package/temp/player.api.json +332 -262
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.mediacontrol.handlecustomarea.md +0 -52
|
@@ -50,14 +50,13 @@ export type MediaControlLeftElement =
|
|
|
50
50
|
| 'playstop'
|
|
51
51
|
| 'position'
|
|
52
52
|
| 'volume'
|
|
53
|
+
| 'clips'
|
|
53
54
|
|
|
54
55
|
/**
|
|
55
56
|
* Media control elements that appear in main layer, spanning the entire width of the player.
|
|
56
57
|
* @beta
|
|
57
58
|
*/
|
|
58
|
-
export type MediaControlLayerElement =
|
|
59
|
-
| 'seekbar'
|
|
60
|
-
| 'seekBarContainer' // TODO rename seekbar
|
|
59
|
+
export type MediaControlLayerElement = 'seekbar' | 'seekBarContainer' // TODO rename seekbar
|
|
61
60
|
|
|
62
61
|
/**
|
|
63
62
|
* Media control elements that appear in the right area.
|
|
@@ -96,9 +95,7 @@ export type MediaControlSettings = {
|
|
|
96
95
|
|
|
97
96
|
const DEFAULT_SETTINGS: MediaControlSettings = {
|
|
98
97
|
default: [],
|
|
99
|
-
left: [
|
|
100
|
-
'dvr'
|
|
101
|
-
],
|
|
98
|
+
left: ['dvr'],
|
|
102
99
|
right: [
|
|
103
100
|
'audiotracks',
|
|
104
101
|
'cc',
|
|
@@ -114,12 +111,9 @@ const DEFAULT_SETTINGS: MediaControlSettings = {
|
|
|
114
111
|
}
|
|
115
112
|
|
|
116
113
|
const INITIAL_SETTINGS: MediaControlSettings = {
|
|
117
|
-
left: [
|
|
118
|
-
],
|
|
119
|
-
|
|
120
|
-
],
|
|
121
|
-
default: [
|
|
122
|
-
],
|
|
114
|
+
left: [],
|
|
115
|
+
right: [],
|
|
116
|
+
default: [],
|
|
123
117
|
seekEnabled: false,
|
|
124
118
|
}
|
|
125
119
|
|
|
@@ -155,13 +149,13 @@ type DisabledClickable = {
|
|
|
155
149
|
* @beta
|
|
156
150
|
* @remarks
|
|
157
151
|
* The methods exposed are to be used by the other plugins that extend the media control UI.
|
|
158
|
-
*
|
|
152
|
+
*
|
|
159
153
|
* Configuration options:
|
|
160
154
|
*
|
|
161
155
|
* - `mediaControl`: {@link MediaControlSettings} - specifies the allowed media control elements in each area
|
|
162
156
|
*
|
|
163
157
|
* - `persistConfig`: boolean - `common` option, makes the plugin persist the media control settings
|
|
164
|
-
*
|
|
158
|
+
*
|
|
165
159
|
* - `chromeless`: boolean
|
|
166
160
|
*/
|
|
167
161
|
export class MediaControl extends UICorePlugin {
|
|
@@ -213,10 +207,6 @@ export class MediaControl extends UICorePlugin {
|
|
|
213
207
|
|
|
214
208
|
private verticalVolume = false
|
|
215
209
|
|
|
216
|
-
private $clipText: ZeptoResult | null = null
|
|
217
|
-
|
|
218
|
-
private $clipTextContainer: ZeptoResult | null = null
|
|
219
|
-
|
|
220
210
|
private $duration: ZeptoResult | null = null
|
|
221
211
|
|
|
222
212
|
private $fullscreenToggle: ZeptoResult | null = null
|
|
@@ -499,13 +489,9 @@ export class MediaControl extends UICorePlugin {
|
|
|
499
489
|
Events.CONTAINER_LOADEDMETADATA,
|
|
500
490
|
this.onLoadedMetadata,
|
|
501
491
|
)
|
|
502
|
-
this.listenTo(
|
|
503
|
-
this.
|
|
504
|
-
|
|
505
|
-
() => {
|
|
506
|
-
this.cancelRenderTimer()
|
|
507
|
-
},
|
|
508
|
-
)
|
|
492
|
+
this.listenTo(this.core, Events.CONTAINER_DESTROYED, () => {
|
|
493
|
+
this.cancelRenderTimer()
|
|
494
|
+
})
|
|
509
495
|
}
|
|
510
496
|
|
|
511
497
|
/**
|
|
@@ -516,7 +502,7 @@ export class MediaControl extends UICorePlugin {
|
|
|
516
502
|
this.userDisabled = true // TODO distinguish between user and system (e.g., unplayable) disabled?
|
|
517
503
|
this.hide()
|
|
518
504
|
this.unbindKeyEvents()
|
|
519
|
-
this.$el.hide()
|
|
505
|
+
this.$el.hide() // TODO why?
|
|
520
506
|
}
|
|
521
507
|
|
|
522
508
|
/**
|
|
@@ -1080,13 +1066,12 @@ export class MediaControl extends UICorePlugin {
|
|
|
1080
1066
|
)
|
|
1081
1067
|
trace(`${T} updateSettings`, { newSettings })
|
|
1082
1068
|
|
|
1083
|
-
|
|
1069
|
+
newSettings.left.push('clips') // TODO
|
|
1084
1070
|
// TODO make order controlled via CSS
|
|
1085
1071
|
newSettings.left = orderByOrderPattern(
|
|
1086
|
-
[...newSettings.left, '
|
|
1072
|
+
[...newSettings.left, 'volume', 'clips'],
|
|
1087
1073
|
LEFT_ORDER,
|
|
1088
1074
|
)
|
|
1089
|
-
|
|
1090
1075
|
if (
|
|
1091
1076
|
this.core.activePlayback.getPlaybackType() === Playback.LIVE &&
|
|
1092
1077
|
this.core.activePlayback.dvrEnabled
|
|
@@ -1098,8 +1083,7 @@ export class MediaControl extends UICorePlugin {
|
|
|
1098
1083
|
newSettings.right = DEFAULT_SETTINGS.right // TODO get from the options
|
|
1099
1084
|
|
|
1100
1085
|
if (
|
|
1101
|
-
(!this.fullScreenOnVideoTagSupported &&
|
|
1102
|
-
!fullscreenEnabled()) ||
|
|
1086
|
+
(!this.fullScreenOnVideoTagSupported && !fullscreenEnabled()) ||
|
|
1103
1087
|
this.options.fullscreenDisable
|
|
1104
1088
|
) {
|
|
1105
1089
|
trace(`${T} updateSettings removing fullscreen`, {
|
|
@@ -1163,11 +1147,6 @@ export class MediaControl extends UICorePlugin {
|
|
|
1163
1147
|
this.$multiCameraSelector = this.$el.find(
|
|
1164
1148
|
'.media-control-multicamera[data-multicamera]',
|
|
1165
1149
|
)
|
|
1166
|
-
this.$clipText = this.$el.find('.media-clip-text[data-clipstext]') // TODO
|
|
1167
|
-
this.$clipTextContainer = this.$el.find(
|
|
1168
|
-
'.media-clip-container[data-clipstext]',
|
|
1169
|
-
)
|
|
1170
|
-
|
|
1171
1150
|
this.resetIndicators()
|
|
1172
1151
|
this.initializeIcons()
|
|
1173
1152
|
}
|
|
@@ -1183,26 +1162,14 @@ export class MediaControl extends UICorePlugin {
|
|
|
1183
1162
|
* ```ts
|
|
1184
1163
|
* class MyPlugin extends UICorePlugin {
|
|
1185
1164
|
* override render() {
|
|
1186
|
-
*
|
|
1187
|
-
*
|
|
1188
|
-
* clipText?.el.text('Here we go')
|
|
1165
|
+
* this.$el.html('<div data-clips>Here we go</div>')
|
|
1166
|
+
* this.core.getPlugin('media_control').mount('clips', this.$el)
|
|
1189
1167
|
* return this
|
|
1190
1168
|
* }
|
|
1191
1169
|
* }
|
|
1192
1170
|
* ```
|
|
1193
1171
|
*/
|
|
1194
|
-
|
|
1195
|
-
switch (name) {
|
|
1196
|
-
case 'audiotracks':
|
|
1197
|
-
return null
|
|
1198
|
-
case 'clipText':
|
|
1199
|
-
return this.$clipText
|
|
1200
|
-
case 'seekBarContainer':
|
|
1201
|
-
return this.$seekBarContainer
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1205
|
-
putElement(name: MediaControlElement, element: ZeptoResult) {
|
|
1172
|
+
mount(name: MediaControlElement, element: ZeptoResult) {
|
|
1206
1173
|
const panel = this.getElementLocation(name)
|
|
1207
1174
|
trace(`${T} putElement`, { name, panel: !!panel })
|
|
1208
1175
|
if (panel) {
|
|
@@ -1221,6 +1188,10 @@ export class MediaControl extends UICorePlugin {
|
|
|
1221
1188
|
}
|
|
1222
1189
|
}
|
|
1223
1190
|
|
|
1191
|
+
putElement(name: MediaControlElement, element: ZeptoResult) {
|
|
1192
|
+
this.mount(name, element)
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1224
1195
|
/**
|
|
1225
1196
|
* Toggle the visibility of a media control element
|
|
1226
1197
|
* @param name - The name of the media control element
|
|
@@ -1284,12 +1255,12 @@ export class MediaControl extends UICorePlugin {
|
|
|
1284
1255
|
return
|
|
1285
1256
|
}
|
|
1286
1257
|
|
|
1287
|
-
const currentTime = this.
|
|
1288
|
-
const duration = this.
|
|
1258
|
+
const currentTime = this.core.activeContainer.getCurrentTime()
|
|
1259
|
+
const duration = this.core.activeContainer.getDuration()
|
|
1289
1260
|
let position = Math.min(Math.max(currentTime + delta, 0), duration)
|
|
1290
1261
|
|
|
1291
1262
|
position = Math.min((position * 100) / duration, 100)
|
|
1292
|
-
this.
|
|
1263
|
+
this.core.activeContainer.seekPercentage(position)
|
|
1293
1264
|
}
|
|
1294
1265
|
|
|
1295
1266
|
private bindKeyAndShow(key: string, callback: () => boolean | undefined) {
|
|
@@ -1427,7 +1398,10 @@ export class MediaControl extends UICorePlugin {
|
|
|
1427
1398
|
* @internal
|
|
1428
1399
|
*/
|
|
1429
1400
|
override render() {
|
|
1430
|
-
trace(`${T} render`, {
|
|
1401
|
+
trace(`${T} render`, {
|
|
1402
|
+
needsUpdate: this.hasUpdate,
|
|
1403
|
+
metadataLoaded: this.metadataLoaded,
|
|
1404
|
+
})
|
|
1431
1405
|
if (!this.hasUpdate || !this.metadataLoaded) {
|
|
1432
1406
|
return this
|
|
1433
1407
|
}
|
|
@@ -1491,7 +1465,7 @@ export class MediaControl extends UICorePlugin {
|
|
|
1491
1465
|
|
|
1492
1466
|
this.rendered = true
|
|
1493
1467
|
this.updateVolumeUI()
|
|
1494
|
-
|
|
1468
|
+
|
|
1495
1469
|
this.hasUpdate = false
|
|
1496
1470
|
// TODO setTimeout?
|
|
1497
1471
|
this.trigger(Events.MEDIACONTROL_RENDERED)
|
|
@@ -1615,8 +1589,7 @@ MediaControl.extend = function (properties) {
|
|
|
1615
1589
|
}
|
|
1616
1590
|
|
|
1617
1591
|
function serializeSettings(s: MediaControlSettings) {
|
|
1618
|
-
return (s.left
|
|
1619
|
-
.slice() as MediaControlElement[])
|
|
1592
|
+
return (s.left.slice() as MediaControlElement[])
|
|
1620
1593
|
.sort()
|
|
1621
1594
|
.concat(s.right.slice().sort())
|
|
1622
1595
|
.concat(s.default.slice().sort())
|
|
@@ -13,7 +13,6 @@ exports[`MediaControl > putElement > audiotracks > should put the element in the
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
|
|
@@ -36,10 +35,7 @@ exports[`MediaControl > putElement > audiotracks > should put the element in the
|
|
|
36
35
|
|
|
37
36
|
</div>
|
|
38
37
|
|
|
39
|
-
<div class="media-
|
|
40
|
-
<div class="media-clip-point gcore-skin-text-color" data-clipstext="">•</div>
|
|
41
|
-
<div class="media-clip-text gcore-skin-text-color" data-clipstext=""></div>
|
|
42
|
-
</div>
|
|
38
|
+
<div class="media-control-indicator gcore-skin-text-color" data-clips=""></div>
|
|
43
39
|
|
|
44
40
|
</div>
|
|
45
41
|
|
|
@@ -72,7 +68,6 @@ exports[`MediaControl > putElement > cc > should put the element in the right pa
|
|
|
72
68
|
|
|
73
69
|
|
|
74
70
|
|
|
75
|
-
|
|
76
71
|
|
|
77
72
|
|
|
78
73
|
|
|
@@ -95,10 +90,7 @@ exports[`MediaControl > putElement > cc > should put the element in the right pa
|
|
|
95
90
|
|
|
96
91
|
</div>
|
|
97
92
|
|
|
98
|
-
<div class="media-
|
|
99
|
-
<div class="media-clip-point gcore-skin-text-color" data-clipstext="">•</div>
|
|
100
|
-
<div class="media-clip-text gcore-skin-text-color" data-clipstext=""></div>
|
|
101
|
-
</div>
|
|
93
|
+
<div class="media-control-indicator gcore-skin-text-color" data-clips=""></div>
|
|
102
94
|
|
|
103
95
|
</div>
|
|
104
96
|
|
|
@@ -131,7 +123,6 @@ exports[`MediaControl > putElement > gear > should put the element in the right
|
|
|
131
123
|
|
|
132
124
|
|
|
133
125
|
|
|
134
|
-
|
|
135
126
|
|
|
136
127
|
|
|
137
128
|
|
|
@@ -154,10 +145,7 @@ exports[`MediaControl > putElement > gear > should put the element in the right
|
|
|
154
145
|
|
|
155
146
|
</div>
|
|
156
147
|
|
|
157
|
-
<div class="media-
|
|
158
|
-
<div class="media-clip-point gcore-skin-text-color" data-clipstext="">•</div>
|
|
159
|
-
<div class="media-clip-text gcore-skin-text-color" data-clipstext=""></div>
|
|
160
|
-
</div>
|
|
148
|
+
<div class="media-control-indicator gcore-skin-text-color" data-clips=""></div>
|
|
161
149
|
|
|
162
150
|
</div>
|
|
163
151
|
|
|
@@ -190,7 +178,6 @@ exports[`MediaControl > putElement > pip > should put the element in the right p
|
|
|
190
178
|
|
|
191
179
|
|
|
192
180
|
|
|
193
|
-
|
|
194
181
|
|
|
195
182
|
|
|
196
183
|
|
|
@@ -213,10 +200,7 @@ exports[`MediaControl > putElement > pip > should put the element in the right p
|
|
|
213
200
|
|
|
214
201
|
</div>
|
|
215
202
|
|
|
216
|
-
<div class="media-
|
|
217
|
-
<div class="media-clip-point gcore-skin-text-color" data-clipstext="">•</div>
|
|
218
|
-
<div class="media-clip-text gcore-skin-text-color" data-clipstext=""></div>
|
|
219
|
-
</div>
|
|
203
|
+
<div class="media-control-indicator gcore-skin-text-color" data-clips=""></div>
|
|
220
204
|
|
|
221
205
|
</div>
|
|
222
206
|
|
|
@@ -249,7 +233,6 @@ exports[`MediaControl > rendering timing > once metadata is loaded > should wait
|
|
|
249
233
|
|
|
250
234
|
|
|
251
235
|
|
|
252
|
-
|
|
253
236
|
|
|
254
237
|
|
|
255
238
|
|
|
@@ -278,10 +261,7 @@ exports[`MediaControl > rendering timing > once metadata is loaded > should wait
|
|
|
278
261
|
|
|
279
262
|
<div class="media-control-indicator gcore-skin-text-color" data-duration="">00:00</div>
|
|
280
263
|
|
|
281
|
-
<div class="media-
|
|
282
|
-
<div class="media-clip-point gcore-skin-text-color" data-clipstext="">•</div>
|
|
283
|
-
<div class="media-clip-text gcore-skin-text-color" data-clipstext=""></div>
|
|
284
|
-
</div>
|
|
264
|
+
<div class="media-control-indicator gcore-skin-text-color" data-clips=""></div>
|
|
285
265
|
|
|
286
266
|
</div>
|
|
287
267
|
|
|
@@ -329,7 +309,6 @@ exports[`MediaControl > updateSettings > dvr > when disabled > should disable DV
|
|
|
329
309
|
|
|
330
310
|
|
|
331
311
|
|
|
332
|
-
|
|
333
312
|
|
|
334
313
|
|
|
335
314
|
|
|
@@ -358,10 +337,7 @@ exports[`MediaControl > updateSettings > dvr > when disabled > should disable DV
|
|
|
358
337
|
|
|
359
338
|
<div class="media-control-indicator gcore-skin-text-color" data-duration="">00:00</div>
|
|
360
339
|
|
|
361
|
-
<div class="media-
|
|
362
|
-
<div class="media-clip-point gcore-skin-text-color" data-clipstext="">•</div>
|
|
363
|
-
<div class="media-clip-text gcore-skin-text-color" data-clipstext=""></div>
|
|
364
|
-
</div>
|
|
340
|
+
<div class="media-control-indicator gcore-skin-text-color" data-clips=""></div>
|
|
365
341
|
|
|
366
342
|
</div>
|
|
367
343
|
|
|
@@ -394,7 +370,6 @@ exports[`MediaControl > updateSettings > dvr > when enabled > should enable DVR
|
|
|
394
370
|
|
|
395
371
|
|
|
396
372
|
|
|
397
|
-
|
|
398
373
|
|
|
399
374
|
|
|
400
375
|
|
|
@@ -423,10 +398,7 @@ exports[`MediaControl > updateSettings > dvr > when enabled > should enable DVR
|
|
|
423
398
|
|
|
424
399
|
<div class="media-control-indicator gcore-skin-text-color" data-duration="">00:00</div>
|
|
425
400
|
|
|
426
|
-
<div class="media-
|
|
427
|
-
<div class="media-clip-point gcore-skin-text-color" data-clipstext="">•</div>
|
|
428
|
-
<div class="media-clip-text gcore-skin-text-color" data-clipstext=""></div>
|
|
429
|
-
</div>
|
|
401
|
+
<div class="media-control-indicator gcore-skin-text-color" data-clips=""></div>
|
|
430
402
|
|
|
431
403
|
<div class="my-dvr-controls" data-dvr="">live</div></div>
|
|
432
404
|
|
package/src/plugins/utils.ts
CHANGED
|
@@ -6,7 +6,15 @@ export function getLocation(href: string) {
|
|
|
6
6
|
return l;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Parse a time string in the format "hh:mm:ss" or "mm:ss" or "ss" to seconds.
|
|
11
|
+
* @param str - The time string to parse.
|
|
12
|
+
* @returns The time in seconds.
|
|
13
|
+
* @example "01:01:00" -> 3660
|
|
14
|
+
* @example "01:00" -> 60
|
|
15
|
+
* @example "33" -> 33
|
|
16
|
+
*/
|
|
17
|
+
export function parseClipTime(str: string): number {
|
|
10
18
|
if (!str) {
|
|
11
19
|
return 0;
|
|
12
20
|
}
|
|
@@ -15,19 +23,13 @@ export function strtimeToMiliseconds(str: string): number {
|
|
|
15
23
|
|
|
16
24
|
if (arr.length >= 3) {
|
|
17
25
|
h = parseInt(arr[arr.length - 3]) * 60 * 60;
|
|
18
|
-
} else {
|
|
19
|
-
h = 0;
|
|
20
26
|
}
|
|
21
27
|
if (arr.length >= 2) {
|
|
22
28
|
m = parseInt(arr[arr.length - 2]) * 60;
|
|
23
|
-
} else {
|
|
24
|
-
m = 0;
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
if (arr.length >= 1) {
|
|
28
32
|
s = parseInt(arr[arr.length - 1]);
|
|
29
|
-
} else {
|
|
30
|
-
s = 0;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
return (h + m + s);
|
|
@@ -2,7 +2,7 @@ import { reportError } from '@gcorevideo/utils';
|
|
|
2
2
|
import assert from 'assert';
|
|
3
3
|
import URLHandler from './urlhandler.js';
|
|
4
4
|
import MergeVast from './xmlmerge.js';
|
|
5
|
-
import {
|
|
5
|
+
import { parseClipTime } from '../utils.js';
|
|
6
6
|
|
|
7
7
|
export default class LoaderXML {
|
|
8
8
|
private config: string = '';
|
|
@@ -104,7 +104,7 @@ export default class LoaderXML {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
if (linearSkipOffset && linearSkipOffset.length > 1) {
|
|
107
|
-
timeOffset =
|
|
107
|
+
timeOffset = parseClipTime(linearSkipOffset[1]);
|
|
108
108
|
this.config = this.config.replace(/<Linear skipoffset="(\d+:\d+:\d+)".*?>/g, '<Linear>');
|
|
109
109
|
}
|
|
110
110
|
|
package/src/testUtils.ts
CHANGED
|
@@ -184,14 +184,11 @@ export function createMockMediaControl(core: any) {
|
|
|
184
184
|
<div class="media-control-right-panel" data-media-control></div>
|
|
185
185
|
<div class="media-control-center-panel" data-media-control></div>`,
|
|
186
186
|
)
|
|
187
|
-
const elements = {
|
|
188
|
-
gear: $(document.createElement('div')),
|
|
189
|
-
}
|
|
190
|
-
// @ts-ignore
|
|
191
|
-
mediaControl.getElement = vi.fn().mockImplementation((name) => elements[name])
|
|
192
187
|
// @ts-ignore
|
|
193
188
|
mediaControl.putElement = vi.fn()
|
|
194
189
|
// @ts-ignore
|
|
190
|
+
mediaControl.mount = vi.fn()
|
|
191
|
+
// @ts-ignore
|
|
195
192
|
mediaControl.toggleElement = vi.fn()
|
|
196
193
|
return mediaControl
|
|
197
194
|
}
|