@gcorevideo/player 2.21.3 → 2.21.4
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/audio-selector/style.scss +1 -1
- package/assets/audio-selector/track-selector.ejs +3 -3
- package/assets/bottom-gear/bottomgear.ejs +2 -2
- package/assets/media-control/container.scss +1 -1
- package/assets/media-control/media-control.ejs +1 -6
- package/assets/media-control/media-control.scss +6 -4
- package/assets/media-control/width270.scss +1 -1
- package/assets/media-control/width370.scss +4 -4
- package/assets/playback-rate/button.ejs +2 -2
- package/assets/playback-rate/list.ejs +4 -4
- package/assets/subtitles/combobox.ejs +5 -5
- package/assets/subtitles/string.ejs +1 -1
- package/assets/subtitles/style.scss +2 -2
- package/dist/core.js +2 -1
- package/dist/index.css +972 -967
- package/dist/index.js +126 -106
- package/dist/player.d.ts +141 -119
- package/dist/plugins/index.css +801 -796
- package/dist/plugins/index.js +119 -104
- package/docs/api/player.bottomgear.getelement.md +2 -2
- package/docs/api/player.bottomgear.md +1 -1
- package/docs/api/{player.subtitles.hide.md → player.closedcaptions.hide.md} +2 -2
- package/docs/api/{player.subtitles.md → player.closedcaptions.md} +11 -11
- package/docs/api/{player.subtitles.show.md → player.closedcaptions.show.md} +2 -2
- package/docs/api/player.closedcaptionspluginsettings.md +13 -0
- package/docs/api/player.gearitemelement.md +6 -4
- package/docs/api/player.gearoptionsitem.md +16 -0
- package/docs/api/player.md +48 -12
- package/docs/api/player.mediacontrol.putelement.md +2 -2
- package/docs/api/player.mediacontrolelement.md +1 -1
- package/docs/api/player.playbackrate.md +1 -1
- package/docs/api/player.subtitlespluginsettings.md +18 -0
- package/docs/api/player.texttrackitem.id.md +11 -0
- package/docs/api/player.texttrackitem.md +87 -0
- package/docs/api/player.texttrackitem.name.md +11 -0
- package/docs/api/player.texttrackitem.track.md +11 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.plugins.d.ts +2 -1
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +2 -1
- package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
- package/lib/playback/dash-playback/DashPlayback.js +1 -0
- package/lib/plugins/audio-selector/AudioSelector.d.ts +2 -3
- package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -1
- package/lib/plugins/audio-selector/AudioSelector.js +6 -7
- package/lib/plugins/bottom-gear/BottomGear.d.ts +6 -2
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +2 -1
- package/lib/plugins/media-control/MediaControl.d.ts +5 -5
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +46 -39
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +1 -0
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -1
- package/lib/plugins/picture-in-picture/PictureInPicture.js +4 -4
- package/lib/plugins/playback-rate/PlaybackRate.d.ts +0 -1
- package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
- package/lib/plugins/playback-rate/PlaybackRate.js +23 -14
- package/lib/plugins/subtitles/ClosedCaptions.d.ts +118 -0
- package/lib/plugins/subtitles/ClosedCaptions.d.ts.map +1 -0
- package/lib/plugins/subtitles/ClosedCaptions.js +348 -0
- package/lib/plugins/subtitles/Subtitles.d.ts +12 -9
- package/lib/plugins/subtitles/Subtitles.d.ts.map +1 -1
- package/lib/plugins/subtitles/Subtitles.js +31 -32
- package/lib/testUtils.d.ts +22 -18
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +22 -36
- package/package.json +1 -1
- package/src/index.plugins.ts +2 -1
- package/src/index.ts +1 -1
- package/src/playback/dash-playback/DashPlayback.ts +1 -0
- package/src/plugins/audio-selector/AudioSelector.ts +9 -8
- package/src/plugins/bottom-gear/BottomGear.ts +11 -4
- package/src/plugins/bottom-gear/__tests__/BottomGear.test.ts +1 -1
- package/src/plugins/bottom-gear/__tests__/__snapshots__/BottomGear.test.ts.snap +2 -2
- package/src/plugins/media-control/MediaControl.ts +53 -46
- package/src/plugins/media-control/__tests__/MediaControl.test.ts +43 -0
- package/src/plugins/media-control/__tests__/__snapshots__/MediaControl.test.ts.snap +175 -0
- package/src/plugins/picture-in-picture/PictureInPicture.ts +5 -5
- package/src/plugins/playback-rate/PlaybackRate.ts +142 -100
- package/src/plugins/playback-rate/__tests__/PlaybackRate.test.ts +65 -0
- package/src/plugins/playback-rate/__tests__/__snapshots__/PlaybackRate.test.ts.snap +11 -0
- package/src/plugins/subtitles/{Subtitles.ts → ClosedCaptions.ts} +42 -34
- package/src/plugins/subtitles/__tests__/ClosedCaptions.test.ts +58 -0
- package/src/plugins/subtitles/__tests__/__snapshots__/ClosedCaptions.test.ts.snap +25 -0
- package/src/testUtils.ts +22 -36
- package/temp/player.api.json +269 -89
- package/tsconfig.tsbuildinfo +1 -1
- package/src/plugins/index.ts +0 -39
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`PlaybackRate > should render 1`] = `
|
|
4
|
+
"<button class="gplayer-lite-btn gcore-skin-text-color gear-option" id="playback-rate-button">
|
|
5
|
+
<span class="gear-option_speed-icon">/assets/icons/new/speed.svg</span>
|
|
6
|
+
<span class="gear-option_label">playback_rate</span>
|
|
7
|
+
<span class="gear-option_arrow-right-icon">/assets/icons/new/arrow-right.svg</span>
|
|
8
|
+
<span class="gear-option_value">1x</span>
|
|
9
|
+
</button>
|
|
10
|
+
"
|
|
11
|
+
`;
|
|
@@ -16,42 +16,50 @@ import type { ZeptoResult } from '../../types.js'
|
|
|
16
16
|
|
|
17
17
|
const VERSION: string = '2.19.14'
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const LOCAL_STORAGE_CC_ID = 'gplayer.plugins.cc.selected'
|
|
20
20
|
|
|
21
|
-
const T = 'plugins.
|
|
21
|
+
const T = 'plugins.cc'
|
|
22
22
|
|
|
23
|
-
export type
|
|
23
|
+
export type ClosedCaptionsPluginSettings = {
|
|
24
24
|
/**
|
|
25
25
|
* Initially selected subtitles language
|
|
26
26
|
*/
|
|
27
27
|
language?: string
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Use {@link ClosedCaptionsPluginSettings} instead.
|
|
32
|
+
*/
|
|
33
|
+
export type SubtitlesPluginSettings = ClosedCaptionsPluginSettings;
|
|
34
|
+
|
|
30
35
|
/**
|
|
31
36
|
* `PLUGIN` that provides a UI to select the subtitles when available.
|
|
32
37
|
* @beta
|
|
33
38
|
*
|
|
34
39
|
* @remarks
|
|
40
|
+
* The plugin is activated when closed captions tracks are provided with the media source.
|
|
41
|
+
* It shows a familiar "CC" button with a dropdown menu to select the subtitles language.
|
|
42
|
+
*
|
|
35
43
|
* Depends on:
|
|
36
44
|
*
|
|
37
45
|
* - {@link MediaControl}
|
|
38
46
|
*
|
|
39
|
-
* Configuration options - {@link
|
|
47
|
+
* Configuration options - {@link ClosedCaptionsPluginSettings}
|
|
40
48
|
* @example
|
|
41
49
|
* ```ts
|
|
42
|
-
* import {
|
|
50
|
+
* import { ClosedCaptions } from '@gcorevideo/player'
|
|
43
51
|
*
|
|
44
|
-
* Player.registerPlugin(
|
|
52
|
+
* Player.registerPlugin(ClosedCaptions)
|
|
45
53
|
*
|
|
46
54
|
* new Player({
|
|
47
55
|
* ...
|
|
48
|
-
*
|
|
56
|
+
* cc: {
|
|
49
57
|
* language: 'en',
|
|
50
58
|
* },
|
|
51
59
|
* })
|
|
52
60
|
* ```
|
|
53
61
|
*/
|
|
54
|
-
export class
|
|
62
|
+
export class ClosedCaptions extends UICorePlugin {
|
|
55
63
|
private isPreselectedApplied = false
|
|
56
64
|
|
|
57
65
|
private isShowing = false
|
|
@@ -60,13 +68,13 @@ export class Subtitles extends UICorePlugin {
|
|
|
60
68
|
|
|
61
69
|
private tracks: TextTrackItem[] = []
|
|
62
70
|
|
|
63
|
-
private $
|
|
71
|
+
private $line: ZeptoResult | null = null
|
|
64
72
|
|
|
65
73
|
/**
|
|
66
74
|
* @internal
|
|
67
75
|
*/
|
|
68
76
|
get name() {
|
|
69
|
-
return '
|
|
77
|
+
return 'cc'
|
|
70
78
|
}
|
|
71
79
|
|
|
72
80
|
/**
|
|
@@ -92,8 +100,7 @@ export class Subtitles extends UICorePlugin {
|
|
|
92
100
|
*/
|
|
93
101
|
override get attributes() {
|
|
94
102
|
return {
|
|
95
|
-
class: 'media-control-
|
|
96
|
-
'data-subtitles': '',
|
|
103
|
+
class: 'media-control-cc',
|
|
97
104
|
}
|
|
98
105
|
}
|
|
99
106
|
|
|
@@ -102,13 +109,13 @@ export class Subtitles extends UICorePlugin {
|
|
|
102
109
|
*/
|
|
103
110
|
override get events() {
|
|
104
111
|
return {
|
|
105
|
-
'click [data-
|
|
106
|
-
'click [data-
|
|
112
|
+
'click [data-cc-select]': 'onItemSelect',
|
|
113
|
+
'click [data-cc-button]': 'toggleMenu',
|
|
107
114
|
}
|
|
108
115
|
}
|
|
109
116
|
|
|
110
117
|
private get preselectedLanguage(): string {
|
|
111
|
-
return this.core.options.subtitles?.language ?? ''
|
|
118
|
+
return this.core.options.cc?.language ?? this.core.options.subtitles?.language ?? ''
|
|
112
119
|
}
|
|
113
120
|
|
|
114
121
|
/**
|
|
@@ -269,7 +276,7 @@ export class Subtitles extends UICorePlugin {
|
|
|
269
276
|
hide() {
|
|
270
277
|
this.isShowing = false
|
|
271
278
|
this.renderIcon()
|
|
272
|
-
this.$
|
|
279
|
+
this.$line.hide()
|
|
273
280
|
if (this.tracks) {
|
|
274
281
|
for (const t of this.tracks) {
|
|
275
282
|
t.track.mode = 'hidden'
|
|
@@ -290,25 +297,25 @@ export class Subtitles extends UICorePlugin {
|
|
|
290
297
|
this.track.track.mode &&
|
|
291
298
|
Browser.isiOS
|
|
292
299
|
) {
|
|
293
|
-
this.$
|
|
300
|
+
this.$line.hide()
|
|
294
301
|
this.track.track.mode = 'showing'
|
|
295
302
|
} else {
|
|
296
|
-
this.$
|
|
303
|
+
this.$line.show()
|
|
297
304
|
}
|
|
298
305
|
}
|
|
299
306
|
|
|
300
307
|
private shouldRender() {
|
|
301
|
-
return this.tracks
|
|
308
|
+
return this.tracks?.length > 0
|
|
302
309
|
}
|
|
303
310
|
|
|
304
311
|
private resizeFont() {
|
|
305
|
-
if (!this.$
|
|
312
|
+
if (!this.$line) {
|
|
306
313
|
return
|
|
307
314
|
}
|
|
308
315
|
|
|
309
316
|
const skinWidth = this.core.activeContainer.$el.width()
|
|
310
317
|
|
|
311
|
-
this.$
|
|
318
|
+
this.$line.find('p').css('font-size', skinWidth * 0.03)
|
|
312
319
|
}
|
|
313
320
|
|
|
314
321
|
/**
|
|
@@ -325,13 +332,13 @@ export class Subtitles extends UICorePlugin {
|
|
|
325
332
|
|
|
326
333
|
const mediaControl = this.core.getPlugin('media_control')
|
|
327
334
|
|
|
328
|
-
this.$el.html(
|
|
329
|
-
this.core.activeContainer.$el.find('
|
|
330
|
-
this.$
|
|
335
|
+
this.$el.html(ClosedCaptions.template({ tracks: this.tracks }))
|
|
336
|
+
this.core.activeContainer.$el.find('#cc-line').remove()
|
|
337
|
+
this.$line = $(ClosedCaptions.templateString())
|
|
331
338
|
this.resizeFont()
|
|
332
339
|
|
|
333
|
-
this.core.activeContainer.$el.append(this.$
|
|
334
|
-
mediaControl.putElement('
|
|
340
|
+
this.core.activeContainer.$el.append(this.$line)
|
|
341
|
+
mediaControl.putElement('cc', this.el)
|
|
335
342
|
|
|
336
343
|
this.updateSelection()
|
|
337
344
|
|
|
@@ -353,11 +360,11 @@ export class Subtitles extends UICorePlugin {
|
|
|
353
360
|
}
|
|
354
361
|
|
|
355
362
|
private onItemSelect(event: MouseEvent) {
|
|
356
|
-
const id = (event.target as HTMLElement).dataset.
|
|
363
|
+
const id = (event.target as HTMLElement).dataset.ccSelect ?? '-1'
|
|
357
364
|
|
|
358
365
|
trace(`${T} onItemSelect`, { id })
|
|
359
366
|
|
|
360
|
-
localStorage.setItem(
|
|
367
|
+
localStorage.setItem(LOCAL_STORAGE_CC_ID, id)
|
|
361
368
|
this.selectItem(this.findById(Number(id)))
|
|
362
369
|
|
|
363
370
|
return false
|
|
@@ -380,21 +387,22 @@ export class Subtitles extends UICorePlugin {
|
|
|
380
387
|
}
|
|
381
388
|
|
|
382
389
|
private hideMenu() {
|
|
383
|
-
;(this.$('[data-
|
|
390
|
+
;(this.$('[data-cc] ul') as ZeptoResult).hide()
|
|
384
391
|
}
|
|
385
392
|
|
|
386
393
|
private toggleMenu() {
|
|
387
|
-
|
|
394
|
+
trace(`${T} toggleMenu`)
|
|
395
|
+
;(this.$('[data-cc] ul') as ZeptoResult).toggle()
|
|
388
396
|
}
|
|
389
397
|
|
|
390
398
|
private itemElement(id: number): ZeptoResult {
|
|
391
399
|
return (
|
|
392
|
-
this.$(`ul li a[data-
|
|
400
|
+
this.$(`ul li a[data-cc-select="${id}"]`) as ZeptoResult
|
|
393
401
|
).parent()
|
|
394
402
|
}
|
|
395
403
|
|
|
396
404
|
private allItemElements(): ZeptoResult {
|
|
397
|
-
return this.$('[data-
|
|
405
|
+
return this.$('[data-cc] li')
|
|
398
406
|
}
|
|
399
407
|
|
|
400
408
|
private selectSubtitles() {
|
|
@@ -420,7 +428,7 @@ export class Subtitles extends UICorePlugin {
|
|
|
420
428
|
}
|
|
421
429
|
|
|
422
430
|
private setSubtitleText(text: string | DocumentFragment) {
|
|
423
|
-
this.$
|
|
431
|
+
this.$line.find('p').html(text)
|
|
424
432
|
}
|
|
425
433
|
|
|
426
434
|
private clearSubtitleText() {
|
|
@@ -456,6 +464,6 @@ export class Subtitles extends UICorePlugin {
|
|
|
456
464
|
private renderIcon() {
|
|
457
465
|
const icon = this.isShowing ? subtitlesOnIcon : subtitlesOffIcon
|
|
458
466
|
|
|
459
|
-
this.$el.find('span.
|
|
467
|
+
this.$el.find('span.cc-text').html(icon)
|
|
460
468
|
}
|
|
461
469
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|
2
|
+
import { ClosedCaptions } from '../ClosedCaptions.js'
|
|
3
|
+
import { createMockCore, createMockMediaControl } from '../../../testUtils.js';
|
|
4
|
+
|
|
5
|
+
describe('ClosedCaptions', () => {
|
|
6
|
+
let core: any;
|
|
7
|
+
let mediaControl: any;
|
|
8
|
+
let cc: ClosedCaptions;
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
core = createMockCore()
|
|
11
|
+
mediaControl = createMockMediaControl(core)
|
|
12
|
+
core.getPlugin = vi.fn().mockImplementation((name) => {
|
|
13
|
+
if (name === 'media_control') {
|
|
14
|
+
return mediaControl
|
|
15
|
+
}
|
|
16
|
+
return null
|
|
17
|
+
})
|
|
18
|
+
cc = new ClosedCaptions(core)
|
|
19
|
+
})
|
|
20
|
+
describe('basically', () => {
|
|
21
|
+
beforeEach(() => {
|
|
22
|
+
core.emit('core:ready')
|
|
23
|
+
core.activePlayback.el = document.createElement('video')
|
|
24
|
+
core.emit('core:active:container:changed', core.activeContainer)
|
|
25
|
+
core.activePlayback.closedCaptionsTracks = [
|
|
26
|
+
{
|
|
27
|
+
id: 1,
|
|
28
|
+
name: 'English',
|
|
29
|
+
track: {
|
|
30
|
+
language: 'en',
|
|
31
|
+
kind: 'subtitles',
|
|
32
|
+
label: 'English',
|
|
33
|
+
mode: 'hidden',
|
|
34
|
+
cues: [],
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 2,
|
|
39
|
+
name: 'Spanish',
|
|
40
|
+
track: {
|
|
41
|
+
language: 'es',
|
|
42
|
+
kind: 'subtitles',
|
|
43
|
+
label: 'Spanish',
|
|
44
|
+
mode: 'hidden',
|
|
45
|
+
cues: [],
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
core.activePlayback.emit('playback:subtitle:available')
|
|
50
|
+
core.activeContainer.emit('container:subtitle:available')
|
|
51
|
+
})
|
|
52
|
+
it('should render', () => {
|
|
53
|
+
expect(cc.el.innerHTML).toMatchSnapshot()
|
|
54
|
+
expect(cc.$el.find('[data-cc-button]').length).toEqual(1)
|
|
55
|
+
expect(mediaControl.putElement).toHaveBeenCalledWith('cc', cc.el)
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
})
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`ClosedCaptions > basically > should render 1`] = `
|
|
4
|
+
"<button data-cc-button="" class="media-control-button media-control-icon gcore-skin-button-color" id="cc-button">
|
|
5
|
+
<span class="cc-text">/assets/icons/new/subtitles-off.svg</span>
|
|
6
|
+
</button>
|
|
7
|
+
|
|
8
|
+
<ul class="gcore-skin-bg-color" id="cc-select">
|
|
9
|
+
|
|
10
|
+
<li>
|
|
11
|
+
<a href="#" class="gcore-skin-text-color" data-cc-select="1">
|
|
12
|
+
English
|
|
13
|
+
</a>
|
|
14
|
+
</li>
|
|
15
|
+
|
|
16
|
+
<li>
|
|
17
|
+
<a href="#" class="gcore-skin-text-color" data-cc-select="2">
|
|
18
|
+
Spanish
|
|
19
|
+
</a>
|
|
20
|
+
</li>
|
|
21
|
+
|
|
22
|
+
<li class="current"><a href="#" class="gcore-skin-text-color gcore-skin-active" data-cc-select="-1">Off</a></li>
|
|
23
|
+
</ul>
|
|
24
|
+
"
|
|
25
|
+
`;
|
package/src/testUtils.ts
CHANGED
|
@@ -126,47 +126,31 @@ export function createMockPlayback(name = 'mock') {
|
|
|
126
126
|
return Object.assign(emitter, {
|
|
127
127
|
name,
|
|
128
128
|
currentLevel: -1,
|
|
129
|
+
dvrEnabled: false,
|
|
129
130
|
levels: [],
|
|
130
131
|
consent() {},
|
|
131
132
|
play() {},
|
|
132
133
|
pause() {},
|
|
133
134
|
stop() {},
|
|
134
|
-
destroy()
|
|
135
|
-
seek()
|
|
136
|
-
seekPercentage()
|
|
137
|
-
getDuration()
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
},
|
|
154
|
-
mute() {},
|
|
155
|
-
unmute() {},
|
|
156
|
-
volume() {},
|
|
157
|
-
configure() {},
|
|
158
|
-
attemptAutoPlay() {
|
|
159
|
-
return true
|
|
160
|
-
},
|
|
161
|
-
canAutoPlay() {
|
|
162
|
-
return true
|
|
163
|
-
},
|
|
164
|
-
onResize() {
|
|
165
|
-
return true
|
|
166
|
-
},
|
|
167
|
-
trigger(event: string, ...args: any[]) {
|
|
168
|
-
emitter.emit(event, ...args)
|
|
169
|
-
},
|
|
135
|
+
destroy: vi.fn(),
|
|
136
|
+
seek: vi.fn(),
|
|
137
|
+
seekPercentage: vi.fn(),
|
|
138
|
+
getDuration: vi.fn().mockImplementation(() => 100),
|
|
139
|
+
enterPiP: vi.fn(),
|
|
140
|
+
exitPiP: vi.fn(),
|
|
141
|
+
getPlaybackType: vi.fn().mockImplementation(() => 'live'),
|
|
142
|
+
getStartTimeOffset: vi.fn().mockImplementation(() => 0),
|
|
143
|
+
getCurrentTime: vi.fn().mockImplementation(() => 0),
|
|
144
|
+
isHighDefinitionInUse: vi.fn().mockImplementation(() => false),
|
|
145
|
+
mute: vi.fn(),
|
|
146
|
+
unmute: vi.fn(),
|
|
147
|
+
volume: vi.fn(),
|
|
148
|
+
configure: vi.fn(),
|
|
149
|
+
attemptAutoPlay: vi.fn().mockImplementation(() => true),
|
|
150
|
+
canAutoPlay: vi.fn().mockImplementation(() => true),
|
|
151
|
+
onResize: vi.fn().mockImplementation(() => true),
|
|
152
|
+
setPlaybackRate: vi.fn(),
|
|
153
|
+
trigger: emitter.emit,
|
|
170
154
|
})
|
|
171
155
|
}
|
|
172
156
|
|
|
@@ -179,6 +163,8 @@ export function createMockContainer(playback: any = createMockPlayback()) {
|
|
|
179
163
|
$el: $(el),
|
|
180
164
|
getDuration: vi.fn().mockReturnValue(0),
|
|
181
165
|
getPlugin: vi.fn(),
|
|
166
|
+
getPlaybackType: vi.fn().mockReturnValue('live'),
|
|
167
|
+
isDvrInUse: vi.fn().mockReturnValue(false),
|
|
182
168
|
isPlaying: vi.fn().mockReturnValue(false),
|
|
183
169
|
play: vi.fn(),
|
|
184
170
|
seek: vi.fn(),
|