@gcorevideo/player 2.25.9 → 2.26.0
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 +23 -78
- package/dist/index.css +1193 -1193
- package/dist/index.embed.js +89 -153
- package/dist/index.js +112 -249
- package/dist/player.d.ts +2798 -2785
- package/docs/api/player.bigmutebutton.md +0 -3
- package/docs/api/player.bottomgear.additem.md +0 -3
- package/docs/api/player.bottomgear.md +2 -5
- package/docs/api/player.bottomgear.refresh.md +0 -3
- package/docs/api/player.clapprstats._constructor_.md +0 -3
- package/docs/api/player.clapprstats.clearmetrics.md +0 -3
- package/docs/api/player.clapprstats.exportmetrics.md +1 -4
- package/docs/api/player.clapprstats.md +2 -7
- package/docs/api/player.clapprstatsbitratetrack.md +0 -3
- package/docs/api/player.clapprstatschronograph.md +0 -13
- package/docs/api/player.clapprstatscounter.md +0 -25
- package/docs/api/player.clapprstatsevents.md +1 -4
- package/docs/api/player.clapprstatsmetrics.md +0 -3
- package/docs/api/player.clapprstatssettings.md +1 -4
- package/docs/api/player.clapprstatssettings.runeach.md +0 -3
- package/docs/api/player.clicktopause.md +0 -3
- package/docs/api/player.clips.destroy.md +0 -3
- package/docs/api/player.clips.disable.md +0 -3
- package/docs/api/player.clips.enable.md +0 -3
- package/docs/api/player.clips.gettext.md +0 -3
- package/docs/api/player.clips.md +1 -16
- package/docs/api/player.clips.render.md +0 -3
- package/docs/api/player.clips.supportedversion.md +0 -3
- package/docs/api/player.clips.version.md +0 -3
- package/docs/api/player.clipspluginsettings.md +1 -4
- package/docs/api/player.clipspluginsettings.text.md +0 -3
- package/docs/api/player.closedcaptions.hide.md +0 -3
- package/docs/api/player.closedcaptions.md +6 -5
- package/docs/api/player.closedcaptions.show.md +0 -3
- package/docs/api/player.closedcaptionspluginsettings.md +0 -3
- package/docs/api/player.cmcdconfig._constructor_.md +0 -3
- package/docs/api/player.cmcdconfig.exportids.md +0 -3
- package/docs/api/player.cmcdconfig.md +2 -5
- package/docs/api/player.cmcdconfigoptions.contentid.md +0 -3
- package/docs/api/player.cmcdconfigoptions.md +2 -5
- package/docs/api/player.cmcdconfigoptions.sessionid.md +0 -3
- package/docs/api/player.dvrcontrols.md +0 -3
- package/docs/api/player.extendedevents.md +0 -7
- package/docs/api/player.favicon.md +0 -3
- package/docs/api/player.faviconpluginsettings.faviconcolor.md +0 -3
- package/docs/api/player.faviconpluginsettings.md +1 -4
- package/docs/api/player.gearevents.md +1 -4
- package/docs/api/player.md +24 -43
- package/docs/api/player.mediacontrol.defaultsettings.md +5 -1
- package/docs/api/player.mediacontrol.getavailablepopupheight.md +20 -0
- package/docs/api/player.mediacontrol.md +14 -0
- package/docs/api/player.menuoption.md +0 -3
- package/docs/api/player.nerdstats._constructor_.md +0 -3
- package/docs/api/player.nerdstats.md +1 -4
- package/docs/api/player.pictureinpicture.attributes.md +0 -3
- package/docs/api/player.pictureinpicture.md +2 -7
- package/docs/api/player.playbackrateoption.md +0 -3
- package/docs/api/player.playbackratesettings.md +0 -3
- package/docs/api/player.poster.disable.md +0 -3
- package/docs/api/player.poster.enable.md +0 -3
- package/docs/api/player.poster.md +2 -5
- package/docs/api/player.posterpluginsettings.custom.md +0 -3
- package/docs/api/player.posterpluginsettings.md +4 -7
- package/docs/api/player.posterpluginsettings.showfornoop.md +0 -3
- package/docs/api/player.posterpluginsettings.showonvideoend.md +0 -3
- package/docs/api/player.posterpluginsettings.url.md +0 -3
- package/docs/api/player.qualitylevels.events.md +0 -3
- package/docs/api/player.qualitylevels.md +0 -5
- package/docs/api/player.qualitylevelspluginsettings.labels.md +0 -3
- package/docs/api/player.qualitylevelspluginsettings.md +2 -5
- package/docs/api/player.qualitylevelspluginsettings.restrictresolution.md +0 -3
- package/docs/api/player.skiptime.container.md +0 -3
- package/docs/api/player.skiptime.md +0 -9
- package/docs/api/player.skiptime.name.md +0 -3
- package/docs/api/player.skiptime.supportedversion.md +0 -3
- package/docs/api/player.volumefadeevents.md +0 -5
- package/docs/api/player.volumefadesettings.md +0 -3
- package/docs/api/player.zeptoresult.md +0 -3
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +0 -29
- package/lib/playback/HTML5Video.d.ts.map +1 -1
- package/lib/playback/HTML5Video.js +0 -18
- package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
- package/lib/playback/dash-playback/DashPlayback.js +0 -10
- package/lib/playback/hls-playback/HlsPlayback.d.ts +0 -1
- package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
- package/lib/playback/hls-playback/HlsPlayback.js +22 -20
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts +1 -1
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
- package/lib/plugins/big-mute-button/BigMuteButton.js +1 -3
- package/lib/plugins/bottom-gear/BottomGear.d.ts +2 -2
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +4 -8
- package/lib/plugins/clappr-nerd-stats/NerdStats.d.ts +1 -1
- package/lib/plugins/clappr-nerd-stats/NerdStats.d.ts.map +1 -1
- package/lib/plugins/clappr-nerd-stats/NerdStats.js +3 -5
- package/lib/plugins/clappr-stats/ClapprStats.d.ts +3 -3
- package/lib/plugins/clappr-stats/ClapprStats.js +2 -2
- package/lib/plugins/clappr-stats/types.d.ts +5 -5
- package/lib/plugins/clappr-stats/types.js +3 -3
- package/lib/plugins/click-to-pause/ClickToPause.d.ts +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.js +3 -7
- package/lib/plugins/clips/Clips.d.ts +2 -2
- package/lib/plugins/clips/Clips.d.ts.map +1 -1
- package/lib/plugins/clips/Clips.js +2 -6
- package/lib/plugins/cmcd-config/CmcdConfig.d.ts +2 -2
- package/lib/plugins/cmcd-config/CmcdConfig.js +1 -1
- package/lib/plugins/context-menu/ContextMenu.d.ts +1 -1
- package/lib/plugins/dvr-controls/DvrControls.d.ts +1 -1
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.js +3 -4
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
- package/lib/plugins/error-screen/ErrorScreen.js +0 -3
- package/lib/plugins/favicon/Favicon.d.ts +2 -2
- package/lib/plugins/favicon/Favicon.js +1 -1
- package/lib/plugins/level-selector/QualityLevels.d.ts +2 -2
- package/lib/plugins/level-selector/QualityLevels.d.ts.map +1 -1
- package/lib/plugins/level-selector/QualityLevels.js +3 -11
- package/lib/plugins/media-control/MediaControl.d.ts +2 -5
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +4 -6
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +3 -3
- package/lib/plugins/picture-in-picture/PictureInPicture.js +3 -3
- package/lib/plugins/playback-rate/PlaybackRate.d.ts +2 -2
- package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
- package/lib/plugins/playback-rate/PlaybackRate.js +0 -10
- package/lib/plugins/poster/Poster.d.ts +2 -2
- package/lib/plugins/poster/Poster.d.ts.map +1 -1
- package/lib/plugins/poster/Poster.js +3 -19
- package/lib/plugins/seek-time/SeekTime.d.ts.map +1 -1
- package/lib/plugins/seek-time/SeekTime.js +1 -6
- package/lib/plugins/skip-time/SkipTime.d.ts +1 -1
- package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -1
- package/lib/plugins/skip-time/SkipTime.js +3 -15
- package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
- package/lib/plugins/source-controller/SourceController.js +0 -5
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +2 -18
- package/lib/plugins/subtitles/ClosedCaptions.d.ts +10 -2
- package/lib/plugins/subtitles/ClosedCaptions.d.ts.map +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.js +12 -2
- package/lib/plugins/volume-fade/VolumeFade.d.ts +2 -2
- package/lib/plugins/volume-fade/VolumeFade.js +1 -1
- package/lib/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/Player.ts +0 -30
- package/src/playback/HTML5Video.ts +0 -18
- package/src/playback/dash-playback/DashPlayback.ts +0 -11
- package/src/playback/hls-playback/HlsPlayback.ts +22 -29
- package/src/plugins/big-mute-button/BigMuteButton.ts +1 -4
- package/src/plugins/bottom-gear/BottomGear.ts +4 -8
- package/src/plugins/clappr-nerd-stats/NerdStats.ts +3 -5
- package/src/plugins/clappr-stats/ClapprStats.ts +3 -3
- package/src/plugins/clappr-stats/types.ts +5 -5
- package/src/plugins/click-to-pause/ClickToPause.ts +3 -8
- package/src/plugins/clips/Clips.ts +4 -7
- package/src/plugins/cmcd-config/CmcdConfig.ts +2 -2
- package/src/plugins/context-menu/ContextMenu.ts +1 -1
- package/src/plugins/dvr-controls/DvrControls.ts +3 -4
- package/src/plugins/error-screen/ErrorScreen.ts +0 -3
- package/src/plugins/favicon/Favicon.ts +2 -2
- package/src/plugins/level-selector/QualityLevels.ts +4 -12
- package/src/plugins/media-control/MediaControl.ts +4 -10
- package/src/plugins/picture-in-picture/PictureInPicture.ts +3 -3
- package/src/plugins/playback-rate/PlaybackRate.ts +2 -14
- package/src/plugins/poster/Poster.ts +4 -21
- package/src/plugins/seek-time/SeekTime.ts +2 -6
- package/src/plugins/skip-time/SkipTime.ts +3 -15
- package/src/plugins/source-controller/SourceController.ts +0 -5
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +2 -18
- package/src/plugins/subtitles/ClosedCaptions.ts +13 -3
- package/src/plugins/volume-fade/VolumeFade.ts +2 -2
- package/src/types.ts +1 -1
- package/temp/player.api.json +157 -152
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.mediacontrolpluginsettings.md +0 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Events, template, UICorePlugin } from '@clappr/core'
|
|
2
|
-
import { trace } from '@gcorevideo/utils'
|
|
2
|
+
// import { trace } from '@gcorevideo/utils'
|
|
3
3
|
import assert from 'assert'
|
|
4
4
|
|
|
5
5
|
import { type QualityLevel } from '../../playback.types.js'
|
|
@@ -17,12 +17,12 @@ import checkIcon from '../../../assets/icons/new/check.svg'
|
|
|
17
17
|
import '../../../assets/level-selector/style.scss'
|
|
18
18
|
import { MediaControl } from '../media-control/MediaControl.js'
|
|
19
19
|
|
|
20
|
-
const T = 'plugins.quality_levels'
|
|
20
|
+
// const T = 'plugins.quality_levels'
|
|
21
21
|
const VERSION = 'v2.22.5'
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Configuration options for the {@link QualityLevels} plugin.
|
|
25
|
-
* @
|
|
25
|
+
* @public
|
|
26
26
|
*/
|
|
27
27
|
export interface QualityLevelsPluginSettings {
|
|
28
28
|
/**
|
|
@@ -41,7 +41,7 @@ export interface QualityLevelsPluginSettings {
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* `PLUGIN` that provides a UI to select the desired quality level of the playback.
|
|
44
|
-
* @
|
|
44
|
+
* @public
|
|
45
45
|
*
|
|
46
46
|
* @remarks
|
|
47
47
|
* Depends on:
|
|
@@ -133,7 +133,6 @@ export class QualityLevels extends UICorePlugin {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
private onCoreReady() {
|
|
136
|
-
trace(`${T} onCoreReady`)
|
|
137
136
|
const gear = this.core.getPlugin('bottom_gear') as BottomGear
|
|
138
137
|
assert(gear, 'bottom_gear plugin is required')
|
|
139
138
|
|
|
@@ -142,7 +141,6 @@ export class QualityLevels extends UICorePlugin {
|
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
private onGearRendered() {
|
|
145
|
-
trace(`${T} onGearRendered`)
|
|
146
144
|
this.render()
|
|
147
145
|
}
|
|
148
146
|
|
|
@@ -191,7 +189,6 @@ export class QualityLevels extends UICorePlugin {
|
|
|
191
189
|
}
|
|
192
190
|
|
|
193
191
|
private onStop() {
|
|
194
|
-
trace(`${T} onStop`)
|
|
195
192
|
this.listenToOnce(this.core.activePlayback, Events.PLAYBACK_PLAY, () => {
|
|
196
193
|
if (this.core.activePlayback.getPlaybackType() === 'live') {
|
|
197
194
|
if (this.selectedLevelId !== -1) {
|
|
@@ -316,7 +313,6 @@ export class QualityLevels extends UICorePlugin {
|
|
|
316
313
|
}
|
|
317
314
|
|
|
318
315
|
private goBack() {
|
|
319
|
-
trace(`${T} goBack`)
|
|
320
316
|
this.core.getPlugin('bottom_gear').refresh()
|
|
321
317
|
}
|
|
322
318
|
|
|
@@ -361,14 +357,10 @@ export class QualityLevels extends UICorePlugin {
|
|
|
361
357
|
}
|
|
362
358
|
|
|
363
359
|
private onBitrate(info: QualityLevel) {
|
|
364
|
-
trace(`${T} updateCurrentLevel`, { info })
|
|
365
360
|
this.highlightCurrentLevel()
|
|
366
361
|
}
|
|
367
362
|
|
|
368
363
|
private highlightCurrentLevel() {
|
|
369
|
-
trace(`${T} highlightCurrentLevel`, {
|
|
370
|
-
selectedLevelId: this.selectedLevelId,
|
|
371
|
-
})
|
|
372
364
|
this.allLevelElements()
|
|
373
365
|
.removeClass('current')
|
|
374
366
|
.find('a')
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
$,
|
|
16
16
|
Core,
|
|
17
17
|
} from '@clappr/core'
|
|
18
|
-
import { reportError, trace } from '@gcorevideo/utils'
|
|
18
|
+
import { reportError/* , trace */ } from '@gcorevideo/utils'
|
|
19
19
|
|
|
20
20
|
import { type TimeProgress } from '../../playback.types.js'
|
|
21
21
|
|
|
@@ -119,11 +119,11 @@ const INITIAL_SETTINGS: MediaControlSettings = {
|
|
|
119
119
|
seekEnabled: false,
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
const T = 'plugins.media_control'
|
|
122
|
+
// const T = 'plugins.media_control'
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* Extended events for the {@link MediaControl} plugin
|
|
126
|
-
* @
|
|
126
|
+
* @public
|
|
127
127
|
*/
|
|
128
128
|
export enum ExtendedEvents {
|
|
129
129
|
MEDIACONTROL_VOLUME = 'mediacontrol:volume',
|
|
@@ -132,10 +132,6 @@ export enum ExtendedEvents {
|
|
|
132
132
|
|
|
133
133
|
const { Config, Fullscreen, formatTime, extend, removeArrayItem } = Utils
|
|
134
134
|
|
|
135
|
-
export type MediaControlPluginSettings = {
|
|
136
|
-
hideMediaControlDelay?: number
|
|
137
|
-
}
|
|
138
|
-
|
|
139
135
|
/**
|
|
140
136
|
* `PLUGIN` that provides framework for building media control UI.
|
|
141
137
|
* @beta
|
|
@@ -251,7 +247,7 @@ export class MediaControl extends UICorePlugin {
|
|
|
251
247
|
|
|
252
248
|
/**
|
|
253
249
|
* @returns Default media control layout settings
|
|
254
|
-
* @
|
|
250
|
+
* @remarks
|
|
255
251
|
* The method can be used to change the default dashboard layout, for example, removing the standard UI elements
|
|
256
252
|
* @example
|
|
257
253
|
* ```ts
|
|
@@ -532,7 +528,6 @@ export class MediaControl extends UICorePlugin {
|
|
|
532
528
|
* Hides the media control UI
|
|
533
529
|
*/
|
|
534
530
|
override disable() {
|
|
535
|
-
trace(`${T} disable`)
|
|
536
531
|
this.userDisabled = true // TODO distinguish between user and system (e.g., unplayable) disabled?
|
|
537
532
|
this.hide()
|
|
538
533
|
this.unbindKeyEvents()
|
|
@@ -543,7 +538,6 @@ export class MediaControl extends UICorePlugin {
|
|
|
543
538
|
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
544
539
|
*/
|
|
545
540
|
override enable() {
|
|
546
|
-
trace(`${T} enable`)
|
|
547
541
|
if (this.options.chromeless) {
|
|
548
542
|
return
|
|
549
543
|
}
|
|
@@ -13,14 +13,14 @@ const VERSION = '0.0.1';
|
|
|
13
13
|
const T = `plugins.pip`;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* `PLUGIN` that enables picture
|
|
17
|
-
* @
|
|
16
|
+
* `PLUGIN` that enables picture-in-picture mode.
|
|
17
|
+
* @public
|
|
18
18
|
* @remarks
|
|
19
19
|
* Depends on:
|
|
20
20
|
*
|
|
21
21
|
* - {@link MediaControl}
|
|
22
22
|
*
|
|
23
|
-
* It renders a button to toggle picture
|
|
23
|
+
* It renders a button to toggle picture-in-picture mode in the media control UI.
|
|
24
24
|
*/
|
|
25
25
|
export class PictureInPicture extends UICorePlugin {
|
|
26
26
|
/**
|
|
@@ -17,7 +17,7 @@ import { MediaControl } from '../media-control/MediaControl.js'
|
|
|
17
17
|
import { TimerId } from '../../utils/types.js'
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* @
|
|
20
|
+
* @public
|
|
21
21
|
*/
|
|
22
22
|
export type PlaybackRateOption = {
|
|
23
23
|
value: number
|
|
@@ -25,7 +25,7 @@ export type PlaybackRateOption = {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* @
|
|
28
|
+
* @public
|
|
29
29
|
*/
|
|
30
30
|
export type PlaybackRateSettings = {
|
|
31
31
|
options?: PlaybackRateOption[]
|
|
@@ -249,11 +249,6 @@ export class PlaybackRate extends UICorePlugin {
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
private shouldMount() {
|
|
252
|
-
trace(`${T} shouldMount`, {
|
|
253
|
-
playbackType: this.core.activePlayback?.getPlaybackType(),
|
|
254
|
-
dvrEnabled: this.core.activePlayback?.dvrEnabled,
|
|
255
|
-
})
|
|
256
|
-
|
|
257
252
|
if (!this.core.activePlayback || !this.metadataLoaded) {
|
|
258
253
|
return false
|
|
259
254
|
}
|
|
@@ -272,10 +267,6 @@ export class PlaybackRate extends UICorePlugin {
|
|
|
272
267
|
* @internal
|
|
273
268
|
*/
|
|
274
269
|
override render() {
|
|
275
|
-
trace(`${T} render`, {
|
|
276
|
-
shouldMount: this.shouldMount(),
|
|
277
|
-
})
|
|
278
|
-
|
|
279
270
|
this.$el.html(
|
|
280
271
|
PlaybackRate.listTemplate({
|
|
281
272
|
arrowLeftIcon,
|
|
@@ -394,9 +385,6 @@ export class PlaybackRate extends UICorePlugin {
|
|
|
394
385
|
}
|
|
395
386
|
|
|
396
387
|
private updateGearOptionLabel() {
|
|
397
|
-
trace(`${T} updateGearOptionLabel`, {
|
|
398
|
-
selectedRate: this.selectedRate,
|
|
399
|
-
})
|
|
400
388
|
this.mount()
|
|
401
389
|
}
|
|
402
390
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
UIContainerPlugin,
|
|
10
10
|
template,
|
|
11
11
|
} from '@clappr/core'
|
|
12
|
-
import { trace } from '@gcorevideo/utils'
|
|
12
|
+
// import { trace } from '@gcorevideo/utils'
|
|
13
13
|
|
|
14
14
|
import { CLAPPR_VERSION } from '../../build.js'
|
|
15
15
|
import type { ZeptoResult } from '../../types.js'
|
|
@@ -21,7 +21,7 @@ import { PlaybackError } from '../../playback.types.js'
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Config options for the {@link Poster} plugin
|
|
24
|
-
* @
|
|
24
|
+
* @public
|
|
25
25
|
*/
|
|
26
26
|
export interface PosterPluginSettings {
|
|
27
27
|
/**
|
|
@@ -42,11 +42,11 @@ export interface PosterPluginSettings {
|
|
|
42
42
|
showOnVideoEnd?: boolean
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
const T = 'plugins.poster'
|
|
45
|
+
// const T = 'plugins.poster'
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* `PLUGIN` that displays a poster image in the background and a big play button on top when playback is stopped
|
|
49
|
-
* @
|
|
49
|
+
* @public
|
|
50
50
|
* @remarks
|
|
51
51
|
* When the playback is stopped or not yet started, the media control UI is disabled and hidden.
|
|
52
52
|
* Media control gets activated once the metadata is loaded after playback is initiated.
|
|
@@ -157,7 +157,6 @@ export class Poster extends UIContainerPlugin {
|
|
|
157
157
|
* Reenables earlier disabled plugin
|
|
158
158
|
*/
|
|
159
159
|
override enable() {
|
|
160
|
-
trace(`${T} enable`)
|
|
161
160
|
super.enable()
|
|
162
161
|
this.playing = this.container.playback.isPlaying()
|
|
163
162
|
this.update()
|
|
@@ -167,17 +166,12 @@ export class Poster extends UIContainerPlugin {
|
|
|
167
166
|
* Disables the plugin, unmounting it from the DOM
|
|
168
167
|
*/
|
|
169
168
|
override disable() {
|
|
170
|
-
trace(`${T} disable`)
|
|
171
169
|
this.playing = false
|
|
172
170
|
this.playRequested = false
|
|
173
171
|
super.disable()
|
|
174
172
|
}
|
|
175
173
|
|
|
176
174
|
private onError(error: PlaybackError) {
|
|
177
|
-
trace(`${T} onError`, {
|
|
178
|
-
error,
|
|
179
|
-
enabled: this.enabled,
|
|
180
|
-
})
|
|
181
175
|
if (this.hasFatalError) {
|
|
182
176
|
return
|
|
183
177
|
}
|
|
@@ -186,27 +180,23 @@ export class Poster extends UIContainerPlugin {
|
|
|
186
180
|
}
|
|
187
181
|
|
|
188
182
|
private onPlay() {
|
|
189
|
-
trace(`${T} onPlay`)
|
|
190
183
|
this.playing = true
|
|
191
184
|
this.playRequested = false
|
|
192
185
|
this.update()
|
|
193
186
|
}
|
|
194
187
|
|
|
195
188
|
private onPlayIntent() {
|
|
196
|
-
trace(`${T} onPlayIntent`)
|
|
197
189
|
this.playRequested = true
|
|
198
190
|
this.update()
|
|
199
191
|
}
|
|
200
192
|
|
|
201
193
|
private onStop() {
|
|
202
|
-
trace(`${T} onStop`)
|
|
203
194
|
this.playing = false
|
|
204
195
|
this.playRequested = false
|
|
205
196
|
this.update()
|
|
206
197
|
}
|
|
207
198
|
|
|
208
199
|
private updatePlayButton() {
|
|
209
|
-
trace(`${T} updatePlayButton`)
|
|
210
200
|
const show =
|
|
211
201
|
!this.isNoOp &&
|
|
212
202
|
!(this.options.chromeless && !this.options.allowUserInteraction) &&
|
|
@@ -223,20 +213,17 @@ export class Poster extends UIContainerPlugin {
|
|
|
223
213
|
}
|
|
224
214
|
|
|
225
215
|
private showPlayButton() {
|
|
226
|
-
trace(`${T} showPlayButton`)
|
|
227
216
|
this.$el.find('#poster-play').show()
|
|
228
217
|
this.$el.addClass('clickable')
|
|
229
218
|
this.container.$el.addClass('container-with-poster-clickable')
|
|
230
219
|
}
|
|
231
220
|
|
|
232
221
|
private hidePlayButton() {
|
|
233
|
-
trace(`${T} hidePlayButton`)
|
|
234
222
|
this.$el.find('#poster-play').hide()
|
|
235
223
|
this.$el.removeClass('clickable')
|
|
236
224
|
}
|
|
237
225
|
|
|
238
226
|
private clicked(e: MouseEvent) {
|
|
239
|
-
trace(`${T} clicked`)
|
|
240
227
|
e.preventDefault()
|
|
241
228
|
e.stopPropagation()
|
|
242
229
|
if (this.options.chromeless && !this.options.allowUserInteraction) {
|
|
@@ -256,14 +243,11 @@ export class Poster extends UIContainerPlugin {
|
|
|
256
243
|
}
|
|
257
244
|
|
|
258
245
|
private update() {
|
|
259
|
-
trace(`${T} update`)
|
|
260
|
-
|
|
261
246
|
this.updatePlayButton()
|
|
262
247
|
this.updatePoster()
|
|
263
248
|
}
|
|
264
249
|
|
|
265
250
|
private updatePoster() {
|
|
266
|
-
trace(`${T} updatePoster`)
|
|
267
251
|
if (!this.playing) {
|
|
268
252
|
this.showPoster()
|
|
269
253
|
} else {
|
|
@@ -277,7 +261,6 @@ export class Poster extends UIContainerPlugin {
|
|
|
277
261
|
}
|
|
278
262
|
|
|
279
263
|
private hidePoster() {
|
|
280
|
-
trace(`${T} hidePoster`)
|
|
281
264
|
if (!this.options.disableMediaControl) {
|
|
282
265
|
this.container.enableMediaControl()
|
|
283
266
|
}
|
|
@@ -10,7 +10,7 @@ import { CLAPPR_VERSION } from '../../build.js'
|
|
|
10
10
|
|
|
11
11
|
import seekTimeHTML from '../../../assets/seek-time/seek-time.html'
|
|
12
12
|
import '../../../assets/seek-time/seek-time.scss'
|
|
13
|
-
import { trace } from '@gcorevideo/utils'
|
|
13
|
+
// import { trace } from '@gcorevideo/utils'
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Configuration options for the SeekTime plugin.
|
|
@@ -26,7 +26,7 @@ export type SeekTimeSettings = {
|
|
|
26
26
|
|
|
27
27
|
const { formatTime } = Utils
|
|
28
28
|
|
|
29
|
-
const T = 'plugins.seek_time'
|
|
29
|
+
// const T = 'plugins.seek_time'
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* `PLUGIN` that adds a seek time indicator when the mouse pointer is over the seek bar.
|
|
@@ -128,14 +128,10 @@ export class SeekTime extends UICorePlugin {
|
|
|
128
128
|
private showTime(event: MouseEvent) {
|
|
129
129
|
this.hoveringOverSeekBar = true
|
|
130
130
|
this.calculateHoverPosition(event)
|
|
131
|
-
trace(`${T} showTime`, {
|
|
132
|
-
hoverPosition: this.hoverPosition,
|
|
133
|
-
})
|
|
134
131
|
this.update()
|
|
135
132
|
}
|
|
136
133
|
|
|
137
134
|
private hideTime() {
|
|
138
|
-
trace(`${T} hideTime`)
|
|
139
135
|
this.hoveringOverSeekBar = false
|
|
140
136
|
this.update()
|
|
141
137
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UICorePlugin, Browser, Playback, Events, template } from '@clappr/core'
|
|
2
|
-
import { trace } from '@gcorevideo/utils'
|
|
2
|
+
// import { trace } from '@gcorevideo/utils'
|
|
3
3
|
|
|
4
4
|
import { CLAPPR_VERSION } from '../../build.js'
|
|
5
5
|
|
|
@@ -8,11 +8,11 @@ import '../../../assets/skip-time/style.scss'
|
|
|
8
8
|
|
|
9
9
|
type Position = 'mid' | 'left' | 'right'
|
|
10
10
|
|
|
11
|
-
const T = 'plugins.skip_time'
|
|
11
|
+
// const T = 'plugins.skip_time'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* `PLUGIN` that allows skipping time by tapping on the left or right side of the video.
|
|
15
|
-
* @
|
|
15
|
+
* @public
|
|
16
16
|
*/
|
|
17
17
|
export class SkipTime extends UICorePlugin {
|
|
18
18
|
get name() {
|
|
@@ -69,14 +69,10 @@ export class SkipTime extends UICorePlugin {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
private setBack() {
|
|
72
|
-
trace(`${T} setBack`)
|
|
73
72
|
this.position = 'left'
|
|
74
73
|
}
|
|
75
74
|
|
|
76
75
|
private handleRewindClicks() {
|
|
77
|
-
trace(`${T} handleRewindClicks`, {
|
|
78
|
-
position: this.position,
|
|
79
|
-
})
|
|
80
76
|
if (
|
|
81
77
|
this.core.getPlaybackType() === Playback.LIVE &&
|
|
82
78
|
!this.container.isDvrEnabled()
|
|
@@ -88,9 +84,6 @@ export class SkipTime extends UICorePlugin {
|
|
|
88
84
|
}
|
|
89
85
|
|
|
90
86
|
private handleSkip() {
|
|
91
|
-
trace(`${T} handleSkip`, {
|
|
92
|
-
position: this.position,
|
|
93
|
-
})
|
|
94
87
|
if (Browser.isMobile) {
|
|
95
88
|
if (this.position === 'left') {
|
|
96
89
|
const seekPos = this.container.getCurrentTime() - 10
|
|
@@ -114,17 +107,14 @@ export class SkipTime extends UICorePlugin {
|
|
|
114
107
|
}
|
|
115
108
|
|
|
116
109
|
private setMidClick() {
|
|
117
|
-
trace(`${T} setMidClick`)
|
|
118
110
|
this.position = 'mid'
|
|
119
111
|
}
|
|
120
112
|
|
|
121
113
|
private setForward() {
|
|
122
|
-
trace(`${T} setForward`)
|
|
123
114
|
this.position = 'right'
|
|
124
115
|
}
|
|
125
116
|
|
|
126
117
|
private toggleFullscreen() {
|
|
127
|
-
trace(`${T} toggleFullscreen`)
|
|
128
118
|
this.trigger(Events.MEDIACONTROL_FULLSCREEN, this.name)
|
|
129
119
|
this.container.fullscreen()
|
|
130
120
|
this.core.toggleFullscreen()
|
|
@@ -134,14 +124,12 @@ export class SkipTime extends UICorePlugin {
|
|
|
134
124
|
* @internal
|
|
135
125
|
*/
|
|
136
126
|
override render() {
|
|
137
|
-
trace(`${T} render`)
|
|
138
127
|
this.$el.html(SkipTime.template())
|
|
139
128
|
|
|
140
129
|
return this
|
|
141
130
|
}
|
|
142
131
|
|
|
143
132
|
private mount() {
|
|
144
|
-
trace(`${T} mount`)
|
|
145
133
|
this.core.activeContainer.$el.append(this.el)
|
|
146
134
|
}
|
|
147
135
|
}
|
|
@@ -176,15 +176,10 @@ export class SourceController extends CorePlugin {
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
private onCoreReady() {
|
|
179
|
-
trace(`${T} onCoreReady`)
|
|
180
179
|
this.core.getPlugin('error_screen')?.disable() // TODO test
|
|
181
180
|
}
|
|
182
181
|
|
|
183
182
|
private onActiveContainerChanged() {
|
|
184
|
-
trace(`${T} onActiveContainerChanged`, {
|
|
185
|
-
retrying: this.active,
|
|
186
|
-
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
187
|
-
})
|
|
188
183
|
const spinner = this.core.activeContainer?.getPlugin('spinner')
|
|
189
184
|
if (spinner) {
|
|
190
185
|
this.sync = (cb: () => void) => {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
UIContainerPlugin,
|
|
11
11
|
template,
|
|
12
12
|
} from '@clappr/core'
|
|
13
|
-
import { trace } from '@gcorevideo/utils'
|
|
13
|
+
// import { trace } from '@gcorevideo/utils'
|
|
14
14
|
|
|
15
15
|
import { PlaybackError, PlaybackErrorCode } from '../../playback.types.js'
|
|
16
16
|
import spinnerHTML from '../../../assets/spinner-three-bounce/spinner.ejs'
|
|
@@ -18,7 +18,7 @@ import '../../../assets/spinner-three-bounce/spinner.scss'
|
|
|
18
18
|
import { TimerId } from '../../utils/types.js'
|
|
19
19
|
import { CLAPPR_VERSION } from '../../build.js'
|
|
20
20
|
|
|
21
|
-
const T = 'plugins.spinner'
|
|
21
|
+
// const T = 'plugins.spinner'
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Custom events emitted by the plugin
|
|
@@ -108,24 +108,15 @@ export class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
private onPlay() {
|
|
111
|
-
trace(`${T} onPlay`)
|
|
112
111
|
this._hide()
|
|
113
112
|
}
|
|
114
113
|
|
|
115
114
|
private onStop() {
|
|
116
|
-
trace(`${T} onStop`, {
|
|
117
|
-
hasFatalError: this.hasFatalError,
|
|
118
|
-
})
|
|
119
115
|
this._hide()
|
|
120
116
|
}
|
|
121
117
|
|
|
122
118
|
private onError(e: PlaybackError) {
|
|
123
119
|
this.hasFatalError = e.code === PlaybackErrorCode.MediaSourceUnavailable
|
|
124
|
-
trace(`${T} onError`, {
|
|
125
|
-
e,
|
|
126
|
-
hasFatalError: this.hasFatalError,
|
|
127
|
-
error: e.code,
|
|
128
|
-
})
|
|
129
120
|
this._hide()
|
|
130
121
|
}
|
|
131
122
|
|
|
@@ -137,7 +128,6 @@ export class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
137
128
|
* @param delay - The delay in milliseconds before the spinner is shown.
|
|
138
129
|
*/
|
|
139
130
|
show(delay = 300) {
|
|
140
|
-
trace(`${T} show`)
|
|
141
131
|
this.userShown = true
|
|
142
132
|
this._show(delay)
|
|
143
133
|
}
|
|
@@ -160,9 +150,6 @@ export class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
160
150
|
}
|
|
161
151
|
|
|
162
152
|
private _hide() {
|
|
163
|
-
trace(`${T} _hide`, {
|
|
164
|
-
userShown: this.userShown,
|
|
165
|
-
})
|
|
166
153
|
if (this.userShown) {
|
|
167
154
|
return
|
|
168
155
|
}
|
|
@@ -178,9 +165,6 @@ export class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
178
165
|
* @internal
|
|
179
166
|
*/
|
|
180
167
|
override render() {
|
|
181
|
-
trace(`${T} render`, {
|
|
182
|
-
buffering: this.container.buffering,
|
|
183
|
-
})
|
|
184
168
|
this.$el.html(this.template())
|
|
185
169
|
this.el.firstElementChild?.addEventListener('animationiteration', () => {
|
|
186
170
|
this.trigger(SpinnerEvents.SYNC)
|
|
@@ -23,7 +23,7 @@ const T = 'plugins.cc'
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Configuration options for the {@link ClosedCaptions} plugin.
|
|
26
|
-
* @
|
|
26
|
+
* @public
|
|
27
27
|
*/
|
|
28
28
|
export type ClosedCaptionsPluginSettings = {
|
|
29
29
|
/**
|
|
@@ -34,7 +34,7 @@ export type ClosedCaptionsPluginSettings = {
|
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* `PLUGIN` that provides a UI to select the subtitles when available.
|
|
37
|
-
* @
|
|
37
|
+
* @public
|
|
38
38
|
*
|
|
39
39
|
* @remarks
|
|
40
40
|
* The plugin is activated when closed captions tracks are detected in the media source.
|
|
@@ -45,6 +45,14 @@ export type ClosedCaptionsPluginSettings = {
|
|
|
45
45
|
* - {@link MediaControl}
|
|
46
46
|
*
|
|
47
47
|
* Configuration options - {@link ClosedCaptionsPluginSettings}
|
|
48
|
+
*
|
|
49
|
+
* Known issues:
|
|
50
|
+
*
|
|
51
|
+
* 1. When media source changes, the subtitles tracks aren't reloaded. Possible solution: use `playback.recycleVideo = false`
|
|
52
|
+
* {@link PlayerConfig | main config option}, which will force new video element creation every time media source changes.
|
|
53
|
+
* However, this may lead to other issues, such as autoplay not working (after media source has been changed).
|
|
54
|
+
* {@link https://github.com/video-dev/hls.js/issues/2198 | related discussion}
|
|
55
|
+
*
|
|
48
56
|
* @example
|
|
49
57
|
* ```ts
|
|
50
58
|
* import { ClosedCaptions } from '@gcorevideo/player'
|
|
@@ -203,7 +211,9 @@ export class ClosedCaptions extends UICorePlugin {
|
|
|
203
211
|
}
|
|
204
212
|
|
|
205
213
|
private onSubtitleAvailable() {
|
|
206
|
-
trace(`${T} onSubtitleAvailable
|
|
214
|
+
trace(`${T} onSubtitleAvailable`, {
|
|
215
|
+
tracks: this.core.activePlayback.closedCaptionsTracks.length,
|
|
216
|
+
})
|
|
207
217
|
this.applyTracks()
|
|
208
218
|
this.mount()
|
|
209
219
|
}
|
|
@@ -6,7 +6,7 @@ import { ExtendedEvents } from '../media-control/MediaControl.js'
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Events emitted by the VolumeFade plugin.
|
|
9
|
-
* @
|
|
9
|
+
* @public
|
|
10
10
|
*/
|
|
11
11
|
export enum VolumeFadeEvents {
|
|
12
12
|
FADE = 'core:volume:fade',
|
|
@@ -18,7 +18,7 @@ const DEFAULT_DURATION = 600
|
|
|
18
18
|
const DEFAULT_VOLUME_LEVEL = 80
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* @
|
|
21
|
+
* @public
|
|
22
22
|
*/
|
|
23
23
|
export type VolumeFadeSettings = {
|
|
24
24
|
/**
|