@gcorevideo/player 2.21.3 → 2.21.6
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/dvr-controls/dvr_controls.scss +7 -25
- package/assets/dvr-controls/index.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 +14 -7
- package/assets/media-control/width270.scss +1 -1
- package/assets/media-control/width370.scss +5 -5
- package/assets/playback-rate/button.ejs +2 -2
- package/assets/playback-rate/list.ejs +4 -4
- package/assets/style/theme.scss +1 -1
- 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 +993 -993
- package/dist/index.js +199 -178
- package/dist/player.d.ts +141 -119
- package/dist/plugins/index.css +1118 -1118
- package/dist/plugins/index.js +191 -173
- 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/dvr-controls/DvrControls.d.ts +0 -3
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.js +13 -38
- package/lib/plugins/media-control/MediaControl.d.ts +14 -18
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +105 -72
- 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 +26 -19
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +30 -45
- 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/dvr-controls/DvrControls.ts +16 -44
- package/src/plugins/dvr-controls/__tests__/DvrControls.test.ts +18 -22
- package/src/plugins/dvr-controls/__tests__/__snapshots__/DvrControls.test.ts.snap +6 -30
- package/src/plugins/media-control/MediaControl.ts +130 -85
- package/src/plugins/media-control/__tests__/MediaControl.test.ts +132 -0
- package/src/plugins/media-control/__tests__/__snapshots__/MediaControl.test.ts.snap +299 -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 +30 -45
- package/temp/player.api.json +269 -89
- package/tsconfig.tsbuildinfo +1 -1
- package/src/plugins/index.ts +0 -39
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
|
2
|
+
import { MediaControl, MediaControlElement } from '../MediaControl'
|
|
3
|
+
import { createMockCore } from '../../../testUtils'
|
|
4
|
+
import { LogTracer, Logger, setTracer } from '@gcorevideo/utils'
|
|
5
|
+
import { Events, Playback } from '@clappr/core'
|
|
6
|
+
|
|
7
|
+
Logger.enable('*')
|
|
8
|
+
setTracer(new LogTracer('MediaControl.test'))
|
|
9
|
+
|
|
10
|
+
describe('MediaControl', () => {
|
|
11
|
+
let core: any
|
|
12
|
+
let mediaControl: MediaControl
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
core = createMockCore()
|
|
16
|
+
})
|
|
17
|
+
describe('playback type', () => {
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
mediaControl = new MediaControl(core)
|
|
20
|
+
core.emit('core:ready')
|
|
21
|
+
core.emit(Events.CORE_ACTIVE_CONTAINER_CHANGED, core.activeContainer)
|
|
22
|
+
})
|
|
23
|
+
describe('when live', () => {
|
|
24
|
+
beforeEach(() => {
|
|
25
|
+
core.activeContainer.getPlaybackType.mockReturnValue(Playback.LIVE)
|
|
26
|
+
core.activeContainer.emit(Events.CONTAINER_LOADEDMETADATA)
|
|
27
|
+
})
|
|
28
|
+
it('should apply live style class', () => {
|
|
29
|
+
expect(mediaControl.$el.hasClass('live')).toBe(true)
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
describe('when vod', () => {
|
|
33
|
+
beforeEach(() => {
|
|
34
|
+
core.activeContainer.getPlaybackType.mockReturnValue(Playback.VOD)
|
|
35
|
+
core.activeContainer.emit(Events.CONTAINER_LOADEDMETADATA)
|
|
36
|
+
})
|
|
37
|
+
it('should not apply live style class', () => {
|
|
38
|
+
expect(mediaControl.$el.hasClass('live')).toBe(false)
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
describe('putElement', () => {
|
|
43
|
+
beforeEach(() => {
|
|
44
|
+
mediaControl = new MediaControl(core)
|
|
45
|
+
core.emit('core:ready')
|
|
46
|
+
core.activeContainer.settings = {}
|
|
47
|
+
core.emit('core:active:container:changed', core.activeContainer)
|
|
48
|
+
})
|
|
49
|
+
describe.each([
|
|
50
|
+
['pip' as MediaControlElement],
|
|
51
|
+
['gear' as MediaControlElement],
|
|
52
|
+
['cc' as MediaControlElement],
|
|
53
|
+
// ['multicamera' as MediaControlElement],
|
|
54
|
+
// ['playbackrate' as MediaControlElement],
|
|
55
|
+
// ['vr' as MediaControlElement],
|
|
56
|
+
// ['audiotracks' as MediaControlElement],
|
|
57
|
+
// dvr controls
|
|
58
|
+
])('%s', (mcName) => {
|
|
59
|
+
it('should put the element in the right panel', () => {
|
|
60
|
+
const element = document.createElement('div')
|
|
61
|
+
element.className = 'my-media-control'
|
|
62
|
+
element.textContent = 'test'
|
|
63
|
+
mediaControl.putElement(mcName, element)
|
|
64
|
+
|
|
65
|
+
expect(mediaControl.el.innerHTML).toMatchSnapshot()
|
|
66
|
+
expect(mediaControl.$el.find('.media-control-right-panel .my-media-control').length).toEqual(1)
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
describe('updateSettings', () => {
|
|
71
|
+
beforeEach(() => {
|
|
72
|
+
mediaControl = new MediaControl(core)
|
|
73
|
+
core.emit('core:ready')
|
|
74
|
+
})
|
|
75
|
+
describe('dvr', () => {
|
|
76
|
+
beforeEach(() => {
|
|
77
|
+
core.activeContainer.settings = {
|
|
78
|
+
left: ['playpause', 'position', 'duration'],
|
|
79
|
+
seekEnabled: true,
|
|
80
|
+
}
|
|
81
|
+
core.emit(Events.CORE_ACTIVE_CONTAINER_CHANGED, core.activeContainer)
|
|
82
|
+
})
|
|
83
|
+
describe('when enabled', () => {
|
|
84
|
+
beforeEach(() => {
|
|
85
|
+
core.activePlayback.dvrEnabled = true
|
|
86
|
+
core.activeContainer.isDvrEnabled.mockReturnValue(true)
|
|
87
|
+
core.activeContainer.emit(Events.CONTAINER_SETTINGSUPDATE, true)
|
|
88
|
+
})
|
|
89
|
+
it('should enable DVR controls', () => {
|
|
90
|
+
const element = document.createElement('div')
|
|
91
|
+
element.className = 'my-dvr-controls'
|
|
92
|
+
element.textContent = 'live'
|
|
93
|
+
mediaControl.putElement('dvr', element)
|
|
94
|
+
expect(mediaControl.el.innerHTML).toMatchSnapshot()
|
|
95
|
+
expect(mediaControl.$el.find('.media-control-left-panel .my-dvr-controls').length).toEqual(1)
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
describe('when disabled', () => {
|
|
99
|
+
it('should disable DVR controls', () => {
|
|
100
|
+
const element = document.createElement('div')
|
|
101
|
+
element.className = 'my-dvr-controls'
|
|
102
|
+
element.textContent = 'live'
|
|
103
|
+
mediaControl.putElement('dvr', element)
|
|
104
|
+
expect(mediaControl.el.innerHTML).toMatchSnapshot()
|
|
105
|
+
expect(mediaControl.$el.find('.media-control-left-panel .my-dvr-controls').length).toEqual(0)
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
describe('dvr mode', () => {
|
|
111
|
+
beforeEach(() => {
|
|
112
|
+
mediaControl = new MediaControl(core)
|
|
113
|
+
core.emit(Events.CORE_READY)
|
|
114
|
+
core.emit(Events.CORE_ACTIVE_CONTAINER_CHANGED, core.activeContainer)
|
|
115
|
+
})
|
|
116
|
+
describe('by default', () => {
|
|
117
|
+
it('should not apply DVR style class', () => {
|
|
118
|
+
expect(mediaControl.$el.hasClass('dvr')).toBe(false)
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
describe('when in use', () => {
|
|
122
|
+
beforeEach(() => {
|
|
123
|
+
core.activeContainer.isDvrInUse.mockReturnValue(true)
|
|
124
|
+
core.activePlayback.dvrInUse = true
|
|
125
|
+
core.activeContainer.emit(Events.CONTAINER_PLAYBACKDVRSTATECHANGED, true)
|
|
126
|
+
})
|
|
127
|
+
it('should apply DVR style class', () => {
|
|
128
|
+
expect(mediaControl.$el.hasClass('dvr')).toBe(true)
|
|
129
|
+
})
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
})
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`MediaControl > putElement > cc > should put the element in the right panel 1`] = `
|
|
4
|
+
"<div class="media-control-background" data-background=""></div>
|
|
5
|
+
|
|
6
|
+
<div class="media-control-layer gcore-skin-bg-color" data-controls="">
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
<div class="media-control-left-panel" data-media-control="">
|
|
21
|
+
|
|
22
|
+
<div class="drawer-container" data-volume="">
|
|
23
|
+
<div class="drawer-icon-container" data-volume="">
|
|
24
|
+
<div class="drawer-icon media-control-icon gcore-skin-button-color" data-volume="">/assets/icons/new/volume-max.svg</div>
|
|
25
|
+
<span class="drawer-text" data-volume=""></span>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="bar-container" data-volume="">
|
|
29
|
+
<div class="bar-background" data-volume="">
|
|
30
|
+
<div class="bar-fill-1 gcore-skin-main-color" data-volume="" style=""></div>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="bar-scrubber" data-volume="" style="">
|
|
33
|
+
<div class="bar-scrubber-icon gcore-skin-main-color" data-volume=""></div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<div class="media-clip-container gcore-skin-text-color" data-clipstext="">
|
|
41
|
+
<div class="media-clip-point gcore-skin-text-color" data-clipstext="">•</div>
|
|
42
|
+
<div class="media-clip-text gcore-skin-text-color" data-clipstext=""></div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div class="media-control-right-panel" data-media-control="">
|
|
50
|
+
|
|
51
|
+
<div class="media-control-multicamera" data-multicamera=""></div>
|
|
52
|
+
|
|
53
|
+
<div class="media-control-vr" data-vr=""></div>
|
|
54
|
+
|
|
55
|
+
<div class="my-media-control" data-cc="">test</div></div>
|
|
56
|
+
|
|
57
|
+
</div>
|
|
58
|
+
<style>:root {}</style>"
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
exports[`MediaControl > putElement > gear > should put the element in the right panel 1`] = `
|
|
62
|
+
"<div class="media-control-background" data-background=""></div>
|
|
63
|
+
|
|
64
|
+
<div class="media-control-layer gcore-skin-bg-color" data-controls="">
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
<div class="media-control-left-panel" data-media-control="">
|
|
79
|
+
|
|
80
|
+
<div class="drawer-container" data-volume="">
|
|
81
|
+
<div class="drawer-icon-container" data-volume="">
|
|
82
|
+
<div class="drawer-icon media-control-icon gcore-skin-button-color" data-volume="">/assets/icons/new/volume-max.svg</div>
|
|
83
|
+
<span class="drawer-text" data-volume=""></span>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<div class="bar-container" data-volume="">
|
|
87
|
+
<div class="bar-background" data-volume="">
|
|
88
|
+
<div class="bar-fill-1 gcore-skin-main-color" data-volume="" style=""></div>
|
|
89
|
+
</div>
|
|
90
|
+
<div class="bar-scrubber" data-volume="" style="">
|
|
91
|
+
<div class="bar-scrubber-icon gcore-skin-main-color" data-volume=""></div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
<div class="media-clip-container gcore-skin-text-color" data-clipstext="">
|
|
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>
|
|
102
|
+
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
<div class="media-control-right-panel" data-media-control="">
|
|
108
|
+
|
|
109
|
+
<div class="media-control-multicamera" data-multicamera=""></div>
|
|
110
|
+
|
|
111
|
+
<div class="media-control-vr" data-vr=""></div>
|
|
112
|
+
|
|
113
|
+
<div class="my-media-control" data-gear="">test</div></div>
|
|
114
|
+
|
|
115
|
+
</div>
|
|
116
|
+
<style>:root {}</style>"
|
|
117
|
+
`;
|
|
118
|
+
|
|
119
|
+
exports[`MediaControl > putElement > pip > should put the element in the right panel 1`] = `
|
|
120
|
+
"<div class="media-control-background" data-background=""></div>
|
|
121
|
+
|
|
122
|
+
<div class="media-control-layer gcore-skin-bg-color" data-controls="">
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
<div class="media-control-left-panel" data-media-control="">
|
|
137
|
+
|
|
138
|
+
<div class="drawer-container" data-volume="">
|
|
139
|
+
<div class="drawer-icon-container" data-volume="">
|
|
140
|
+
<div class="drawer-icon media-control-icon gcore-skin-button-color" data-volume="">/assets/icons/new/volume-max.svg</div>
|
|
141
|
+
<span class="drawer-text" data-volume=""></span>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<div class="bar-container" data-volume="">
|
|
145
|
+
<div class="bar-background" data-volume="">
|
|
146
|
+
<div class="bar-fill-1 gcore-skin-main-color" data-volume="" style=""></div>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="bar-scrubber" data-volume="" style="">
|
|
149
|
+
<div class="bar-scrubber-icon gcore-skin-main-color" data-volume=""></div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
<div class="media-clip-container gcore-skin-text-color" data-clipstext="">
|
|
157
|
+
<div class="media-clip-point gcore-skin-text-color" data-clipstext="">•</div>
|
|
158
|
+
<div class="media-clip-text gcore-skin-text-color" data-clipstext=""></div>
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
<div class="media-control-right-panel" data-media-control="">
|
|
166
|
+
|
|
167
|
+
<div class="media-control-multicamera" data-multicamera=""></div>
|
|
168
|
+
|
|
169
|
+
<div class="media-control-vr" data-vr=""></div>
|
|
170
|
+
|
|
171
|
+
<div class="my-media-control" data-pip="">test</div></div>
|
|
172
|
+
|
|
173
|
+
</div>
|
|
174
|
+
<style>:root {}</style>"
|
|
175
|
+
`;
|
|
176
|
+
|
|
177
|
+
exports[`MediaControl > updateSettings > dvr > when disabled > should disable DVR controls 1`] = `
|
|
178
|
+
"<div class="media-control-background" data-background=""></div>
|
|
179
|
+
|
|
180
|
+
<div class="media-control-layer gcore-skin-bg-color" data-controls="">
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
<div class="media-control-left-panel" data-media-control="">
|
|
195
|
+
|
|
196
|
+
<div class="drawer-container" data-volume="">
|
|
197
|
+
<div class="drawer-icon-container" data-volume="">
|
|
198
|
+
<div class="drawer-icon media-control-icon gcore-skin-button-color" data-volume="">/assets/icons/new/volume-max.svg</div>
|
|
199
|
+
<span class="drawer-text" data-volume=""></span>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<div class="bar-container" data-volume="">
|
|
203
|
+
<div class="bar-background" data-volume="">
|
|
204
|
+
<div class="bar-fill-1 gcore-skin-main-color" data-volume="" style=""></div>
|
|
205
|
+
</div>
|
|
206
|
+
<div class="bar-scrubber" data-volume="" style="">
|
|
207
|
+
<div class="bar-scrubber-icon gcore-skin-main-color" data-volume=""></div>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
</div>
|
|
212
|
+
|
|
213
|
+
<div class="media-control-indicator gcore-skin-text-color" data-position="">00:00</div>
|
|
214
|
+
|
|
215
|
+
<div class="media-control-indicator gcore-skin-text-color" data-duration="">00:00</div>
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
<div class="media-clip-container gcore-skin-text-color" data-clipstext="">
|
|
219
|
+
<div class="media-clip-point gcore-skin-text-color" data-clipstext="">•</div>
|
|
220
|
+
<div class="media-clip-text gcore-skin-text-color" data-clipstext=""></div>
|
|
221
|
+
</div>
|
|
222
|
+
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
<div class="media-control-right-panel" data-media-control="">
|
|
228
|
+
|
|
229
|
+
<div class="media-control-multicamera" data-multicamera=""></div>
|
|
230
|
+
|
|
231
|
+
<div class="media-control-vr" data-vr=""></div>
|
|
232
|
+
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
</div>
|
|
236
|
+
<style>:root {}</style>"
|
|
237
|
+
`;
|
|
238
|
+
|
|
239
|
+
exports[`MediaControl > updateSettings > dvr > when enabled > should enable DVR controls 1`] = `
|
|
240
|
+
"<div class="media-control-background" data-background=""></div>
|
|
241
|
+
|
|
242
|
+
<div class="media-control-layer gcore-skin-bg-color" data-controls="">
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
<div class="media-control-left-panel" data-media-control="">
|
|
257
|
+
|
|
258
|
+
<div class="drawer-container" data-volume="">
|
|
259
|
+
<div class="drawer-icon-container" data-volume="">
|
|
260
|
+
<div class="drawer-icon media-control-icon gcore-skin-button-color" data-volume="">/assets/icons/new/volume-max.svg</div>
|
|
261
|
+
<span class="drawer-text" data-volume=""></span>
|
|
262
|
+
</div>
|
|
263
|
+
|
|
264
|
+
<div class="bar-container" data-volume="">
|
|
265
|
+
<div class="bar-background" data-volume="">
|
|
266
|
+
<div class="bar-fill-1 gcore-skin-main-color" data-volume="" style=""></div>
|
|
267
|
+
</div>
|
|
268
|
+
<div class="bar-scrubber" data-volume="" style="">
|
|
269
|
+
<div class="bar-scrubber-icon gcore-skin-main-color" data-volume=""></div>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
|
|
273
|
+
</div>
|
|
274
|
+
|
|
275
|
+
<div class="media-control-indicator gcore-skin-text-color" data-position="">00:00</div>
|
|
276
|
+
|
|
277
|
+
<div class="media-control-indicator gcore-skin-text-color" data-duration="">00:00</div>
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
<div class="media-clip-container gcore-skin-text-color" data-clipstext="">
|
|
281
|
+
<div class="media-clip-point gcore-skin-text-color" data-clipstext="">•</div>
|
|
282
|
+
<div class="media-clip-text gcore-skin-text-color" data-clipstext=""></div>
|
|
283
|
+
</div>
|
|
284
|
+
|
|
285
|
+
<div class="my-dvr-controls" data-dvr="">live</div></div>
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
<div class="media-control-right-panel" data-media-control="">
|
|
290
|
+
|
|
291
|
+
<div class="media-control-multicamera" data-multicamera=""></div>
|
|
292
|
+
|
|
293
|
+
<div class="media-control-vr" data-vr=""></div>
|
|
294
|
+
|
|
295
|
+
</div>
|
|
296
|
+
|
|
297
|
+
</div>
|
|
298
|
+
<style>:root {}</style>"
|
|
299
|
+
`;
|
|
@@ -43,6 +43,8 @@ export class PictureInPicture extends UICorePlugin {
|
|
|
43
43
|
return VERSION;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
private static buttonTemplate = template(buttonHtml);
|
|
47
|
+
|
|
46
48
|
/**
|
|
47
49
|
* @internal
|
|
48
50
|
*/
|
|
@@ -71,8 +73,8 @@ export class PictureInPicture extends UICorePlugin {
|
|
|
71
73
|
|
|
72
74
|
private isPiPSupported() {
|
|
73
75
|
trace(`${T} isPiPSupported`, {
|
|
74
|
-
pictureInPictureEnabled: document.pictureInPictureEnabled,
|
|
75
|
-
requestPictureInPicture: HTMLVideoElement.prototype.requestPictureInPicture,
|
|
76
|
+
pictureInPictureEnabled: !!document.pictureInPictureEnabled,
|
|
77
|
+
requestPictureInPicture: !!HTMLVideoElement.prototype.requestPictureInPicture,
|
|
76
78
|
});
|
|
77
79
|
|
|
78
80
|
return document.pictureInPictureEnabled && !!HTMLVideoElement.prototype.requestPictureInPicture;
|
|
@@ -86,9 +88,7 @@ export class PictureInPicture extends UICorePlugin {
|
|
|
86
88
|
return this;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this.$el.html(t({ pipIcon }));
|
|
91
|
+
this.$el.html(PictureInPicture.buttonTemplate({ pipIcon }));
|
|
92
92
|
|
|
93
93
|
const mediaControl = this.core.getPlugin('media_control');
|
|
94
94
|
if (mediaControl) {
|