@gcorevideo/player 2.19.11 → 2.19.13
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/dist/core.js +16 -11
- package/dist/index.css +684 -684
- package/dist/index.js +301 -151
- package/dist/player.d.ts +208 -45
- package/dist/plugins/index.css +941 -941
- package/dist/plugins/index.js +3227 -3080
- package/docs/api/player.bottomgear.md +3 -289
- package/docs/api/player.dvrcontrols._constructor_.md +3 -0
- package/docs/api/player.dvrcontrols.md +10 -201
- package/docs/api/player.levelselector.md +8 -140
- package/docs/api/player.md +8 -4
- package/docs/api/player.mediacontrol.disable.md +2 -0
- package/docs/api/player.mediacontrol.disabledcontrolbutton.md +1 -1
- package/docs/api/player.mediacontrol.enable.md +2 -0
- package/docs/api/player.mediacontrol.enablecontrolbutton.md +1 -1
- package/docs/api/player.mediacontrol.getelement.md +19 -1
- package/docs/api/player.mediacontrol.md +17 -281
- package/docs/api/player.mediacontrol.volume.md +2 -2
- package/docs/api/player.mediacontrolelement.md +2 -1
- package/docs/api/player.poster.disable.md +5 -0
- package/docs/api/player.poster.enable.md +5 -0
- package/docs/api/player.poster.md +25 -183
- package/lib/Player.d.ts +1 -0
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +15 -10
- package/lib/plugins/audio-selector/AudioSelector.js +2 -2
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
- package/lib/plugins/big-mute-button/BigMuteButton.js +2 -1
- package/lib/plugins/bottom-gear/BottomGear.d.ts +28 -7
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +44 -31
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts.map +1 -1
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +3 -2
- package/lib/plugins/clappr-stats/ClapprStats.js +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.js +1 -1
- package/lib/plugins/clips/Clips.js +2 -2
- package/lib/plugins/context-menu/ContextMenu.js +1 -1
- package/lib/plugins/disable-controls/DisableControls.js +1 -1
- package/lib/plugins/dvr-controls/DvrControls.d.ts +30 -4
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.js +39 -11
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
- package/lib/plugins/error-screen/ErrorScreen.js +2 -1
- package/lib/plugins/favicon/Favicon.js +1 -1
- package/lib/plugins/google-analytics/GoogleAnalytics.js +1 -1
- package/lib/plugins/level-selector/LevelSelector.d.ts +25 -6
- package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
- package/lib/plugins/level-selector/LevelSelector.js +33 -12
- package/lib/plugins/logo/Logo.js +1 -1
- package/lib/plugins/media-control/MediaControl.d.ts +66 -22
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +71 -34
- package/lib/plugins/multi-camera/MultiCamera.js +3 -3
- package/lib/plugins/picture-in-picture/PictureInPicture.js +3 -3
- package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
- package/lib/plugins/playback-rate/PlaybackRate.js +3 -3
- package/lib/plugins/poster/Poster.d.ts +57 -3
- package/lib/plugins/poster/Poster.d.ts.map +1 -1
- package/lib/plugins/poster/Poster.js +57 -9
- package/lib/plugins/seek-time/SeekTime.js +2 -2
- package/lib/plugins/share/Share.js +2 -2
- package/lib/plugins/skip-time/SkipTime.js +1 -1
- package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
- package/lib/plugins/source-controller/SourceController.js +1 -2
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +1 -1
- package/lib/plugins/statistics/Statistics.js +1 -1
- package/lib/plugins/subtitles/Subtitles.js +3 -3
- package/lib/plugins/thumbnails/Thumbnails.js +3 -3
- package/lib/plugins/types.d.ts +1 -7
- package/lib/plugins/types.d.ts.map +1 -1
- package/lib/plugins/vast-ads/VastAds.d.ts +1 -0
- package/lib/plugins/vast-ads/VastAds.d.ts.map +1 -1
- package/lib/plugins/vast-ads/VastAds.js +6 -3
- package/package.json +2 -1
- package/src/Player.ts +15 -9
- package/src/__tests__/Player.test.ts +15 -76
- package/src/plugins/audio-selector/AudioSelector.ts +2 -2
- package/src/plugins/big-mute-button/BigMuteButton.ts +2 -1
- package/src/plugins/bottom-gear/BottomGear.ts +50 -39
- package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +3 -2
- package/src/plugins/clappr-stats/ClapprStats.ts +1 -1
- package/src/plugins/click-to-pause/ClickToPause.ts +1 -1
- package/src/plugins/clips/Clips.ts +2 -2
- package/src/plugins/context-menu/ContextMenu.ts +1 -1
- package/src/plugins/disable-controls/DisableControls.ts +1 -1
- package/src/plugins/dvr-controls/DvrControls.ts +42 -14
- package/src/plugins/error-screen/ErrorScreen.ts +2 -1
- package/src/plugins/favicon/Favicon.ts +1 -1
- package/src/plugins/google-analytics/GoogleAnalytics.ts +1 -1
- package/src/plugins/level-selector/LevelSelector.ts +34 -14
- package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +22 -2
- package/src/plugins/logo/Logo.ts +1 -1
- package/src/plugins/media-control/MediaControl.ts +82 -44
- package/src/plugins/multi-camera/MultiCamera.ts +3 -3
- package/src/plugins/picture-in-picture/PictureInPicture.ts +3 -3
- package/src/plugins/playback-rate/PlaybackRate.ts +3 -4
- package/src/plugins/poster/Poster.ts +59 -12
- package/src/plugins/seek-time/SeekTime.ts +2 -2
- package/src/plugins/share/Share.ts +2 -2
- package/src/plugins/skip-time/SkipTime.ts +1 -1
- package/src/plugins/source-controller/SourceController.ts +1 -2
- package/src/plugins/source-controller/__tests__/SourceController.test.ts +5 -0
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +1 -1
- package/src/plugins/statistics/Statistics.ts +1 -1
- package/src/plugins/subtitles/Subtitles.ts +3 -3
- package/src/plugins/thumbnails/Thumbnails.ts +3 -3
- package/src/plugins/types.ts +1 -0
- package/src/plugins/vast-ads/VastAds.ts +6 -6
- package/temp/player.api.json +3300 -5029
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.bottomgear.attributes.md +0 -17
- package/docs/api/player.bottomgear.bindevents.md +0 -18
- package/docs/api/player.bottomgear.container.md +0 -14
- package/docs/api/player.bottomgear.events.md +0 -16
- package/docs/api/player.bottomgear.hide.md +0 -18
- package/docs/api/player.bottomgear.name.md +0 -14
- package/docs/api/player.bottomgear.refresh.md +0 -18
- package/docs/api/player.bottomgear.reload.md +0 -18
- package/docs/api/player.bottomgear.render.md +0 -18
- package/docs/api/player.bottomgear.supportedversion.md +0 -16
- package/docs/api/player.bottomgear.template.md +0 -14
- package/docs/api/player.bottomgear.togglegearmenu.md +0 -18
- package/docs/api/player.bottomgear.unbindevents.md +0 -18
- package/docs/api/player.bottomgear.version.md +0 -14
- package/docs/api/player.dvrcontrols.attributes.md +0 -14
- package/docs/api/player.dvrcontrols.bindevents.md +0 -15
- package/docs/api/player.dvrcontrols.click.md +0 -15
- package/docs/api/player.dvrcontrols.events.md +0 -13
- package/docs/api/player.dvrcontrols.name.md +0 -11
- package/docs/api/player.dvrcontrols.render.md +0 -15
- package/docs/api/player.dvrcontrols.settingsupdate.md +0 -15
- package/docs/api/player.dvrcontrols.shouldrender.md +0 -15
- package/docs/api/player.dvrcontrols.supportedversion.md +0 -13
- package/docs/api/player.dvrcontrols.template.md +0 -11
- package/docs/api/player.levelselector.attributes.md +0 -17
- package/docs/api/player.levelselector.bindevents.md +0 -18
- package/docs/api/player.levelselector.name.md +0 -14
- package/docs/api/player.levelselector.render.md +0 -18
- package/docs/api/player.levelselector.supportedversion.md +0 -16
- package/docs/api/player.levelselector.version.md +0 -14
- package/docs/api/player.mediacontrol.attributes.md +0 -17
- package/docs/api/player.mediacontrol.bindcontainerevents.md +0 -18
- package/docs/api/player.mediacontrol.bindevents.md +0 -18
- package/docs/api/player.mediacontrol.container.md +0 -14
- package/docs/api/player.mediacontrol.destroy.md +0 -18
- package/docs/api/player.mediacontrol.disabled.md +0 -14
- package/docs/api/player.mediacontrol.events.md +0 -40
- package/docs/api/player.mediacontrol.getexternalinterface.md +0 -21
- package/docs/api/player.mediacontrol.name.md +0 -14
- package/docs/api/player.mediacontrol.pause.md +0 -20
- package/docs/api/player.mediacontrol.play.md +0 -20
- package/docs/api/player.mediacontrol.playback.md +0 -14
- package/docs/api/player.mediacontrol.render.md +0 -18
- package/docs/api/player.mediacontrol.setmuted.md +0 -52
- package/docs/api/player.mediacontrol.stop.md +0 -20
- package/docs/api/player.mediacontrol.supportedversion.md +0 -16
- package/docs/api/player.poster.attributes.md +0 -14
- package/docs/api/player.poster.bindevents.md +0 -15
- package/docs/api/player.poster.destroy.md +0 -15
- package/docs/api/player.poster.events.md +0 -13
- package/docs/api/player.poster.name.md +0 -11
- package/docs/api/player.poster.render.md +0 -15
- package/docs/api/player.poster.shouldrender.md +0 -11
- package/docs/api/player.poster.showonvideoend.md +0 -11
- package/docs/api/player.poster.supportedversion.md +0 -13
- package/docs/api/player.poster.template.md +0 -11
- package/src/plugins/build.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UICorePlugin, template, Events } from '@clappr/core';
|
|
2
2
|
import { trace } from '@gcorevideo/utils';
|
|
3
3
|
|
|
4
|
-
import { CLAPPR_VERSION } from '
|
|
4
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
5
5
|
|
|
6
6
|
import pipIcon from '../../../assets/icons/new/pip.svg';
|
|
7
7
|
import buttonHtml from '../../../assets/picture-in-picture/button.ejs';
|
|
@@ -9,11 +9,11 @@ import '../../../assets/picture-in-picture/button.scss';
|
|
|
9
9
|
|
|
10
10
|
const VERSION = '0.0.1';
|
|
11
11
|
|
|
12
|
-
const T = `plugins.
|
|
12
|
+
const T = `plugins.media_control_pip`;
|
|
13
13
|
|
|
14
14
|
export class PictureInPicture extends UICorePlugin {
|
|
15
15
|
get name() {
|
|
16
|
-
return '
|
|
16
|
+
return 'media_control_pip';
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
get supportedVersion() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Events, UICorePlugin, Playback, template } from '@clappr/core';
|
|
2
2
|
|
|
3
|
-
import { CLAPPR_VERSION } from '
|
|
3
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
4
4
|
import type { ZeptoResult } from '../../utils/types.js';
|
|
5
5
|
|
|
6
6
|
import pluginHtml from '../../../assets/playback-rate/playback-rate-selector.ejs';
|
|
@@ -28,6 +28,7 @@ const DEFAULT_PLAYBACK_RATES = [
|
|
|
28
28
|
|
|
29
29
|
const DEFAULT_PLAYBACK_RATE = '1.0';
|
|
30
30
|
|
|
31
|
+
// TODO
|
|
31
32
|
const MEDIACONTROL_PLAYBACKRATE = 'playbackRate';
|
|
32
33
|
|
|
33
34
|
export class PlaybackRate extends UICorePlugin {
|
|
@@ -40,7 +41,7 @@ export class PlaybackRate extends UICorePlugin {
|
|
|
40
41
|
private selectedRate: string = DEFAULT_PLAYBACK_RATE;
|
|
41
42
|
|
|
42
43
|
get name() {
|
|
43
|
-
return '
|
|
44
|
+
return 'media_control_playback_rate';
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
get supportedVersion() {
|
|
@@ -265,5 +266,3 @@ export class PlaybackRate extends UICorePlugin {
|
|
|
265
266
|
currentLevelElement.find('a').addClass('gcore-skin-active');
|
|
266
267
|
}
|
|
267
268
|
}
|
|
268
|
-
|
|
269
|
-
// PlaybackRate.MEDIACONTROL_PLAYBACKRATE = 'playbackRate';
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from '@clappr/core'
|
|
14
14
|
import { trace } from '@gcorevideo/utils'
|
|
15
15
|
|
|
16
|
-
import { CLAPPR_VERSION } from '
|
|
16
|
+
import { CLAPPR_VERSION } from '../../build.js'
|
|
17
17
|
import type { ZeptoResult } from '../../utils/types.js'
|
|
18
18
|
|
|
19
19
|
import '../../../assets/poster/poster.scss'
|
|
@@ -23,6 +23,33 @@ import { PlaybackError } from '../../playback.types.js'
|
|
|
23
23
|
|
|
24
24
|
const T = 'plugins.poster_custom'
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Displays a poster image in the background and a big play button on top when playback is stopped
|
|
28
|
+
* @beta
|
|
29
|
+
* @remarks
|
|
30
|
+
* When the playback is stopped, media control UI is disabled.
|
|
31
|
+
*
|
|
32
|
+
* Configuration options:
|
|
33
|
+
*
|
|
34
|
+
* - `poster.custom` - custom CSS background
|
|
35
|
+
*
|
|
36
|
+
* - `poster.showForNoOp` - whether to show the poster when the playback is not started
|
|
37
|
+
*
|
|
38
|
+
* - `poster.url` - the URL of the poster image
|
|
39
|
+
*
|
|
40
|
+
* - `poster.showOnVideoEnd` - whether to show the poster when the playback is ended
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* new Player({
|
|
45
|
+
* ...
|
|
46
|
+
* poster: {
|
|
47
|
+
* showForNoOp: true,
|
|
48
|
+
* url: 'https://via.placeholder.com/150.png',
|
|
49
|
+
* }
|
|
50
|
+
* })
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
26
53
|
export class Poster extends UIContainerPlugin {
|
|
27
54
|
private hasFatalError = false
|
|
28
55
|
|
|
@@ -34,27 +61,26 @@ export class Poster extends UIContainerPlugin {
|
|
|
34
61
|
|
|
35
62
|
private $playWrapper: ZeptoResult | null = null
|
|
36
63
|
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
37
67
|
get name() {
|
|
38
68
|
return 'poster_custom'
|
|
39
69
|
}
|
|
40
70
|
|
|
71
|
+
/**
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
41
74
|
get supportedVersion() {
|
|
42
75
|
return { min: CLAPPR_VERSION }
|
|
43
76
|
}
|
|
44
77
|
|
|
45
|
-
|
|
46
|
-
return template(posterHTML)
|
|
47
|
-
}
|
|
78
|
+
private static readonly template = template(posterHTML)
|
|
48
79
|
|
|
49
|
-
get shouldRender() {
|
|
80
|
+
private get shouldRender() {
|
|
50
81
|
if (!this.enabled) {
|
|
51
82
|
return false
|
|
52
83
|
}
|
|
53
|
-
// const showOnError = this.options.poster?.showOnError !== false
|
|
54
|
-
trace(`${T} shouldRender`, {
|
|
55
|
-
hasFatalError: this.hasFatalError,
|
|
56
|
-
})
|
|
57
|
-
|
|
58
84
|
const showForNoOp = !!this.options.poster?.showForNoOp
|
|
59
85
|
return (
|
|
60
86
|
this.container.playback.name !== 'html_img' &&
|
|
@@ -63,6 +89,9 @@ export class Poster extends UIContainerPlugin {
|
|
|
63
89
|
)
|
|
64
90
|
}
|
|
65
91
|
|
|
92
|
+
/**
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
66
95
|
override get attributes() {
|
|
67
96
|
return {
|
|
68
97
|
class: 'player-poster',
|
|
@@ -70,16 +99,22 @@ export class Poster extends UIContainerPlugin {
|
|
|
70
99
|
}
|
|
71
100
|
}
|
|
72
101
|
|
|
102
|
+
/**
|
|
103
|
+
* @internal
|
|
104
|
+
*/
|
|
73
105
|
override get events() {
|
|
74
106
|
return {
|
|
75
107
|
click: 'clicked',
|
|
76
108
|
}
|
|
77
109
|
}
|
|
78
110
|
|
|
79
|
-
get showOnVideoEnd() {
|
|
111
|
+
private get showOnVideoEnd() {
|
|
80
112
|
return this.options.poster?.showOnVideoEnd !== false
|
|
81
113
|
}
|
|
82
114
|
|
|
115
|
+
/**
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
83
118
|
override bindEvents() {
|
|
84
119
|
this.listenTo(this.container, Events.CONTAINER_STOP, this.onStop)
|
|
85
120
|
this.listenTo(this.container, Events.CONTAINER_PLAY, this.onPlay)
|
|
@@ -97,12 +132,18 @@ export class Poster extends UIContainerPlugin {
|
|
|
97
132
|
this.listenTo(this.container, Events.PLAYBACK_PLAY_INTENT, this.onPlayIntent)
|
|
98
133
|
}
|
|
99
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Reenables earlier disabled plugin
|
|
137
|
+
*/
|
|
100
138
|
override enable() {
|
|
101
139
|
super.enable()
|
|
102
140
|
this.hasStartedPlaying = this.container.playback.isPlaying()
|
|
103
141
|
this.update()
|
|
104
142
|
}
|
|
105
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Disables the plugin, unmounting it from the DOM
|
|
146
|
+
*/
|
|
106
147
|
override disable() {
|
|
107
148
|
trace(`${T} disable`)
|
|
108
149
|
this.hasStartedPlaying = false
|
|
@@ -252,12 +293,15 @@ export class Poster extends UIContainerPlugin {
|
|
|
252
293
|
}
|
|
253
294
|
}
|
|
254
295
|
|
|
296
|
+
/**
|
|
297
|
+
* @internal
|
|
298
|
+
*/
|
|
255
299
|
override render() {
|
|
256
300
|
if (!this.shouldRender) {
|
|
257
301
|
return this
|
|
258
302
|
}
|
|
259
303
|
|
|
260
|
-
this.$el.html(
|
|
304
|
+
this.$el.html(Poster.template())
|
|
261
305
|
|
|
262
306
|
const isRegularPoster =
|
|
263
307
|
this.options.poster && this.options.poster.custom === undefined
|
|
@@ -291,6 +335,9 @@ export class Poster extends UIContainerPlugin {
|
|
|
291
335
|
return this
|
|
292
336
|
}
|
|
293
337
|
|
|
338
|
+
/**
|
|
339
|
+
* @internal
|
|
340
|
+
*/
|
|
294
341
|
override destroy() {
|
|
295
342
|
this.container.$el.removeClass('container-with-poster-clickable')
|
|
296
343
|
return this
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Events, Playback, UICorePlugin, Utils, template } from '@clappr/core';
|
|
6
6
|
import { TimeUpdate } from '../../playback.types.js';
|
|
7
7
|
|
|
8
|
-
import { CLAPPR_VERSION } from '
|
|
8
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
9
9
|
|
|
10
10
|
import seekTimeHTML from '../../../assets/seek-time/seek-time.html';
|
|
11
11
|
import '../../../assets/seek-time/seek-time.scss';
|
|
@@ -15,7 +15,7 @@ const { formatTime } = Utils;
|
|
|
15
15
|
|
|
16
16
|
export class SeekTime extends UICorePlugin {
|
|
17
17
|
get name() {
|
|
18
|
-
return '
|
|
18
|
+
return 'media_control_seek_time';
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
get supportedVersion() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Container, Events, UICorePlugin, template } from '@clappr/core';
|
|
2
2
|
|
|
3
|
-
import { CLAPPR_VERSION } from '
|
|
3
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
4
4
|
|
|
5
5
|
import pluginHtml from '../../../assets/share/share.ejs';
|
|
6
6
|
import '../../../assets/share/style.scss';
|
|
@@ -15,7 +15,7 @@ export class Share extends UICorePlugin {
|
|
|
15
15
|
private container: Container | null = null;
|
|
16
16
|
|
|
17
17
|
get name() {
|
|
18
|
-
return '
|
|
18
|
+
return 'media_control_share';
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
get supportedVersion() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UICorePlugin as UICorePluginOriginal, Browser, Playback, Events, template } from '@clappr/core';
|
|
2
2
|
|
|
3
|
-
import { CLAPPR_VERSION } from '
|
|
3
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
4
4
|
|
|
5
5
|
import pluginHtml from '../../../assets/skip-time/skip-time.ejs';
|
|
6
6
|
import '../../../assets/skip-time/style.scss';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from '../../types.js'
|
|
13
13
|
import { trace } from '@gcorevideo/utils'
|
|
14
14
|
|
|
15
|
-
import { CLAPPR_VERSION } from '
|
|
15
|
+
import { CLAPPR_VERSION } from '../../build.js'
|
|
16
16
|
|
|
17
17
|
const T = 'plugins.source_controller'
|
|
18
18
|
|
|
@@ -137,7 +137,6 @@ export class SourceController extends CorePlugin {
|
|
|
137
137
|
} else {
|
|
138
138
|
this.sync = noSync
|
|
139
139
|
}
|
|
140
|
-
// TODO bind to CORE_ACTIVE_CONTAINER_CHANGED
|
|
141
140
|
this.bindContainerEventListeners()
|
|
142
141
|
if (this.active) {
|
|
143
142
|
this.core.activeContainer?.getPlugin('poster_custom')?.disable()
|
|
@@ -75,6 +75,7 @@ describe('SourceController', () => {
|
|
|
75
75
|
})
|
|
76
76
|
const _ = new SourceController(core)
|
|
77
77
|
core.emit('core:ready')
|
|
78
|
+
core.emit('core:active:container:changed')
|
|
78
79
|
core.activePlayback.emit('playback:error', { code: PlaybackErrorCode.MediaSourceUnavailable })
|
|
79
80
|
nextPlayback = new _MockPlayback({} as any, {} as any)
|
|
80
81
|
vi.spyOn(nextPlayback, 'consent')
|
|
@@ -111,6 +112,7 @@ describe('SourceController', () => {
|
|
|
111
112
|
}
|
|
112
113
|
})
|
|
113
114
|
core.emit('core:ready')
|
|
115
|
+
core.emit('core:active:container:changed')
|
|
114
116
|
})
|
|
115
117
|
it('should disable the poster', async () => {
|
|
116
118
|
expect(poster.disable).toHaveBeenCalled()
|
|
@@ -134,6 +136,7 @@ describe('SourceController', () => {
|
|
|
134
136
|
})
|
|
135
137
|
const _ = new SourceController(core)
|
|
136
138
|
core.emit('core:ready')
|
|
139
|
+
core.emit('core:active:container:changed')
|
|
137
140
|
core.activePlayback.emit('playback:error', { code: PlaybackErrorCode.MediaSourceUnavailable })
|
|
138
141
|
nextPlayback = new _MockPlayback({} as any, {} as any)
|
|
139
142
|
vi.spyOn(nextPlayback, 'consent')
|
|
@@ -157,6 +160,7 @@ describe('SourceController', () => {
|
|
|
157
160
|
})
|
|
158
161
|
const _ = new SourceController(core)
|
|
159
162
|
core.emit('core:ready')
|
|
163
|
+
core.emit('core:active:container:changed')
|
|
160
164
|
core.activePlayback.emit('playback:error', { code: PlaybackErrorCode.MediaSourceUnavailable })
|
|
161
165
|
await clock.tickAsync(1000)
|
|
162
166
|
nextPlayback = new _MockPlayback({} as any, {} as any)
|
|
@@ -172,6 +176,7 @@ describe('SourceController', () => {
|
|
|
172
176
|
}
|
|
173
177
|
})
|
|
174
178
|
core.emit('core:ready')
|
|
179
|
+
core.emit('core:active:container:changed')
|
|
175
180
|
nextPlayback.emit('playback:play')
|
|
176
181
|
})
|
|
177
182
|
it('should enable the poster', async () => {
|
|
@@ -9,7 +9,7 @@ import { trace } from '@gcorevideo/utils';
|
|
|
9
9
|
import spinnerHTML from '../../../assets/spinner-three-bounce/spinner.ejs';
|
|
10
10
|
import '../../../assets/spinner-three-bounce/spinner.scss';
|
|
11
11
|
import { TimerId } from '../../utils/types.js';
|
|
12
|
-
import { CLAPPR_VERSION } from '
|
|
12
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
13
13
|
|
|
14
14
|
const T = 'plugins.spinner'
|
|
15
15
|
|
|
@@ -5,7 +5,7 @@ import type { PlaybackType } from '../..//types'
|
|
|
5
5
|
import { reportError } from '@gcorevideo/utils'
|
|
6
6
|
import assert from 'assert'
|
|
7
7
|
|
|
8
|
-
import { CLAPPR_VERSION } from '
|
|
8
|
+
import { CLAPPR_VERSION } from '../../build.js'
|
|
9
9
|
|
|
10
10
|
const CUSTOM_EVENTS_CONTAINER_START = 'container:start'
|
|
11
11
|
|
|
@@ -11,7 +11,7 @@ import { type TimeValue } from '../../playback.types.js'
|
|
|
11
11
|
import { reportError } from '@gcorevideo/utils'
|
|
12
12
|
import assert from 'assert'
|
|
13
13
|
|
|
14
|
-
import { CLAPPR_VERSION } from '
|
|
14
|
+
import { CLAPPR_VERSION } from '../../build.js'
|
|
15
15
|
|
|
16
16
|
import '../../../assets/subtitles/style.scss'
|
|
17
17
|
import subtitlesOffIcon from '../../../assets/icons/new/subtitles-off.svg'
|
|
@@ -26,7 +26,7 @@ const VERSION: string = '0.0.1'
|
|
|
26
26
|
|
|
27
27
|
const LOCAL_STORAGE_SUBTITLES_ID = 'subtitles_select'
|
|
28
28
|
|
|
29
|
-
const T = 'plugins.
|
|
29
|
+
const T = 'plugins.media_control_subtitles'
|
|
30
30
|
|
|
31
31
|
type TextTrackInfo = {
|
|
32
32
|
language: string
|
|
@@ -53,7 +53,7 @@ export class Subtitles extends UICorePlugin {
|
|
|
53
53
|
private $string: ZeptoResult | undefined
|
|
54
54
|
|
|
55
55
|
get name() {
|
|
56
|
-
return '
|
|
56
|
+
return 'media_control_subtitles'
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
get supportedVersion() {
|
|
@@ -4,7 +4,7 @@ import parseSRT, { type ParsedSRT } from 'parse-srt';
|
|
|
4
4
|
|
|
5
5
|
import { TimeValue } from '../../playback.types.js';
|
|
6
6
|
|
|
7
|
-
import { CLAPPR_VERSION } from '
|
|
7
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
8
8
|
|
|
9
9
|
import pluginHtml from '../../../assets/thumbnails/scrub-thumbnails.ejs';
|
|
10
10
|
import '../../../assets/thumbnails/style.scss';
|
|
@@ -31,7 +31,7 @@ type Thumb = {
|
|
|
31
31
|
imageH?: number;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const T = 'plugins.
|
|
34
|
+
const T = 'plugins.media_control_thumbnails';
|
|
35
35
|
|
|
36
36
|
export class Thumbnails extends UICorePlugin {
|
|
37
37
|
private _$spotlight: ZeptoResult | null = null;
|
|
@@ -61,7 +61,7 @@ export class Thumbnails extends UICorePlugin {
|
|
|
61
61
|
private _thumbs: Thumb[] = [];
|
|
62
62
|
|
|
63
63
|
get name() {
|
|
64
|
-
return '
|
|
64
|
+
return 'media_control_thumbnails';
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
get supportedVersion() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TemplateFunction = (data: Record<string, unknown>) => string
|
|
@@ -15,7 +15,7 @@ import { reportError } from '@gcorevideo/utils'
|
|
|
15
15
|
import assert from 'assert'
|
|
16
16
|
import { TimePosition } from '../../playback.types.js'
|
|
17
17
|
|
|
18
|
-
import { CLAPPR_VERSION } from '
|
|
18
|
+
import { CLAPPR_VERSION } from '../../build.js'
|
|
19
19
|
import { TimerId, ZeptoResult } from '../../utils/types.js'
|
|
20
20
|
import RollManager from './rollmanager.js'
|
|
21
21
|
import SCTEManager from './sctemanager.js'
|
|
@@ -817,7 +817,7 @@ export class VastAds extends UICorePlugin {
|
|
|
817
817
|
setTimeout(async () => {
|
|
818
818
|
if (currentRoll === 'scteroll') {
|
|
819
819
|
this.options.mute = this.core.options.mute
|
|
820
|
-
this.
|
|
820
|
+
this.setMuted(this.core.options.mute)
|
|
821
821
|
this.core.mediaControl.setInitialVolume()
|
|
822
822
|
}
|
|
823
823
|
|
|
@@ -882,7 +882,7 @@ export class VastAds extends UICorePlugin {
|
|
|
882
882
|
}
|
|
883
883
|
await this.playback?.play()
|
|
884
884
|
this.options.mute = this.core.options.mute
|
|
885
|
-
this.
|
|
885
|
+
this.setMuted(this.core.options.mute)
|
|
886
886
|
this.core.mediaControl.setInitialVolume()
|
|
887
887
|
}
|
|
888
888
|
}, 0)
|
|
@@ -909,7 +909,7 @@ export class VastAds extends UICorePlugin {
|
|
|
909
909
|
return this
|
|
910
910
|
}
|
|
911
911
|
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
912
|
+
private setMuted(muted: boolean) {
|
|
913
|
+
this.core.activeContainer.options.mute = muted
|
|
914
|
+
}
|
|
915
915
|
}
|