@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
package/dist/index.js
CHANGED
|
@@ -12459,7 +12459,7 @@ var PlaybackErrorCode;
|
|
|
12459
12459
|
// license that can be found in the LICENSE file.
|
|
12460
12460
|
const AUTO$2 = -1;
|
|
12461
12461
|
const { now: now$2 } = Utils;
|
|
12462
|
-
const T$
|
|
12462
|
+
const T$d = 'playback.dash';
|
|
12463
12463
|
// @ts-expect-error
|
|
12464
12464
|
class DashPlayback extends HTML5Video {
|
|
12465
12465
|
_levels = null;
|
|
@@ -12729,10 +12729,10 @@ class DashPlayback extends HTML5Video {
|
|
|
12729
12729
|
}
|
|
12730
12730
|
_onPlaybackError = (event) => {
|
|
12731
12731
|
// TODO
|
|
12732
|
-
trace(`${T$
|
|
12732
|
+
trace(`${T$d} _onPlaybackError`, { event });
|
|
12733
12733
|
};
|
|
12734
12734
|
_onDASHJSSError = (event) => {
|
|
12735
|
-
trace(`${T$
|
|
12735
|
+
trace(`${T$d} _onDASHJSSError`, { event });
|
|
12736
12736
|
this._stopTimeUpdateTimer();
|
|
12737
12737
|
// Note that the other error types are deprecated
|
|
12738
12738
|
const e = event.error;
|
|
@@ -12767,7 +12767,7 @@ class DashPlayback extends HTML5Video {
|
|
|
12767
12767
|
}
|
|
12768
12768
|
};
|
|
12769
12769
|
triggerError(error) {
|
|
12770
|
-
trace(`${T$
|
|
12770
|
+
trace(`${T$d} triggerError`, { error });
|
|
12771
12771
|
this.trigger(Events$1.PLAYBACK_ERROR, {
|
|
12772
12772
|
...error,
|
|
12773
12773
|
origin: this.name,
|
|
@@ -12807,7 +12807,7 @@ class DashPlayback extends HTML5Video {
|
|
|
12807
12807
|
}
|
|
12808
12808
|
get dvrEnabled() {
|
|
12809
12809
|
if (!this._dash) {
|
|
12810
|
-
trace(`${T$
|
|
12810
|
+
trace(`${T$d} dvrEnable no dash player instance`);
|
|
12811
12811
|
return false;
|
|
12812
12812
|
}
|
|
12813
12813
|
return (this._dash?.getDVRWindowSize() >= this._minDvrSize &&
|
|
@@ -12829,7 +12829,7 @@ class DashPlayback extends HTML5Video {
|
|
|
12829
12829
|
this.trigger(Events$1.PLAYBACK_PROGRESS, progress, {});
|
|
12830
12830
|
}
|
|
12831
12831
|
play() {
|
|
12832
|
-
trace(`${T$
|
|
12832
|
+
trace(`${T$d} play`, { dash: !!this._dash });
|
|
12833
12833
|
if (!this._dash) {
|
|
12834
12834
|
this._setup();
|
|
12835
12835
|
}
|
|
@@ -41566,7 +41566,7 @@ Hls.defaultConfig = undefined;
|
|
|
41566
41566
|
|
|
41567
41567
|
// assert(process.env.CLAPPR_VERSION, 'CLAPPR_VERSION is required');
|
|
41568
41568
|
// export const CLAPPR_VERSION: string = process.env.CLAPPR_VERSION || '0.11.3';
|
|
41569
|
-
const CLAPPR_VERSION
|
|
41569
|
+
const CLAPPR_VERSION = '0.11.3';
|
|
41570
41570
|
|
|
41571
41571
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
41572
41572
|
// Use of this source code is governed by a BSD-style
|
|
@@ -41576,7 +41576,7 @@ const AUTO$1 = -1;
|
|
|
41576
41576
|
const DEFAULT_RECOVER_ATTEMPTS = 16;
|
|
41577
41577
|
Events$1.register('PLAYBACK_FRAGMENT_CHANGED');
|
|
41578
41578
|
Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
|
|
41579
|
-
const T$
|
|
41579
|
+
const T$c = 'playback.hls';
|
|
41580
41580
|
// @ts-expect-error
|
|
41581
41581
|
class HlsPlayback extends HTML5Video {
|
|
41582
41582
|
_ccIsSetup = false;
|
|
@@ -41608,7 +41608,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
41608
41608
|
return 'hls';
|
|
41609
41609
|
}
|
|
41610
41610
|
get supportedVersion() {
|
|
41611
|
-
return { min: CLAPPR_VERSION
|
|
41611
|
+
return { min: CLAPPR_VERSION };
|
|
41612
41612
|
}
|
|
41613
41613
|
get levels() {
|
|
41614
41614
|
return this._levels || [];
|
|
@@ -41806,7 +41806,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
41806
41806
|
maxBufferLength: 2,
|
|
41807
41807
|
maxMaxBufferLength: 4,
|
|
41808
41808
|
}, this.options.playback.hlsjsConfig);
|
|
41809
|
-
trace(`${T$
|
|
41809
|
+
trace(`${T$c} _createHLSInstance`, { config });
|
|
41810
41810
|
this._hls = new Hls(config);
|
|
41811
41811
|
}
|
|
41812
41812
|
_attachHLSMedia() {
|
|
@@ -41895,7 +41895,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
41895
41895
|
}
|
|
41896
41896
|
else {
|
|
41897
41897
|
Log.error('hlsjs: failed to recover', { evt, data });
|
|
41898
|
-
trace(`${T$
|
|
41898
|
+
trace(`${T$c} _recover failed to recover`, {
|
|
41899
41899
|
type: data.type,
|
|
41900
41900
|
details: data.details,
|
|
41901
41901
|
});
|
|
@@ -41981,7 +41981,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
41981
41981
|
this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
|
|
41982
41982
|
}
|
|
41983
41983
|
_onHLSJSError(evt, data) {
|
|
41984
|
-
trace(`${T$
|
|
41984
|
+
trace(`${T$c} _onHLSJSError`, {
|
|
41985
41985
|
fatal: data.fatal,
|
|
41986
41986
|
type: data.type,
|
|
41987
41987
|
details: data.details,
|
|
@@ -42029,7 +42029,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
42029
42029
|
evt,
|
|
42030
42030
|
data,
|
|
42031
42031
|
});
|
|
42032
|
-
trace(`${T$
|
|
42032
|
+
trace(`${T$c} _onHLSJSError trying to recover from network error`, {
|
|
42033
42033
|
details: data.details,
|
|
42034
42034
|
});
|
|
42035
42035
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42042,7 +42042,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
42042
42042
|
evt,
|
|
42043
42043
|
data,
|
|
42044
42044
|
});
|
|
42045
|
-
trace(`${T$
|
|
42045
|
+
trace(`${T$c} _onHLSJSError trying to recover from media error`, {
|
|
42046
42046
|
details: data.details,
|
|
42047
42047
|
});
|
|
42048
42048
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42072,7 +42072,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
42072
42072
|
return;
|
|
42073
42073
|
}
|
|
42074
42074
|
Log.warn('hlsjs: non-fatal error occurred', { evt, data });
|
|
42075
|
-
trace(`${T$
|
|
42075
|
+
trace(`${T$c} _onHLSJSError non-fatal error occurred`, {
|
|
42076
42076
|
type: data.type,
|
|
42077
42077
|
details: data.details,
|
|
42078
42078
|
});
|
|
@@ -42400,7 +42400,7 @@ function registerPlaybacks() {
|
|
|
42400
42400
|
Loader.registerPlayback(DashPlayback);
|
|
42401
42401
|
}
|
|
42402
42402
|
|
|
42403
|
-
const T$
|
|
42403
|
+
const T$b = 'GPlayer';
|
|
42404
42404
|
const DEFAULT_OPTIONS = {
|
|
42405
42405
|
autoPlay: false,
|
|
42406
42406
|
debug: 'none',
|
|
@@ -42495,7 +42495,7 @@ class Player {
|
|
|
42495
42495
|
}
|
|
42496
42496
|
const coreOpts = this.buildCoreOptions(playerElement);
|
|
42497
42497
|
const { core, container } = Loader.registeredPlugins;
|
|
42498
|
-
trace(`${T$
|
|
42498
|
+
trace(`${T$b} init`, {
|
|
42499
42499
|
registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.name),
|
|
42500
42500
|
});
|
|
42501
42501
|
coreOpts.plugins = {
|
|
@@ -42509,7 +42509,7 @@ class Player {
|
|
|
42509
42509
|
* Destroys the player, releasing all resources and unmounting its UI from the DOM.
|
|
42510
42510
|
*/
|
|
42511
42511
|
destroy() {
|
|
42512
|
-
trace(`${T$
|
|
42512
|
+
trace(`${T$b} destroy`, {
|
|
42513
42513
|
player: !!this.player,
|
|
42514
42514
|
});
|
|
42515
42515
|
if (this.player) {
|
|
@@ -42669,8 +42669,10 @@ class Player {
|
|
|
42669
42669
|
this.config = $.extend(true, this.config, config);
|
|
42670
42670
|
}
|
|
42671
42671
|
initPlayer(coreOptions) {
|
|
42672
|
-
trace(`${T$
|
|
42673
|
-
|
|
42672
|
+
trace(`${T$b} initPlayer`, {
|
|
42673
|
+
autoPlay: coreOptions.autoPlay,
|
|
42674
|
+
sources: coreOptions.sources,
|
|
42675
|
+
// TODO selected options
|
|
42674
42676
|
});
|
|
42675
42677
|
assert.ok(!this.player, 'Player already initialized');
|
|
42676
42678
|
const player = new Player$1(coreOptions);
|
|
@@ -42682,12 +42684,7 @@ class Player {
|
|
|
42682
42684
|
this.bindContainerEventListeners();
|
|
42683
42685
|
this.player.core.on(Events$1.CORE_ACTIVE_CONTAINER_CHANGED, () => this.bindContainerEventListeners(), null);
|
|
42684
42686
|
if (this.config.autoPlay) {
|
|
42685
|
-
|
|
42686
|
-
setTimeout(() => {
|
|
42687
|
-
this.player?.play({
|
|
42688
|
-
autoPlay: true,
|
|
42689
|
-
});
|
|
42690
|
-
}, 0);
|
|
42687
|
+
this.triggerAutoPlay();
|
|
42691
42688
|
}
|
|
42692
42689
|
try {
|
|
42693
42690
|
this.emitter.emit(PlayerEvent.Ready);
|
|
@@ -42696,6 +42693,14 @@ class Player {
|
|
|
42696
42693
|
reportError(e);
|
|
42697
42694
|
}
|
|
42698
42695
|
}
|
|
42696
|
+
triggerAutoPlay() {
|
|
42697
|
+
trace(`${T$b} triggerAutoPlay`);
|
|
42698
|
+
setTimeout(() => {
|
|
42699
|
+
this.player?.play({
|
|
42700
|
+
autoPlay: true,
|
|
42701
|
+
});
|
|
42702
|
+
}, 0);
|
|
42703
|
+
}
|
|
42699
42704
|
safeTriggerEvent(event, ...args) {
|
|
42700
42705
|
try {
|
|
42701
42706
|
this.emitter.emit(event, ...args);
|
|
@@ -42707,7 +42712,7 @@ class Player {
|
|
|
42707
42712
|
// TODO test
|
|
42708
42713
|
events = {
|
|
42709
42714
|
onReady: () => {
|
|
42710
|
-
trace(`${T$
|
|
42715
|
+
trace(`${T$b} onReady`, {
|
|
42711
42716
|
ready: this.ready,
|
|
42712
42717
|
});
|
|
42713
42718
|
if (this.ready) {
|
|
@@ -42741,14 +42746,13 @@ class Player {
|
|
|
42741
42746
|
buildCoreOptions(rootNode) {
|
|
42742
42747
|
const sources = this.buildMediaSourcesList();
|
|
42743
42748
|
const source = sources[0];
|
|
42744
|
-
trace(`${T$
|
|
42749
|
+
trace(`${T$b} buildCoreOptions`, {
|
|
42745
42750
|
source,
|
|
42746
42751
|
sources,
|
|
42747
42752
|
});
|
|
42748
42753
|
this.rootNode = rootNode;
|
|
42749
42754
|
const coreOptions = $.extend(true, {
|
|
42750
42755
|
allowUserInteraction: true,
|
|
42751
|
-
autoPlay: false,
|
|
42752
42756
|
debug: 'none',
|
|
42753
42757
|
events: this.events,
|
|
42754
42758
|
height: rootNode.clientHeight,
|
|
@@ -42764,9 +42768,10 @@ class Player {
|
|
|
42764
42768
|
},
|
|
42765
42769
|
parent: rootNode,
|
|
42766
42770
|
width: rootNode.clientWidth,
|
|
42767
|
-
source: source ? source.source : undefined,
|
|
42768
|
-
mimeType: source ? source.mimeType : undefined,
|
|
42769
42771
|
}, this.config, {
|
|
42772
|
+
autoPlay: false,
|
|
42773
|
+
mimeType: source ? source.mimeType : undefined,
|
|
42774
|
+
source: source ? source.source : undefined,
|
|
42770
42775
|
sources,
|
|
42771
42776
|
});
|
|
42772
42777
|
return coreOptions;
|
|
@@ -42800,7 +42805,7 @@ class Player {
|
|
|
42800
42805
|
bindCoreListeners() {
|
|
42801
42806
|
const core = this.player?.core;
|
|
42802
42807
|
core?.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
|
|
42803
|
-
trace(`${T$
|
|
42808
|
+
trace(`${T$b} on CORE_SCREEN_ORIENTATION_CHANGED`, {
|
|
42804
42809
|
orientation,
|
|
42805
42810
|
rootNode: {
|
|
42806
42811
|
width: this.rootNode?.clientWidth,
|
|
@@ -42815,14 +42820,14 @@ class Player {
|
|
|
42815
42820
|
}
|
|
42816
42821
|
}, null);
|
|
42817
42822
|
core?.on(Events$1.CORE_RESIZE, ({ width, height }) => {
|
|
42818
|
-
trace(`${T$
|
|
42823
|
+
trace(`${T$b} on CORE_RESIZE`, {
|
|
42819
42824
|
width,
|
|
42820
42825
|
height,
|
|
42821
42826
|
});
|
|
42822
42827
|
this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
|
|
42823
42828
|
}, null);
|
|
42824
42829
|
core?.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
|
|
42825
|
-
trace(`${T$
|
|
42830
|
+
trace(`${T$b} CORE_FULLSCREEN`, {
|
|
42826
42831
|
isFullscreen,
|
|
42827
42832
|
});
|
|
42828
42833
|
this.safeTriggerEvent(PlayerEvent.Fullscreen, isFullscreen);
|
|
@@ -42830,7 +42835,7 @@ class Player {
|
|
|
42830
42835
|
}
|
|
42831
42836
|
}
|
|
42832
42837
|
|
|
42833
|
-
var version$1 = "2.19.
|
|
42838
|
+
var version$1 = "2.19.13";
|
|
42834
42839
|
|
|
42835
42840
|
var packages = {
|
|
42836
42841
|
"node_modules/@clappr/core": {
|
|
@@ -42854,8 +42859,6 @@ function version() {
|
|
|
42854
42859
|
};
|
|
42855
42860
|
}
|
|
42856
42861
|
|
|
42857
|
-
const CLAPPR_VERSION = '0.11.3';
|
|
42858
|
-
|
|
42859
42862
|
const pluginHtml$8 = "<button data-track-selector-button class='gcore-skin-button-color'>\n <span class='audio-text'><%= title %></span> <span class=\"audio-arrow\"></span>\n</button>\n<ul class='gcore-skin-bg-color'>\n <% for (var i = 0; i < tracks.length; i++) { %>\n <li>\n <a href=\"#\" class='gcore-skin-text-color' data-track-selector-select=\"<%= tracks[i].id %>\">\n <%= tracks[i].label || tracks[i].name %>\n </a>\n </li>\n <% }; %>\n</ul>\n";
|
|
42860
42863
|
|
|
42861
42864
|
const audioArrow = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg width=\"9px\" height=\"6px\" viewBox=\"0 0 9 6\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <!-- Generator: Sketch 49 (51002) - http://www.bohemiancoding.com/sketch -->\n <title>quality-arrow</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id=\"quality-arrow\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <path\n d=\"M5.07079194,5.78553848 C4.91457318,5.94277844 4.70551573,6.00941824 4.50028717,5.99893557 C4.2950586,6.00941824 4.08676693,5.94277844 3.92978239,5.78553848 L0.221118462,1.2997069 C-0.0737061539,1.00469478 -0.0737061539,0.526236029 0.221118462,0.231972666 C0.515177299,-0.0630394586 1.23500883,0.00734414472 1.64852907,0.00734414472 L7.77475484,0.00734414472 C8.21201421,0.00734414472 8.48539703,-0.0630394586 8.77945587,0.231972666 C9.07351471,0.526236029 9.07351471,1.00469478 8.77945587,1.2997069 L5.07079194,5.78553848 Z\"\n fill=\"#FFFFFE\"></path>\n </g>\n</svg>\n";
|
|
@@ -42871,7 +42874,7 @@ class AudioSelector extends UICorePlugin {
|
|
|
42871
42874
|
currentTrack = null;
|
|
42872
42875
|
tracks = [];
|
|
42873
42876
|
get name() {
|
|
42874
|
-
return '
|
|
42877
|
+
return 'media_control_audio_selector';
|
|
42875
42878
|
}
|
|
42876
42879
|
get supportedVersion() {
|
|
42877
42880
|
return { min: CLAPPR_VERSION };
|
|
@@ -43138,7 +43141,7 @@ const volumeOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
|
|
|
43138
43141
|
|
|
43139
43142
|
const pluginHtml$7 = "<div class=\"big-mute-icon-wrapper\" data-big-mute>\n <div class=\"big-mute-icon gcore-skin-border-color\" data-big-mute-icon></div>\n</div>\n";
|
|
43140
43143
|
|
|
43141
|
-
const T$
|
|
43144
|
+
const T$a = "plugins.big_mute_button";
|
|
43142
43145
|
/**
|
|
43143
43146
|
* @beta
|
|
43144
43147
|
*/
|
|
@@ -43167,7 +43170,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43167
43170
|
this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
43168
43171
|
this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
|
|
43169
43172
|
this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
|
|
43170
|
-
trace(`${T$
|
|
43173
|
+
trace(`${T$a} bindEvents`, {
|
|
43171
43174
|
mediacontrol: !!this.core.mediaControl,
|
|
43172
43175
|
});
|
|
43173
43176
|
this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
|
|
@@ -43203,12 +43206,12 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43203
43206
|
}
|
|
43204
43207
|
mediaControlRendered() {
|
|
43205
43208
|
const container = this.core.activeContainer;
|
|
43206
|
-
trace(`${T$
|
|
43209
|
+
trace(`${T$a} mediaControlRendered`, {
|
|
43207
43210
|
container: !!container,
|
|
43208
43211
|
});
|
|
43209
43212
|
if (container) {
|
|
43210
43213
|
this.listenTo(container.playback, Events$1.PLAYBACK_PLAY, () => {
|
|
43211
|
-
trace(`${T$
|
|
43214
|
+
trace(`${T$a} PLAYBACK_PLAY`);
|
|
43212
43215
|
this.render();
|
|
43213
43216
|
});
|
|
43214
43217
|
}
|
|
@@ -43232,7 +43235,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43232
43235
|
}
|
|
43233
43236
|
const { autoPlay, wasMuted } = this.options;
|
|
43234
43237
|
const volume = container.volume;
|
|
43235
|
-
trace(`${T$
|
|
43238
|
+
trace(`${T$a} shouldRender`, {
|
|
43236
43239
|
autoPlay,
|
|
43237
43240
|
wasMuted,
|
|
43238
43241
|
volume,
|
|
@@ -43241,7 +43244,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43241
43244
|
}
|
|
43242
43245
|
render() {
|
|
43243
43246
|
if (this.shouldRender()) {
|
|
43244
|
-
trace(`${T$
|
|
43247
|
+
trace(`${T$a} render`, {
|
|
43245
43248
|
el: !!this.$el,
|
|
43246
43249
|
});
|
|
43247
43250
|
this.$el.html(this.template());
|
|
@@ -43274,6 +43277,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43274
43277
|
handleBigMuteBtnClick(e) {
|
|
43275
43278
|
const localVolume = Utils.Config.restore('volume');
|
|
43276
43279
|
const volume = !isNaN(localVolume) ? localVolume : 100;
|
|
43280
|
+
// TODO use container.setVolume() instead
|
|
43277
43281
|
this.core.mediaControl.setVolume(volume === 0 ? 100 : volume);
|
|
43278
43282
|
this.destroyBigMuteBtn(e);
|
|
43279
43283
|
}
|
|
@@ -43285,65 +43289,71 @@ const gearIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"n
|
|
|
43285
43289
|
|
|
43286
43290
|
const gearHdIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_28_1567)\">\n <path\n d=\"M19.14 12.94C19.18 12.64 19.2 12.33 19.2 12C19.2 11.68 19.18 11.36 19.13 11.06L21.16 9.47999C21.34 9.33999 21.39 9.06999 21.28 8.86999L19.36 5.54999C19.24 5.32999 18.99 5.25999 18.77 5.32999L16.38 6.28999C15.88 5.90999 15.35 5.58999 14.76 5.34999L14.4 2.80999C14.36 2.56999 14.16 2.39999 13.92 2.39999H10.08C9.83999 2.39999 9.64999 2.56999 9.60999 2.80999L9.24999 5.34999C8.65999 5.58999 8.11999 5.91999 7.62999 6.28999L5.23999 5.32999C5.01999 5.24999 4.76999 5.32999 4.64999 5.54999L2.73999 8.86999C2.61999 9.07999 2.65999 9.33999 2.85999 9.47999L4.88999 11.06C4.83999 11.36 4.79999 11.69 4.79999 12C4.79999 12.31 4.81999 12.64 4.86999 12.94L2.83999 14.52C2.65999 14.66 2.60999 14.93 2.71999 15.13L4.63999 18.45C4.75999 18.67 5.00999 18.74 5.22999 18.67L7.61999 17.71C8.11999 18.09 8.64999 18.41 9.23999 18.65L9.59999 21.19C9.64999 21.43 9.83999 21.6 10.08 21.6H13.92C14.16 21.6 14.36 21.43 14.39 21.19L14.75 18.65C15.34 18.41 15.88 18.09 16.37 17.71L18.76 18.67C18.98 18.75 19.23 18.67 19.35 18.45L21.27 15.13C21.39 14.91 21.34 14.66 21.15 14.52L19.14 12.94ZM12 15.6C10.02 15.6 8.39999 13.98 8.39999 12C8.39999 10.02 10.02 8.39999 12 8.39999C13.98 8.39999 15.6 10.02 15.6 12C15.6 13.98 13.98 15.6 12 15.6Z\"\n fill=\"#C9C9C9\"/>\n <rect x=\"13\" width=\"11\" height=\"7\" rx=\"1\" fill=\"#F6413B\"/>\n <path\n d=\"M14.6962 6V1.63636H15.3546V3.53267H17.53V1.63636H18.1905V6H17.53V4.0973H15.3546V6H14.6962ZM20.562 6H19.1493V1.63636H20.6067C21.0343 1.63636 21.4015 1.72372 21.7083 1.89844C22.0151 2.07173 22.2502 2.32102 22.4135 2.64631C22.5783 2.97017 22.6607 3.35866 22.6607 3.81179C22.6607 4.26634 22.5776 4.65696 22.4114 4.98366C22.2466 5.31037 22.008 5.56179 21.6955 5.73793C21.383 5.91264 21.0051 6 20.562 6ZM19.8077 5.42472H20.5257C20.8581 5.42472 21.1344 5.36222 21.3546 5.23722C21.5748 5.1108 21.7395 4.92827 21.8489 4.68963C21.9583 4.44957 22.013 4.15696 22.013 3.81179C22.013 3.46946 21.9583 3.17898 21.8489 2.94034C21.7409 2.7017 21.5797 2.5206 21.3652 2.39702C21.1507 2.27344 20.8844 2.21165 20.5662 2.21165H19.8077V5.42472Z\"\n fill=\"#C9C9C9\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_28_1567\">\n <rect width=\"24\" height=\"24\" fill=\"white\"/>\n </clipPath>\n </defs>\n</svg>\n";
|
|
43287
43291
|
|
|
43288
|
-
const VERSION$5 = '
|
|
43292
|
+
const VERSION$5 = '2.19.12';
|
|
43293
|
+
const T$9 = 'plugins.media_control_gear';
|
|
43289
43294
|
/**
|
|
43295
|
+
* Adds the gear button that triggers extra options menu on the right side of the {@link MediaControl | media control} UI
|
|
43290
43296
|
* @beta
|
|
43297
|
+
* @remarks
|
|
43298
|
+
* The plugins provides a base for attaching custom settings UI in the gear menu
|
|
43291
43299
|
*/
|
|
43292
43300
|
class BottomGear extends UICorePlugin {
|
|
43293
43301
|
isHd = false;
|
|
43302
|
+
/**
|
|
43303
|
+
* @internal
|
|
43304
|
+
*/
|
|
43294
43305
|
get name() {
|
|
43295
|
-
return '
|
|
43306
|
+
return 'media_control_gear';
|
|
43296
43307
|
}
|
|
43308
|
+
/**
|
|
43309
|
+
* @internal
|
|
43310
|
+
*/
|
|
43297
43311
|
get supportedVersion() {
|
|
43298
43312
|
return { min: CLAPPR_VERSION };
|
|
43299
43313
|
}
|
|
43314
|
+
/**
|
|
43315
|
+
* @internal
|
|
43316
|
+
*/
|
|
43300
43317
|
static get version() {
|
|
43301
43318
|
return VERSION$5;
|
|
43302
43319
|
}
|
|
43303
|
-
|
|
43304
|
-
|
|
43305
|
-
|
|
43320
|
+
static template = tmpl(pluginHtml$6);
|
|
43321
|
+
/**
|
|
43322
|
+
* @internal
|
|
43323
|
+
*/
|
|
43306
43324
|
get attributes() {
|
|
43307
43325
|
return {
|
|
43308
43326
|
'class': this.name,
|
|
43309
43327
|
'data-track-selector': ''
|
|
43310
43328
|
};
|
|
43311
43329
|
}
|
|
43330
|
+
/**
|
|
43331
|
+
* @internal
|
|
43332
|
+
*/
|
|
43312
43333
|
get events() {
|
|
43313
43334
|
return {
|
|
43314
43335
|
'click .button-gear': 'toggleGearMenu',
|
|
43315
43336
|
};
|
|
43316
43337
|
}
|
|
43317
|
-
|
|
43318
|
-
|
|
43319
|
-
|
|
43338
|
+
/**
|
|
43339
|
+
* @internal
|
|
43340
|
+
*/
|
|
43320
43341
|
bindEvents() {
|
|
43342
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
43343
|
+
assert(mediaControl, 'media_control plugin is required');
|
|
43321
43344
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
43322
|
-
this.listenTo(this.core, 'gear:refresh', this.refresh);
|
|
43323
|
-
this.listenTo(
|
|
43324
|
-
this.listenTo(
|
|
43325
|
-
this.listenTo(
|
|
43345
|
+
this.listenTo(this.core, 'gear:refresh', this.refresh); // TODO use direct plugin method call
|
|
43346
|
+
// this.listenTo(mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.reload);
|
|
43347
|
+
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.render);
|
|
43348
|
+
this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.hide); // TODO mediacontrol show as well
|
|
43326
43349
|
this.bindContainerEvents();
|
|
43327
43350
|
}
|
|
43328
|
-
unBindEvents() {
|
|
43329
|
-
this.stopListening(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
43330
|
-
this.stopListening(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this.reload);
|
|
43331
|
-
this.stopListening(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.render);
|
|
43332
|
-
this.stopListening(this.core.mediaControl, Events$1.MEDIACONTROL_HIDE, this.hide);
|
|
43333
|
-
}
|
|
43334
43351
|
onActiveContainerChanged() {
|
|
43335
|
-
this.bindEvents();
|
|
43336
43352
|
this.bindContainerEvents();
|
|
43337
43353
|
}
|
|
43338
43354
|
bindContainerEvents() {
|
|
43339
|
-
|
|
43340
|
-
|
|
43341
|
-
}
|
|
43342
|
-
this.listenTo(this.container, Events$1.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
|
|
43343
|
-
}
|
|
43344
|
-
reload() {
|
|
43345
|
-
this.unBindEvents();
|
|
43346
|
-
this.bindEvents();
|
|
43355
|
+
trace(`${T$9} bindContainerEvents`);
|
|
43356
|
+
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
|
|
43347
43357
|
}
|
|
43348
43358
|
highDefinitionUpdate(isHd) {
|
|
43349
43359
|
trace(`${this.name} highDefinitionUpdate`, { isHd });
|
|
@@ -43355,16 +43365,22 @@ class BottomGear extends UICorePlugin {
|
|
|
43355
43365
|
this.$el.find('.gear-icon').html(gearIcon);
|
|
43356
43366
|
}
|
|
43357
43367
|
}
|
|
43368
|
+
/**
|
|
43369
|
+
* @internal
|
|
43370
|
+
*/
|
|
43358
43371
|
render() {
|
|
43372
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
43373
|
+
assert(mediaControl, 'media_control plugin is required');
|
|
43374
|
+
// TODO use options.mediaControl.gear.items
|
|
43359
43375
|
const items = [
|
|
43360
43376
|
'quality',
|
|
43361
43377
|
'rate',
|
|
43362
43378
|
'nerd',
|
|
43363
43379
|
];
|
|
43364
43380
|
const icon = this.isHd ? gearHdIcon : gearIcon;
|
|
43365
|
-
this.$el.html(
|
|
43366
|
-
|
|
43367
|
-
this.core.trigger('gear:rendered');
|
|
43381
|
+
this.$el.html(BottomGear.template({ icon, items }));
|
|
43382
|
+
mediaControl.getElement('bottomGear')?.html(this.el);
|
|
43383
|
+
this.core.trigger('gear:rendered'); // TODO trigger on mediaControl instead
|
|
43368
43384
|
return this;
|
|
43369
43385
|
}
|
|
43370
43386
|
refresh() {
|
|
@@ -45533,7 +45549,7 @@ class ClapprNerdStats extends UICorePlugin {
|
|
|
45533
45549
|
shortcut;
|
|
45534
45550
|
iconPosition;
|
|
45535
45551
|
get name() {
|
|
45536
|
-
return '
|
|
45552
|
+
return 'media_control_nerd_stats';
|
|
45537
45553
|
}
|
|
45538
45554
|
get supportedVersion() {
|
|
45539
45555
|
return { min: CLAPPR_VERSION };
|
|
@@ -45579,6 +45595,7 @@ class ClapprNerdStats extends UICorePlugin {
|
|
|
45579
45595
|
}
|
|
45580
45596
|
bindEvents() {
|
|
45581
45597
|
this.listenToOnce(this.core, Events$1.CORE_READY, this.init);
|
|
45598
|
+
// TODO trigger on mediaControl instead
|
|
45582
45599
|
this.listenTo(this.core, 'gear:rendered', this.addToBottomGear);
|
|
45583
45600
|
}
|
|
45584
45601
|
init() {
|
|
@@ -46205,7 +46222,7 @@ class ClipsPlugin extends UICorePlugin {
|
|
|
46205
46222
|
_oldContainer;
|
|
46206
46223
|
svgMask = null;
|
|
46207
46224
|
get name() {
|
|
46208
|
-
return '
|
|
46225
|
+
return 'media_control_clips';
|
|
46209
46226
|
}
|
|
46210
46227
|
get attributes() {
|
|
46211
46228
|
return {
|
|
@@ -46305,7 +46322,7 @@ class ClipsPlugin extends UICorePlugin {
|
|
|
46305
46322
|
this.setSVGMask(svg);
|
|
46306
46323
|
}
|
|
46307
46324
|
setSVGMask(svg) {
|
|
46308
|
-
this.core.mediaControl.setSVGMask(svg);
|
|
46325
|
+
// this.core.mediaControl.setSVGMask(svg);
|
|
46309
46326
|
if (this.svgMask) {
|
|
46310
46327
|
this.svgMask.remove();
|
|
46311
46328
|
}
|
|
@@ -46494,21 +46511,39 @@ class DisableControls extends UICorePlugin {
|
|
|
46494
46511
|
|
|
46495
46512
|
const dvrHTML = "<div class=\"live-info\"><%= live %></div>\n<button type=\"button\" class=\"live-button\" aria-label=\"<%= backToLive %>\"><%= backToLive %></button>\n";
|
|
46496
46513
|
|
|
46514
|
+
/**
|
|
46515
|
+
* Adds the DVR controls to the media control UI
|
|
46516
|
+
* @beta
|
|
46517
|
+
*
|
|
46518
|
+
* @remarks
|
|
46519
|
+
* The plugin is rendered in the {@link MediaControl | media control} UI.
|
|
46520
|
+
* It renders the live stream indicator and the DVR seek bar if DVR is enabled.
|
|
46521
|
+
*/
|
|
46497
46522
|
class DvrControls extends UICorePlugin {
|
|
46498
|
-
|
|
46499
|
-
|
|
46500
|
-
|
|
46523
|
+
static template = tmpl(dvrHTML);
|
|
46524
|
+
/**
|
|
46525
|
+
* @internal
|
|
46526
|
+
*/
|
|
46501
46527
|
get name() {
|
|
46502
|
-
return '
|
|
46528
|
+
return 'media_control_dvr';
|
|
46503
46529
|
}
|
|
46530
|
+
/**
|
|
46531
|
+
* @internal
|
|
46532
|
+
*/
|
|
46504
46533
|
get supportedVersion() {
|
|
46505
46534
|
return { min: CLAPPR_VERSION };
|
|
46506
46535
|
}
|
|
46536
|
+
/**
|
|
46537
|
+
* @internal
|
|
46538
|
+
*/
|
|
46507
46539
|
get events() {
|
|
46508
46540
|
return {
|
|
46509
46541
|
'click .live-button': 'click'
|
|
46510
46542
|
};
|
|
46511
46543
|
}
|
|
46544
|
+
/**
|
|
46545
|
+
* @internal
|
|
46546
|
+
*/
|
|
46512
46547
|
get attributes() {
|
|
46513
46548
|
return {
|
|
46514
46549
|
'class': 'dvr-controls',
|
|
@@ -46519,6 +46554,9 @@ class DvrControls extends UICorePlugin {
|
|
|
46519
46554
|
super(core);
|
|
46520
46555
|
this.settingsUpdate();
|
|
46521
46556
|
}
|
|
46557
|
+
/**
|
|
46558
|
+
* @internal
|
|
46559
|
+
*/
|
|
46522
46560
|
bindEvents() {
|
|
46523
46561
|
this.bindCoreEvents();
|
|
46524
46562
|
this.bindContainerEvents();
|
|
@@ -46566,8 +46604,8 @@ class DvrControls extends UICorePlugin {
|
|
|
46566
46604
|
}
|
|
46567
46605
|
}
|
|
46568
46606
|
click() {
|
|
46569
|
-
const mediaControl = this.core.
|
|
46570
|
-
const container =
|
|
46607
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
46608
|
+
const container = this.core.activeContainer;
|
|
46571
46609
|
if (!container.isPlaying()) {
|
|
46572
46610
|
container.play();
|
|
46573
46611
|
}
|
|
@@ -46577,7 +46615,7 @@ class DvrControls extends UICorePlugin {
|
|
|
46577
46615
|
}
|
|
46578
46616
|
settingsUpdate() {
|
|
46579
46617
|
// @ts-ignore
|
|
46580
|
-
this.stopListening();
|
|
46618
|
+
this.stopListening(); // TODO sort out
|
|
46581
46619
|
this.core.mediaControl.$el.removeClass('live');
|
|
46582
46620
|
if (this.shouldRender()) {
|
|
46583
46621
|
this.render();
|
|
@@ -46589,14 +46627,20 @@ class DvrControls extends UICorePlugin {
|
|
|
46589
46627
|
const useDvrControls = this.core.options.useDvrControls === undefined || !!this.core.options.useDvrControls;
|
|
46590
46628
|
return useDvrControls && this.core.getPlaybackType() === Playback.LIVE;
|
|
46591
46629
|
}
|
|
46630
|
+
/**
|
|
46631
|
+
* @internal
|
|
46632
|
+
*/
|
|
46592
46633
|
render() {
|
|
46593
|
-
this.$el.html(
|
|
46634
|
+
this.$el.html(DvrControls.template({
|
|
46594
46635
|
live: this.core.i18n.t('live'),
|
|
46595
46636
|
backToLive: this.core.i18n.t('back_to_live')
|
|
46596
46637
|
}));
|
|
46597
46638
|
if (this.shouldRender()) {
|
|
46598
|
-
this.core.mediaControl
|
|
46599
|
-
|
|
46639
|
+
const mediaControl = this.core.mediaControl;
|
|
46640
|
+
assert(mediaControl, 'media_control plugin is required');
|
|
46641
|
+
// TODO don't tap into the $el directly
|
|
46642
|
+
mediaControl.$el.addClass('live');
|
|
46643
|
+
mediaControl.$('.media-control-left-panel[data-media-control]').append(this.$el);
|
|
46600
46644
|
}
|
|
46601
46645
|
return this;
|
|
46602
46646
|
}
|
|
@@ -46762,6 +46806,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
46762
46806
|
if (err) {
|
|
46763
46807
|
this.err = err;
|
|
46764
46808
|
}
|
|
46809
|
+
// TODO use container.disableMediaControl() instead
|
|
46765
46810
|
this.core.mediaControl.disable();
|
|
46766
46811
|
this.render();
|
|
46767
46812
|
this.$el.show();
|
|
@@ -47211,29 +47256,30 @@ const arrowLeftIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
|
|
|
47211
47256
|
|
|
47212
47257
|
const checkIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M20.5793 4.19296C20.1216 3.86696 19.4777 3.96396 19.1424 4.40896L9.37295 17.3809L4.81634 12.107C4.45222 11.683 3.80218 11.6289 3.36709 11.9839C2.932 12.3389 2.87543 12.97 3.2416 13.393L8.64165 19.643C8.83708 19.869 9.12506 20 9.42849 20C9.4398 20 9.45114 20 9.46246 19.999C9.77926 19.989 10.0724 19.838 10.2586 19.59L20.8015 5.58996C21.1368 5.14496 21.0371 4.51896 20.5793 4.19296Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
|
|
47213
47258
|
|
|
47214
|
-
const T$6 = 'plugins.
|
|
47259
|
+
const T$6 = 'plugins.media_control_level_selector';
|
|
47215
47260
|
const VERSION$4 = '2.19.4';
|
|
47216
47261
|
/**
|
|
47217
|
-
*
|
|
47262
|
+
* A {@link MediaControl | media control} plugin that provides a UI to control the quality level of the playback.
|
|
47218
47263
|
* @beta
|
|
47219
47264
|
*
|
|
47220
47265
|
* @remarks
|
|
47221
|
-
* The plugin is rendered as a button in the gear menu.
|
|
47266
|
+
* The plugin is rendered as a button in the {@link BottomGear | gear menu}.
|
|
47222
47267
|
* When clicked, it shows a list of quality levels to choose from.
|
|
47223
47268
|
*
|
|
47224
47269
|
* Configuration options:
|
|
47225
47270
|
*
|
|
47226
|
-
* - `labels`: The labels to show in the level selector. [
|
|
47271
|
+
* - `labels`: The labels to show in the level selector. [video resolution]: string
|
|
47272
|
+
*
|
|
47227
47273
|
* - `restrictResolution`: The maximum resolution to allow in the level selector.
|
|
47228
47274
|
*
|
|
47229
47275
|
* @example
|
|
47230
47276
|
* ```ts
|
|
47231
|
-
* {
|
|
47277
|
+
* new Player({
|
|
47232
47278
|
* levelSelector: {
|
|
47233
47279
|
* restrictResolution: 360,
|
|
47234
|
-
* labels: { 360: '
|
|
47280
|
+
* labels: { 360: 'SD', 720: 'HD' },
|
|
47235
47281
|
* },
|
|
47236
|
-
* }
|
|
47282
|
+
* })
|
|
47237
47283
|
* ```
|
|
47238
47284
|
*/
|
|
47239
47285
|
class LevelSelector extends UICorePlugin {
|
|
@@ -47244,15 +47290,27 @@ class LevelSelector extends UICorePlugin {
|
|
|
47244
47290
|
isOpen = false;
|
|
47245
47291
|
buttonTemplate = null;
|
|
47246
47292
|
listTemplate = null;
|
|
47293
|
+
/**
|
|
47294
|
+
* @internal
|
|
47295
|
+
*/
|
|
47247
47296
|
get name() {
|
|
47248
|
-
return '
|
|
47297
|
+
return 'media_control_level_selector';
|
|
47249
47298
|
}
|
|
47299
|
+
/**
|
|
47300
|
+
* @internal
|
|
47301
|
+
*/
|
|
47250
47302
|
get supportedVersion() {
|
|
47251
47303
|
return { min: CLAPPR_VERSION };
|
|
47252
47304
|
}
|
|
47305
|
+
/**
|
|
47306
|
+
* @internal
|
|
47307
|
+
*/
|
|
47253
47308
|
static get version() {
|
|
47254
47309
|
return VERSION$4;
|
|
47255
47310
|
}
|
|
47311
|
+
/**
|
|
47312
|
+
* @internal
|
|
47313
|
+
*/
|
|
47256
47314
|
get attributes() {
|
|
47257
47315
|
return {
|
|
47258
47316
|
class: this.name,
|
|
@@ -47268,6 +47326,9 @@ class LevelSelector extends UICorePlugin {
|
|
|
47268
47326
|
'click .go-back': 'goBack',
|
|
47269
47327
|
};
|
|
47270
47328
|
}
|
|
47329
|
+
/**
|
|
47330
|
+
* @internal
|
|
47331
|
+
*/
|
|
47271
47332
|
bindEvents() {
|
|
47272
47333
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, () => this.bindPlaybackEvents());
|
|
47273
47334
|
this.listenTo(this.core, 'gear:rendered', this.render);
|
|
@@ -47316,6 +47377,9 @@ class LevelSelector extends UICorePlugin {
|
|
|
47316
47377
|
// Only care if we have at least 2 to choose from
|
|
47317
47378
|
return !!(this.levels && this.levels.length > 1);
|
|
47318
47379
|
}
|
|
47380
|
+
/**
|
|
47381
|
+
* @internal
|
|
47382
|
+
*/
|
|
47319
47383
|
render() {
|
|
47320
47384
|
if (!this.shouldRender()) {
|
|
47321
47385
|
return this;
|
|
@@ -47335,9 +47399,10 @@ class LevelSelector extends UICorePlugin {
|
|
|
47335
47399
|
hdIcon,
|
|
47336
47400
|
});
|
|
47337
47401
|
this.$el.html(html);
|
|
47338
|
-
this.core.
|
|
47402
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
47403
|
+
mediaControl.getElement('bottomGear')
|
|
47339
47404
|
?.find('.gear-options-list [data-quality]')
|
|
47340
|
-
|
|
47405
|
+
?.html(this.el);
|
|
47341
47406
|
}
|
|
47342
47407
|
}
|
|
47343
47408
|
renderDropdown() {
|
|
@@ -47353,7 +47418,8 @@ class LevelSelector extends UICorePlugin {
|
|
|
47353
47418
|
removeAuto: this.removeAuto,
|
|
47354
47419
|
});
|
|
47355
47420
|
this.$el.html(html);
|
|
47356
|
-
this.core.
|
|
47421
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
47422
|
+
mediaControl.getElement('bottomGear')?.find('.gear-wrapper').html(this.el);
|
|
47357
47423
|
}
|
|
47358
47424
|
get maxLevel() {
|
|
47359
47425
|
const maxRes = this.core.options.levelSelector?.restrictResolution;
|
|
@@ -47719,11 +47785,17 @@ function orderByOrderPattern(arr, order) {
|
|
|
47719
47785
|
return [...ordered, ...rest];
|
|
47720
47786
|
}
|
|
47721
47787
|
/**
|
|
47722
|
-
* The MediaControl
|
|
47788
|
+
* The MediaControl provides a foundation for developing custom media controls UI.
|
|
47723
47789
|
* @beta
|
|
47724
47790
|
* @remarks
|
|
47725
|
-
* This plugin provides a foundation for developing a media controls UI via additional plugins.
|
|
47726
47791
|
* The methods exposed are to be used by the other plugins that extend the media control UI.
|
|
47792
|
+
* The plugin registration should be arranged so that MediaControl is initialized before every other plugin that depends on it.
|
|
47793
|
+
* @example
|
|
47794
|
+
* ```ts
|
|
47795
|
+
* Player.registerPlugin(MediaControl) // <--- This must go first
|
|
47796
|
+
* Player.registerPlugin(LevelSelector) // a media control plugin
|
|
47797
|
+
* Player.registerPlugin(NerdStats) // another media control plugin
|
|
47798
|
+
* ```
|
|
47727
47799
|
*/
|
|
47728
47800
|
class MediaControl extends UICorePlugin {
|
|
47729
47801
|
advertisementPlaying = false;
|
|
@@ -47749,7 +47821,6 @@ class MediaControl extends UICorePlugin {
|
|
|
47749
47821
|
persistConfig;
|
|
47750
47822
|
rendered = false;
|
|
47751
47823
|
settings = {};
|
|
47752
|
-
svgMask = null;
|
|
47753
47824
|
userDisabled = false;
|
|
47754
47825
|
userKeepVisible = false;
|
|
47755
47826
|
verticalVolume = false;
|
|
@@ -47778,9 +47849,15 @@ class MediaControl extends UICorePlugin {
|
|
|
47778
47849
|
$volumeContainer = null;
|
|
47779
47850
|
$volumeIcon = null;
|
|
47780
47851
|
static template = tmpl(mediaControlHTML);
|
|
47852
|
+
/**
|
|
47853
|
+
* @internal
|
|
47854
|
+
*/
|
|
47781
47855
|
get name() {
|
|
47782
47856
|
return 'media_control';
|
|
47783
47857
|
}
|
|
47858
|
+
/**
|
|
47859
|
+
* @internal
|
|
47860
|
+
*/
|
|
47784
47861
|
get supportedVersion() {
|
|
47785
47862
|
return { min: CLAPPR_VERSION };
|
|
47786
47863
|
}
|
|
@@ -47788,18 +47865,32 @@ class MediaControl extends UICorePlugin {
|
|
|
47788
47865
|
const playbackIsNOOP = this.container && this.container.getPlaybackType() === Playback.NO_OP;
|
|
47789
47866
|
return this.userDisabled || playbackIsNOOP;
|
|
47790
47867
|
}
|
|
47868
|
+
/**
|
|
47869
|
+
* @internal
|
|
47870
|
+
* @deprecated
|
|
47871
|
+
*/
|
|
47791
47872
|
get container() {
|
|
47792
47873
|
return this.core && this.core.activeContainer;
|
|
47793
47874
|
}
|
|
47875
|
+
/**
|
|
47876
|
+
* @internal
|
|
47877
|
+
* @deprecated
|
|
47878
|
+
*/
|
|
47794
47879
|
get playback() {
|
|
47795
47880
|
return this.core && this.core.activePlayback;
|
|
47796
47881
|
}
|
|
47882
|
+
/**
|
|
47883
|
+
* @internal
|
|
47884
|
+
*/
|
|
47797
47885
|
get attributes() {
|
|
47798
47886
|
return {
|
|
47799
47887
|
class: 'media-control-skin-1',
|
|
47800
47888
|
'data-media-control-skin-1': '',
|
|
47801
47889
|
};
|
|
47802
47890
|
}
|
|
47891
|
+
/**
|
|
47892
|
+
* @internal
|
|
47893
|
+
*/
|
|
47803
47894
|
get events() {
|
|
47804
47895
|
return {
|
|
47805
47896
|
'click [data-play]': 'play',
|
|
@@ -47830,11 +47921,11 @@ class MediaControl extends UICorePlugin {
|
|
|
47830
47921
|
};
|
|
47831
47922
|
}
|
|
47832
47923
|
/**
|
|
47833
|
-
* Current volume
|
|
47924
|
+
* Current volume [0..100]
|
|
47834
47925
|
*/
|
|
47835
47926
|
get volume() {
|
|
47836
|
-
return this.
|
|
47837
|
-
? this.
|
|
47927
|
+
return this.core.activeContainer.isReady
|
|
47928
|
+
? this.core.activeContainer.volume
|
|
47838
47929
|
: this.intendedVolume;
|
|
47839
47930
|
}
|
|
47840
47931
|
/**
|
|
@@ -47850,7 +47941,7 @@ class MediaControl extends UICorePlugin {
|
|
|
47850
47941
|
this.kibo = new Kibo(this.options.focusElement);
|
|
47851
47942
|
this.bindKeyEvents();
|
|
47852
47943
|
this.userDisabled = false;
|
|
47853
|
-
if (
|
|
47944
|
+
if (this.core.activeContainer.mediaControlDisabled ||
|
|
47854
47945
|
this.options.chromeless) {
|
|
47855
47946
|
this.disable();
|
|
47856
47947
|
}
|
|
@@ -47859,12 +47950,18 @@ class MediaControl extends UICorePlugin {
|
|
|
47859
47950
|
$(document).bind('touchend', this.stopDrag);
|
|
47860
47951
|
$(document).bind('touchmove', this.updateDrag);
|
|
47861
47952
|
}
|
|
47953
|
+
/**
|
|
47954
|
+
* @internal
|
|
47955
|
+
*/
|
|
47862
47956
|
getExternalInterface() {
|
|
47863
47957
|
return {
|
|
47864
47958
|
setVolume: this.setVolume,
|
|
47865
47959
|
getVolume: () => this.volume,
|
|
47866
47960
|
};
|
|
47867
47961
|
}
|
|
47962
|
+
/**
|
|
47963
|
+
* @internal
|
|
47964
|
+
*/
|
|
47868
47965
|
bindEvents() {
|
|
47869
47966
|
// @ts-ignore
|
|
47870
47967
|
this.stopListening();
|
|
@@ -47920,12 +48017,18 @@ class MediaControl extends UICorePlugin {
|
|
|
47920
48017
|
this.listenToOnce(this.container, Events$1.CONTAINER_LOADEDMETADATA, this.onLoadedMetadataOnVideoTag);
|
|
47921
48018
|
}
|
|
47922
48019
|
}
|
|
48020
|
+
/**
|
|
48021
|
+
* Disables the plugin and unmounts its UI
|
|
48022
|
+
*/
|
|
47923
48023
|
disable() {
|
|
47924
48024
|
this.userDisabled = true;
|
|
47925
48025
|
this.hide();
|
|
47926
48026
|
this.unbindKeyEvents();
|
|
47927
48027
|
this.$el.hide();
|
|
47928
48028
|
}
|
|
48029
|
+
/**
|
|
48030
|
+
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
48031
|
+
*/
|
|
47929
48032
|
enable() {
|
|
47930
48033
|
if (this.options.chromeless) {
|
|
47931
48034
|
return;
|
|
@@ -47934,24 +48037,6 @@ class MediaControl extends UICorePlugin {
|
|
|
47934
48037
|
this.bindKeyEvents();
|
|
47935
48038
|
this.show();
|
|
47936
48039
|
}
|
|
47937
|
-
/**
|
|
47938
|
-
* Start the playback
|
|
47939
|
-
*/
|
|
47940
|
-
play() {
|
|
47941
|
-
this.container && this.container.play();
|
|
47942
|
-
}
|
|
47943
|
-
/**
|
|
47944
|
-
* Pause the playback
|
|
47945
|
-
*/
|
|
47946
|
-
pause() {
|
|
47947
|
-
this.container && this.container.pause();
|
|
47948
|
-
}
|
|
47949
|
-
/**
|
|
47950
|
-
* Stop the playback
|
|
47951
|
-
*/
|
|
47952
|
-
stop() {
|
|
47953
|
-
this.container && this.container.stop();
|
|
47954
|
-
}
|
|
47955
48040
|
/**
|
|
47956
48041
|
* Set the initial volume, which is preserved when playback is interrupted by an advertisement
|
|
47957
48042
|
*/
|
|
@@ -48450,14 +48535,31 @@ class MediaControl extends UICorePlugin {
|
|
|
48450
48535
|
/**
|
|
48451
48536
|
* Get a media control element DOM node
|
|
48452
48537
|
* @param name - The name of the media control element
|
|
48453
|
-
* @returns The DOM node to render
|
|
48538
|
+
* @returns The DOM node to render to or extend
|
|
48539
|
+
* @remarks
|
|
48540
|
+
* Use this method to render custom media control UI in a plugin
|
|
48541
|
+
* @example
|
|
48542
|
+
* ```ts
|
|
48543
|
+
* class MyPlugin extends UICorePlugin {
|
|
48544
|
+
* override render() {
|
|
48545
|
+
* const mediaControl = this.core.getPlugin('media_control')
|
|
48546
|
+
* const clipText = mediaControl.getElement('clipText')
|
|
48547
|
+
* clipText?.el.text('Here we go')
|
|
48548
|
+
* return this
|
|
48549
|
+
* }
|
|
48550
|
+
* }
|
|
48551
|
+
* ```
|
|
48454
48552
|
*/
|
|
48455
48553
|
getElement(name) {
|
|
48456
48554
|
switch (name) {
|
|
48457
48555
|
case 'clipText':
|
|
48458
48556
|
return this.$clipText;
|
|
48557
|
+
case 'bottomGear':
|
|
48558
|
+
return this.$bottomGear;
|
|
48459
48559
|
case 'pip':
|
|
48460
48560
|
return this.$pip;
|
|
48561
|
+
case 'playbackRate':
|
|
48562
|
+
return this.$playbackRate;
|
|
48461
48563
|
case 'seekBarContainer':
|
|
48462
48564
|
return this.$seekBarContainer;
|
|
48463
48565
|
}
|
|
@@ -48591,6 +48693,9 @@ class MediaControl extends UICorePlugin {
|
|
|
48591
48693
|
element &&
|
|
48592
48694
|
$(element).find('svg path').css({ fill: this.buttonsColor });
|
|
48593
48695
|
}
|
|
48696
|
+
/**
|
|
48697
|
+
* @internal
|
|
48698
|
+
*/
|
|
48594
48699
|
destroy() {
|
|
48595
48700
|
$(document).unbind('mouseup', this.stopDrag);
|
|
48596
48701
|
$(document).unbind('mousemove', this.updateDrag);
|
|
@@ -48603,6 +48708,9 @@ class MediaControl extends UICorePlugin {
|
|
|
48603
48708
|
this.advertisementPlaying ? this.disable() : this.enable();
|
|
48604
48709
|
this.trigger(Events$1.MEDIACONTROL_OPTIONS_CHANGE);
|
|
48605
48710
|
}
|
|
48711
|
+
/**
|
|
48712
|
+
* @internal
|
|
48713
|
+
*/
|
|
48606
48714
|
render() {
|
|
48607
48715
|
const timeout = this.options.hideMediaControlDelay || 2000;
|
|
48608
48716
|
const html = MediaControl.template({ settings: this.settings ?? {} });
|
|
@@ -48690,10 +48798,6 @@ class MediaControl extends UICorePlugin {
|
|
|
48690
48798
|
this.hide();
|
|
48691
48799
|
}
|
|
48692
48800
|
}
|
|
48693
|
-
// TODO
|
|
48694
|
-
setMuted(value) {
|
|
48695
|
-
this.container.options.mute = value;
|
|
48696
|
-
}
|
|
48697
48801
|
static getPageX(event) {
|
|
48698
48802
|
return getPageX(event);
|
|
48699
48803
|
}
|
|
@@ -48707,7 +48811,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48707
48811
|
return 0;
|
|
48708
48812
|
}
|
|
48709
48813
|
/**
|
|
48710
|
-
* Enable the
|
|
48814
|
+
* Enable the user interaction disabled earlier
|
|
48711
48815
|
*/
|
|
48712
48816
|
enableControlButton() {
|
|
48713
48817
|
this.disabledClickableList.forEach((element) => {
|
|
@@ -48715,7 +48819,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48715
48819
|
});
|
|
48716
48820
|
}
|
|
48717
48821
|
/**
|
|
48718
|
-
* Disable the control
|
|
48822
|
+
* Disable the user interaction for the control buttons
|
|
48719
48823
|
*/
|
|
48720
48824
|
disabledControlButton() {
|
|
48721
48825
|
this.disabledClickableList.forEach((element) => {
|
|
@@ -48729,7 +48833,6 @@ class MediaControl extends UICorePlugin {
|
|
|
48729
48833
|
return isFinite(this.core.activePlayback.getDuration());
|
|
48730
48834
|
}
|
|
48731
48835
|
}
|
|
48732
|
-
// TODO drop?
|
|
48733
48836
|
MediaControl.extend = function (properties) {
|
|
48734
48837
|
return extend(MediaControl, properties);
|
|
48735
48838
|
};
|
|
@@ -48743,7 +48846,7 @@ const streamsMomentoIcon = "<svg id=\"Слой_1\" data-name=\"Слой 1\" xmln
|
|
|
48743
48846
|
const streamsWhiteNightsIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"50\" height=\"50\" viewBox=\"0 0 50 50\">\n <defs>\n <clipPath id=\"clip-Icon\">\n <rect width=\"50\" height=\"50\"/>\n </clipPath>\n </defs>\n <g id=\"Icon\" clip-path=\"url(#clip-Icon)\">\n <g id=\"icon2\" transform=\"translate(-0.041 0)\">\n <path id=\"Контур_77\" data-name=\"Контур 77\" d=\"M6.493,13v8.266h6.275V19.74H8.31V17.714h4.006V16.3H8.31V14.53h4.365V13Zm7.5,0v8.266h1.7V15.732h.023l3.438,5.534h1.818V13h-1.7v5.545h-.023L15.8,13Z\" fill=\"#fff\"/>\n <path id=\"Контур_76\" data-name=\"Контур 76\" d=\"M29.949,29.1V26.774H31.94a1.4,1.4,0,0,1,.938.272,1.1,1.1,0,0,1,.313.874,1.155,1.155,0,0,1-.313.9,1.375,1.375,0,0,1-.938.278ZM28.132,25.36v8.266h1.817V30.4h1.818a1.353,1.353,0,0,1,.984.3,1.637,1.637,0,0,1,.394.949c.046.333.079.681.1,1.042a3.2,3.2,0,0,0,.185.938h1.819a1.218,1.218,0,0,1-.191-.423,3.611,3.611,0,0,1-.093-.527c-.019-.185-.033-.367-.041-.544s-.016-.332-.023-.463a5.052,5.052,0,0,0-.087-.625,2.109,2.109,0,0,0-.2-.573,1.586,1.586,0,0,0-.359-.451,1.414,1.414,0,0,0-.556-.284v-.023a1.926,1.926,0,0,0,1-.81,2.494,2.494,0,0,0,.307-1.262,2.308,2.308,0,0,0-.165-.88,2.128,2.128,0,0,0-.486-.724,2.3,2.3,0,0,0-.764-.492,2.67,2.67,0,0,0-1-.179ZM43.506,30.5V25.36H41.689V30.5a2.065,2.065,0,0,1-.37,1.36,1.7,1.7,0,0,1-1.343.434,2.086,2.086,0,0,1-.886-.156,1.283,1.283,0,0,1-.758-.978,3.748,3.748,0,0,1-.058-.66V25.36H36.456V30.5a3.16,3.16,0,0,0,.92,2.5,3.807,3.807,0,0,0,2.6.81,3.82,3.82,0,0,0,2.593-.816,3.132,3.132,0,0,0,.937-2.492Z\" fill=\"#fff\"/>\n <path id=\"Контур_80\" data-name=\"Контур 80\" d=\"M22.646,31.2H4.689a4.505,4.505,0,0,1-4.5-4.5V8.5A4.505,4.505,0,0,1,4.689,4h18.2a4.505,4.505,0,0,1,4.5,4.5v8.445l-.893.1a3.184,3.184,0,0,0-2.846,3.177V30.5l-.465.7ZM4.689,6a2.5,2.5,0,0,0-2.5,2.5V26.7a2.5,2.5,0,0,0,2.5,2.5H21.65V20.22a5.18,5.18,0,0,1,3.739-4.992V8.5a2.5,2.5,0,0,0-2.5-2.5Z\" fill=\"#fff\"/>\n <path id=\"Контур_81\" data-name=\"Контур 81\" d=\"M30.127,47.884a1,1,0,0,1-1-1V43.267H26.846a5.206,5.206,0,0,1-5.2-5.2V20.222a5.206,5.206,0,0,1,5.2-5.2H44.692a5.206,5.206,0,0,1,5.2,5.2V38.068a5.206,5.206,0,0,1-5.2,5.2H35.058l-4.216,4.316A1,1,0,0,1,30.127,47.884ZM26.846,17.022a3.2,3.2,0,0,0-3.2,3.2V38.067a3.2,3.2,0,0,0,3.2,3.2h3.281a1,1,0,0,1,1,1v2.162l2.8-2.86a1,1,0,0,1,.715-.3H44.692a3.2,3.2,0,0,0,3.2-3.2V20.222a3.2,3.2,0,0,0-3.2-3.2Z\" fill=\"#fff\"/>\n </g>\n </g>\n</svg>\n";
|
|
48744
48847
|
|
|
48745
48848
|
const VERSION$3 = '0.0.1';
|
|
48746
|
-
const T$5 = 'plugins.
|
|
48849
|
+
const T$5 = 'plugins.media_control_multicamera';
|
|
48747
48850
|
class MultiCamera extends UICorePlugin {
|
|
48748
48851
|
currentCamera = null;
|
|
48749
48852
|
currentTime = 0;
|
|
@@ -48751,7 +48854,7 @@ class MultiCamera extends UICorePlugin {
|
|
|
48751
48854
|
multicamera = [];
|
|
48752
48855
|
noActiveStreams = false;
|
|
48753
48856
|
get name() {
|
|
48754
|
-
return '
|
|
48857
|
+
return 'media_control_multicamera';
|
|
48755
48858
|
}
|
|
48756
48859
|
get supportedVersion() {
|
|
48757
48860
|
return { min: CLAPPR_VERSION };
|
|
@@ -49093,10 +49196,10 @@ const pipIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"no
|
|
|
49093
49196
|
const buttonHtml$1 = "<button class=\"gplayer-lite-btn gcore-skin-button-color\">\n <span><%= pipIcon %></span>\n</button>\n";
|
|
49094
49197
|
|
|
49095
49198
|
const VERSION$2 = '0.0.1';
|
|
49096
|
-
const T$4 = `plugins.
|
|
49199
|
+
const T$4 = `plugins.media_control_pip`;
|
|
49097
49200
|
class PictureInPicture extends UICorePlugin {
|
|
49098
49201
|
get name() {
|
|
49099
|
-
return '
|
|
49202
|
+
return 'media_control_pip';
|
|
49100
49203
|
}
|
|
49101
49204
|
get supportedVersion() {
|
|
49102
49205
|
return { min: CLAPPR_VERSION };
|
|
@@ -49173,6 +49276,7 @@ const DEFAULT_PLAYBACK_RATES = [
|
|
|
49173
49276
|
{ value: '2.0', label: '2x' }
|
|
49174
49277
|
];
|
|
49175
49278
|
const DEFAULT_PLAYBACK_RATE = '1.0';
|
|
49279
|
+
// TODO
|
|
49176
49280
|
const MEDIACONTROL_PLAYBACKRATE = 'playbackRate';
|
|
49177
49281
|
class PlaybackRate extends UICorePlugin {
|
|
49178
49282
|
currentPlayback = null;
|
|
@@ -49180,7 +49284,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49180
49284
|
prevSelectedRate;
|
|
49181
49285
|
selectedRate = DEFAULT_PLAYBACK_RATE;
|
|
49182
49286
|
get name() {
|
|
49183
|
-
return '
|
|
49287
|
+
return 'media_control_playback_rate';
|
|
49184
49288
|
}
|
|
49185
49289
|
get supportedVersion() {
|
|
49186
49290
|
return { min: CLAPPR_VERSION };
|
|
@@ -49358,7 +49462,6 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49358
49462
|
currentLevelElement.find('a').addClass('gcore-skin-active');
|
|
49359
49463
|
}
|
|
49360
49464
|
}
|
|
49361
|
-
// PlaybackRate.MEDIACONTROL_PLAYBACKRATE = 'playbackRate';
|
|
49362
49465
|
|
|
49363
49466
|
const posterHTML = "<div class=\"play-wrapper\" data-poster></div>\n";
|
|
49364
49467
|
|
|
@@ -49366,40 +49469,73 @@ const posterHTML = "<div class=\"play-wrapper\" data-poster></div>\n";
|
|
|
49366
49469
|
// Use of this source code is governed by a BSD-style
|
|
49367
49470
|
// license that can be found in the LICENSE file.
|
|
49368
49471
|
const T$3 = 'plugins.poster_custom';
|
|
49472
|
+
/**
|
|
49473
|
+
* Displays a poster image in the background and a big play button on top when playback is stopped
|
|
49474
|
+
* @beta
|
|
49475
|
+
* @remarks
|
|
49476
|
+
* When the playback is stopped, media control UI is disabled.
|
|
49477
|
+
*
|
|
49478
|
+
* Configuration options:
|
|
49479
|
+
*
|
|
49480
|
+
* - `poster.custom` - custom CSS background
|
|
49481
|
+
*
|
|
49482
|
+
* - `poster.showForNoOp` - whether to show the poster when the playback is not started
|
|
49483
|
+
*
|
|
49484
|
+
* - `poster.url` - the URL of the poster image
|
|
49485
|
+
*
|
|
49486
|
+
* - `poster.showOnVideoEnd` - whether to show the poster when the playback is ended
|
|
49487
|
+
*
|
|
49488
|
+
* @example
|
|
49489
|
+
* ```ts
|
|
49490
|
+
* new Player({
|
|
49491
|
+
* ...
|
|
49492
|
+
* poster: {
|
|
49493
|
+
* showForNoOp: true,
|
|
49494
|
+
* url: 'https://via.placeholder.com/150.png',
|
|
49495
|
+
* }
|
|
49496
|
+
* })
|
|
49497
|
+
* ```
|
|
49498
|
+
*/
|
|
49369
49499
|
class Poster extends UIContainerPlugin {
|
|
49370
49500
|
hasFatalError = false;
|
|
49371
49501
|
hasStartedPlaying = false;
|
|
49372
49502
|
playRequested = false;
|
|
49373
49503
|
$playButton = null;
|
|
49374
49504
|
$playWrapper = null;
|
|
49505
|
+
/**
|
|
49506
|
+
* @internal
|
|
49507
|
+
*/
|
|
49375
49508
|
get name() {
|
|
49376
49509
|
return 'poster_custom';
|
|
49377
49510
|
}
|
|
49511
|
+
/**
|
|
49512
|
+
* @internal
|
|
49513
|
+
*/
|
|
49378
49514
|
get supportedVersion() {
|
|
49379
49515
|
return { min: CLAPPR_VERSION };
|
|
49380
49516
|
}
|
|
49381
|
-
|
|
49382
|
-
return tmpl(posterHTML);
|
|
49383
|
-
}
|
|
49517
|
+
static template = tmpl(posterHTML);
|
|
49384
49518
|
get shouldRender() {
|
|
49385
49519
|
if (!this.enabled) {
|
|
49386
49520
|
return false;
|
|
49387
49521
|
}
|
|
49388
|
-
// const showOnError = this.options.poster?.showOnError !== false
|
|
49389
|
-
trace(`${T$3} shouldRender`, {
|
|
49390
|
-
hasFatalError: this.hasFatalError,
|
|
49391
|
-
});
|
|
49392
49522
|
const showForNoOp = !!this.options.poster?.showForNoOp;
|
|
49393
49523
|
return (this.container.playback.name !== 'html_img' &&
|
|
49394
49524
|
(this.container.playback.getPlaybackType() !== Playback.NO_OP ||
|
|
49395
49525
|
showForNoOp));
|
|
49396
49526
|
}
|
|
49527
|
+
/**
|
|
49528
|
+
* @internal
|
|
49529
|
+
*/
|
|
49397
49530
|
get attributes() {
|
|
49398
49531
|
return {
|
|
49399
49532
|
class: 'player-poster',
|
|
49400
49533
|
'data-poster': '',
|
|
49401
49534
|
};
|
|
49402
49535
|
}
|
|
49536
|
+
/**
|
|
49537
|
+
* @internal
|
|
49538
|
+
*/
|
|
49403
49539
|
get events() {
|
|
49404
49540
|
return {
|
|
49405
49541
|
click: 'clicked',
|
|
@@ -49408,6 +49544,9 @@ class Poster extends UIContainerPlugin {
|
|
|
49408
49544
|
get showOnVideoEnd() {
|
|
49409
49545
|
return this.options.poster?.showOnVideoEnd !== false;
|
|
49410
49546
|
}
|
|
49547
|
+
/**
|
|
49548
|
+
* @internal
|
|
49549
|
+
*/
|
|
49411
49550
|
bindEvents() {
|
|
49412
49551
|
this.listenTo(this.container, Events$1.CONTAINER_STOP, this.onStop);
|
|
49413
49552
|
this.listenTo(this.container, Events$1.CONTAINER_PLAY, this.onPlay);
|
|
@@ -49420,11 +49559,17 @@ class Poster extends UIContainerPlugin {
|
|
|
49420
49559
|
this.listenTo(this.container, Events$1.CONTAINER_READY, this.render);
|
|
49421
49560
|
this.listenTo(this.container, Events$1.PLAYBACK_PLAY_INTENT, this.onPlayIntent);
|
|
49422
49561
|
}
|
|
49562
|
+
/**
|
|
49563
|
+
* Reenables earlier disabled plugin
|
|
49564
|
+
*/
|
|
49423
49565
|
enable() {
|
|
49424
49566
|
super.enable();
|
|
49425
49567
|
this.hasStartedPlaying = this.container.playback.isPlaying();
|
|
49426
49568
|
this.update();
|
|
49427
49569
|
}
|
|
49570
|
+
/**
|
|
49571
|
+
* Disables the plugin, unmounting it from the DOM
|
|
49572
|
+
*/
|
|
49428
49573
|
disable() {
|
|
49429
49574
|
trace(`${T$3} disable`);
|
|
49430
49575
|
this.hasStartedPlaying = false;
|
|
@@ -49555,11 +49700,14 @@ class Poster extends UIContainerPlugin {
|
|
|
49555
49700
|
this.$el.hide();
|
|
49556
49701
|
}
|
|
49557
49702
|
}
|
|
49703
|
+
/**
|
|
49704
|
+
* @internal
|
|
49705
|
+
*/
|
|
49558
49706
|
render() {
|
|
49559
49707
|
if (!this.shouldRender) {
|
|
49560
49708
|
return this;
|
|
49561
49709
|
}
|
|
49562
|
-
this.$el.html(
|
|
49710
|
+
this.$el.html(Poster.template());
|
|
49563
49711
|
const isRegularPoster = this.options.poster && this.options.poster.custom === undefined;
|
|
49564
49712
|
if (isRegularPoster) {
|
|
49565
49713
|
const posterUrl = this.options.poster.url || this.options.poster;
|
|
@@ -49583,6 +49731,9 @@ class Poster extends UIContainerPlugin {
|
|
|
49583
49731
|
this.update();
|
|
49584
49732
|
return this;
|
|
49585
49733
|
}
|
|
49734
|
+
/**
|
|
49735
|
+
* @internal
|
|
49736
|
+
*/
|
|
49586
49737
|
destroy() {
|
|
49587
49738
|
this.container.$el.removeClass('container-with-poster-clickable');
|
|
49588
49739
|
return this;
|
|
@@ -49597,7 +49748,7 @@ const seekTimeHTML = "<span data-seek-time></span>\n<span data-duration></span>\
|
|
|
49597
49748
|
const { formatTime } = Utils;
|
|
49598
49749
|
class SeekTime extends UICorePlugin {
|
|
49599
49750
|
get name() {
|
|
49600
|
-
return '
|
|
49751
|
+
return 'media_control_seek_time';
|
|
49601
49752
|
}
|
|
49602
49753
|
get supportedVersion() {
|
|
49603
49754
|
return { min: CLAPPR_VERSION };
|
|
@@ -49755,7 +49906,7 @@ class Share extends UICorePlugin {
|
|
|
49755
49906
|
hide = false;
|
|
49756
49907
|
container = null;
|
|
49757
49908
|
get name() {
|
|
49758
|
-
return '
|
|
49909
|
+
return 'media_control_share';
|
|
49759
49910
|
}
|
|
49760
49911
|
get supportedVersion() {
|
|
49761
49912
|
return { min: CLAPPR_VERSION };
|
|
@@ -50210,7 +50361,7 @@ class Subtitles extends UICorePlugin {
|
|
|
50210
50361
|
tracks;
|
|
50211
50362
|
$string;
|
|
50212
50363
|
get name() {
|
|
50213
|
-
return '
|
|
50364
|
+
return 'media_control_subtitles';
|
|
50214
50365
|
}
|
|
50215
50366
|
get supportedVersion() {
|
|
50216
50367
|
return { min: CLAPPR_VERSION };
|
|
@@ -50657,7 +50808,7 @@ const parseSRT = /*@__PURE__*/getDefaultExportFromCjs$1(parseSrtExports);
|
|
|
50657
50808
|
|
|
50658
50809
|
const pluginHtml = "<div class=\"thumbnails-text\"></div>\n<% if (backdropHeight) { %>\n <div class=\"backdrop\" style=\"height: <%= backdropHeight %>px;\">\n <div class=\"carousel\"></div>\n </div>\n<% }; %>\n<% if (spotlightHeight) { %>\n <div class=\"spotlight\" style=\"height: <%= spotlightHeight %>px;\">\n </div>\n<% }; %>\n";
|
|
50659
50810
|
|
|
50660
|
-
const T$1 = 'plugins.
|
|
50811
|
+
const T$1 = 'plugins.media_control_thumbnails';
|
|
50661
50812
|
class Thumbnails extends UICorePlugin {
|
|
50662
50813
|
_$spotlight = null;
|
|
50663
50814
|
_$backdrop = null;
|
|
@@ -50673,7 +50824,7 @@ class Thumbnails extends UICorePlugin {
|
|
|
50673
50824
|
_oldContainer = null;
|
|
50674
50825
|
_thumbs = [];
|
|
50675
50826
|
get name() {
|
|
50676
|
-
return '
|
|
50827
|
+
return 'media_control_thumbnails';
|
|
50677
50828
|
}
|
|
50678
50829
|
get supportedVersion() {
|
|
50679
50830
|
return { min: CLAPPR_VERSION };
|
|
@@ -51172,7 +51323,6 @@ class SourceController extends CorePlugin {
|
|
|
51172
51323
|
else {
|
|
51173
51324
|
this.sync = noSync;
|
|
51174
51325
|
}
|
|
51175
|
-
// TODO bind to CORE_ACTIVE_CONTAINER_CHANGED
|
|
51176
51326
|
this.bindContainerEventListeners();
|
|
51177
51327
|
if (this.active) {
|
|
51178
51328
|
this.core.activeContainer?.getPlugin('poster_custom')?.disable();
|