@gcorevideo/player 2.22.20 → 2.22.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/level-selector/button.ejs +1 -1
- package/dist/core.js +1 -1
- package/dist/index.css +422 -422
- package/dist/index.js +225 -219
- package/dist/player.d.ts +25 -17
- package/dist/plugins/index.css +1346 -1346
- package/dist/plugins/index.js +63 -61
- package/docs/api/{player.bitratetrackrecord.md → player.clapprstatsbitratetrack.md} +3 -3
- package/docs/api/player.clapprstatsmetrics.md +2 -2
- package/docs/api/player.gearevents.md +1 -1
- package/docs/api/player.md +1 -1
- package/docs/api/player.mediacontrol.mount.md +0 -5
- package/docs/api/player.mediacontrol.putelement.md +5 -0
- package/docs/api/player.mediacontrol.toggleelement.md +1 -1
- package/lib/plugins/media-control/MediaControl.d.ts +3 -0
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +6 -1
- package/lib/plugins/volume-fade/VolumeFade.d.ts +25 -10
- package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
- package/lib/plugins/volume-fade/VolumeFade.js +62 -60
- package/package.json +1 -1
- package/src/plugins/level-selector/__tests__/__snapshots__/QualityLevels.test.ts.snap +1 -1
- package/src/plugins/media-control/MediaControl.ts +6 -1
- package/src/plugins/volume-fade/VolumeFade.ts +92 -75
- package/temp/player.api.json +32 -32
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -12680,7 +12680,7 @@ var PlaybackEvents;
|
|
|
12680
12680
|
// https://github.com/clappr/clappr/blob/8752995ea439321ac7ca3cd35e8c64de7a3c3d17/LICENSE
|
|
12681
12681
|
const AUTO$1 = -1;
|
|
12682
12682
|
const { now: now$2 } = Utils;
|
|
12683
|
-
const T$
|
|
12683
|
+
const T$l = 'playback.dash';
|
|
12684
12684
|
class DashPlayback extends BasePlayback {
|
|
12685
12685
|
_levels = null;
|
|
12686
12686
|
_currentLevel = null;
|
|
@@ -12955,10 +12955,10 @@ class DashPlayback extends BasePlayback {
|
|
|
12955
12955
|
}
|
|
12956
12956
|
_onPlaybackError = (event) => {
|
|
12957
12957
|
// TODO
|
|
12958
|
-
trace(`${T$
|
|
12958
|
+
trace(`${T$l} _onPlaybackError`, { event });
|
|
12959
12959
|
};
|
|
12960
12960
|
_onDASHJSSError = (event) => {
|
|
12961
|
-
trace(`${T$
|
|
12961
|
+
trace(`${T$l} _onDASHJSSError`, { event });
|
|
12962
12962
|
this._stopTimeUpdateTimer();
|
|
12963
12963
|
// Note that the other error types are deprecated
|
|
12964
12964
|
const e = event.error;
|
|
@@ -12993,7 +12993,7 @@ class DashPlayback extends BasePlayback {
|
|
|
12993
12993
|
}
|
|
12994
12994
|
};
|
|
12995
12995
|
triggerError(error) {
|
|
12996
|
-
trace(`${T$
|
|
12996
|
+
trace(`${T$l} triggerError`, { error });
|
|
12997
12997
|
// this triggers Events.ERROR to be handled by the UI
|
|
12998
12998
|
this.trigger(Events$1.PLAYBACK_ERROR, this.createError(error, {
|
|
12999
12999
|
useCodePrefix: false,
|
|
@@ -13032,10 +13032,10 @@ class DashPlayback extends BasePlayback {
|
|
|
13032
13032
|
}
|
|
13033
13033
|
get dvrEnabled() {
|
|
13034
13034
|
if (!this._dash) {
|
|
13035
|
-
trace(`${T$
|
|
13035
|
+
trace(`${T$l} dvrEnable no dash player instance`);
|
|
13036
13036
|
return false;
|
|
13037
13037
|
}
|
|
13038
|
-
trace(`${T$
|
|
13038
|
+
trace(`${T$l} get.dvrEnabled`, {
|
|
13039
13039
|
dvrWindowSize: this._dash?.getDVRWindowSize(),
|
|
13040
13040
|
minDvrSize: this._minDvrSize,
|
|
13041
13041
|
playbackType: this.getPlaybackType(),
|
|
@@ -13057,7 +13057,7 @@ class DashPlayback extends BasePlayback {
|
|
|
13057
13057
|
this.trigger(Events$1.PLAYBACK_PROGRESS, progress, {});
|
|
13058
13058
|
}
|
|
13059
13059
|
play() {
|
|
13060
|
-
trace(`${T$
|
|
13060
|
+
trace(`${T$l} play`, { dash: !!this._dash });
|
|
13061
13061
|
if (!this._dash) {
|
|
13062
13062
|
this._setup();
|
|
13063
13063
|
}
|
|
@@ -13143,7 +13143,7 @@ class DashPlayback extends BasePlayback {
|
|
|
13143
13143
|
}
|
|
13144
13144
|
// @ts-expect-error
|
|
13145
13145
|
get currentAudioTrack() {
|
|
13146
|
-
trace(`${T$
|
|
13146
|
+
trace(`${T$l} get currentAudioTrack`);
|
|
13147
13147
|
assert.ok(this._dash, 'DASH.js MediaPlayer is not initialized');
|
|
13148
13148
|
const t = this._dash.getCurrentTrackFor('audio');
|
|
13149
13149
|
if (!t) {
|
|
@@ -41844,7 +41844,7 @@ const AUTO = -1;
|
|
|
41844
41844
|
const DEFAULT_RECOVER_ATTEMPTS = 16;
|
|
41845
41845
|
Events$1.register('PLAYBACK_FRAGMENT_CHANGED');
|
|
41846
41846
|
Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
|
|
41847
|
-
const T$
|
|
41847
|
+
const T$k = 'playback.hls';
|
|
41848
41848
|
class HlsPlayback extends BasePlayback {
|
|
41849
41849
|
_ccIsSetup = false;
|
|
41850
41850
|
_ccTracksUpdated = false;
|
|
@@ -42073,7 +42073,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42073
42073
|
maxBufferLength: 2,
|
|
42074
42074
|
maxMaxBufferLength: 4,
|
|
42075
42075
|
}, this.options.playback.hlsjsConfig);
|
|
42076
|
-
trace(`${T$
|
|
42076
|
+
trace(`${T$k} _createHLSInstance`, { config });
|
|
42077
42077
|
this._hls = new Hls(config);
|
|
42078
42078
|
}
|
|
42079
42079
|
_attachHLSMedia() {
|
|
@@ -42164,7 +42164,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42164
42164
|
}
|
|
42165
42165
|
else {
|
|
42166
42166
|
Log.error('hlsjs: failed to recover', { evt, data });
|
|
42167
|
-
trace(`${T$
|
|
42167
|
+
trace(`${T$k} _recover failed to recover`, {
|
|
42168
42168
|
type: data.type,
|
|
42169
42169
|
details: data.details,
|
|
42170
42170
|
});
|
|
@@ -42250,7 +42250,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42250
42250
|
this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
|
|
42251
42251
|
}
|
|
42252
42252
|
_onHLSJSError(evt, data) {
|
|
42253
|
-
trace(`${T$
|
|
42253
|
+
trace(`${T$k} _onHLSJSError`, {
|
|
42254
42254
|
fatal: data.fatal,
|
|
42255
42255
|
type: data.type,
|
|
42256
42256
|
details: data.details,
|
|
@@ -42298,7 +42298,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42298
42298
|
evt,
|
|
42299
42299
|
data,
|
|
42300
42300
|
});
|
|
42301
|
-
trace(`${T$
|
|
42301
|
+
trace(`${T$k} _onHLSJSError trying to recover from network error`, {
|
|
42302
42302
|
details: data.details,
|
|
42303
42303
|
});
|
|
42304
42304
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42311,7 +42311,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42311
42311
|
evt,
|
|
42312
42312
|
data,
|
|
42313
42313
|
});
|
|
42314
|
-
trace(`${T$
|
|
42314
|
+
trace(`${T$k} _onHLSJSError trying to recover from media error`, {
|
|
42315
42315
|
details: data.details,
|
|
42316
42316
|
});
|
|
42317
42317
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42341,7 +42341,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42341
42341
|
return;
|
|
42342
42342
|
}
|
|
42343
42343
|
Log.warn('hlsjs: non-fatal error occurred', { evt, data });
|
|
42344
|
-
trace(`${T$
|
|
42344
|
+
trace(`${T$k} _onHLSJSError non-fatal error occurred`, {
|
|
42345
42345
|
type: data.type,
|
|
42346
42346
|
details: data.details,
|
|
42347
42347
|
});
|
|
@@ -42675,11 +42675,11 @@ class HlsPlayback extends BasePlayback {
|
|
|
42675
42675
|
this._hls.audioTrack = Number(id); // TODO or find index by .id == id?
|
|
42676
42676
|
}
|
|
42677
42677
|
_onAudioTracksUpdated(_, data) {
|
|
42678
|
-
trace(`${T$
|
|
42678
|
+
trace(`${T$k} onAudioTracksUpdated`);
|
|
42679
42679
|
this.trigger(Events$1.PLAYBACK_AUDIO_AVAILABLE, data.audioTracks.map(toClapprTrack));
|
|
42680
42680
|
}
|
|
42681
42681
|
_onAudioTrackSwitched(_, data) {
|
|
42682
|
-
trace(`${T$
|
|
42682
|
+
trace(`${T$k} onAudioTrackSwitched`);
|
|
42683
42683
|
// @ts-ignore
|
|
42684
42684
|
const track = this._hls.audioTracks[data.id];
|
|
42685
42685
|
this.trigger(Events$1.PLAYBACK_AUDIO_CHANGED, toClapprTrack(track));
|
|
@@ -42700,7 +42700,7 @@ function toClapprTrack(t) {
|
|
|
42700
42700
|
};
|
|
42701
42701
|
}
|
|
42702
42702
|
|
|
42703
|
-
const T$
|
|
42703
|
+
const T$j = 'playback.html5_video';
|
|
42704
42704
|
const STALL_TIMEOUT = 15000;
|
|
42705
42705
|
class HTML5Video extends BasePlayback {
|
|
42706
42706
|
stallTimerId = null;
|
|
@@ -42708,7 +42708,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42708
42708
|
* @internal
|
|
42709
42709
|
*/
|
|
42710
42710
|
createError(errorData, options) {
|
|
42711
|
-
trace(`${T$
|
|
42711
|
+
trace(`${T$j} createError`, {
|
|
42712
42712
|
errorData: { ...errorData },
|
|
42713
42713
|
});
|
|
42714
42714
|
const i18n = this.i18n ||
|
|
@@ -42724,11 +42724,11 @@ class HTML5Video extends BasePlayback {
|
|
|
42724
42724
|
return super.createError(errorData, { ...options, useCodePrefix: false });
|
|
42725
42725
|
}
|
|
42726
42726
|
_onWaiting() {
|
|
42727
|
-
trace(`${T$
|
|
42727
|
+
trace(`${T$j} _onWaiting`);
|
|
42728
42728
|
super._onWaiting();
|
|
42729
42729
|
}
|
|
42730
42730
|
_onEnded() {
|
|
42731
|
-
trace(`${T$
|
|
42731
|
+
trace(`${T$j} _onEnded`);
|
|
42732
42732
|
if (this.stallTimerId) {
|
|
42733
42733
|
clearTimeout(this.stallTimerId);
|
|
42734
42734
|
this.stallTimerId = null;
|
|
@@ -42736,12 +42736,12 @@ class HTML5Video extends BasePlayback {
|
|
|
42736
42736
|
super._onEnded();
|
|
42737
42737
|
}
|
|
42738
42738
|
_handleBufferingEvents() {
|
|
42739
|
-
trace(`${T$
|
|
42739
|
+
trace(`${T$j} _handleBufferingEvents`, {
|
|
42740
42740
|
networkState: this.el.networkState,
|
|
42741
42741
|
});
|
|
42742
42742
|
if (!this.stallTimerId) {
|
|
42743
42743
|
this.stallTimerId = setTimeout(() => {
|
|
42744
|
-
trace(`${T$
|
|
42744
|
+
trace(`${T$j} _handleBufferingEvents stall timeout`, {
|
|
42745
42745
|
buffering: this.buffering,
|
|
42746
42746
|
ended: this.ended,
|
|
42747
42747
|
});
|
|
@@ -42759,7 +42759,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42759
42759
|
super._handleBufferingEvents();
|
|
42760
42760
|
}
|
|
42761
42761
|
_onPlaying() {
|
|
42762
|
-
trace(`${T$
|
|
42762
|
+
trace(`${T$j} _onPlaying`);
|
|
42763
42763
|
if (this.stallTimerId) {
|
|
42764
42764
|
clearTimeout(this.stallTimerId);
|
|
42765
42765
|
this.stallTimerId = null;
|
|
@@ -42767,7 +42767,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42767
42767
|
super._onPlaying();
|
|
42768
42768
|
}
|
|
42769
42769
|
_onPause() {
|
|
42770
|
-
trace(`${T$
|
|
42770
|
+
trace(`${T$j} _onPause`);
|
|
42771
42771
|
super._onPause();
|
|
42772
42772
|
if (this.stallTimerId) {
|
|
42773
42773
|
clearTimeout(this.stallTimerId);
|
|
@@ -42777,7 +42777,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42777
42777
|
get audioTracks() {
|
|
42778
42778
|
const tracks = this.el.audioTracks;
|
|
42779
42779
|
const supported = !!tracks;
|
|
42780
|
-
trace(`${T$
|
|
42780
|
+
trace(`${T$j} get audioTracks`, { supported });
|
|
42781
42781
|
const retval = [];
|
|
42782
42782
|
if (supported) {
|
|
42783
42783
|
for (let i = 0; i < tracks.length; i++) {
|
|
@@ -42796,7 +42796,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42796
42796
|
get currentAudioTrack() {
|
|
42797
42797
|
const tracks = this.el.audioTracks;
|
|
42798
42798
|
const supported = !!tracks;
|
|
42799
|
-
trace(`${T$
|
|
42799
|
+
trace(`${T$j} get currentAudioTrack`, {
|
|
42800
42800
|
supported,
|
|
42801
42801
|
});
|
|
42802
42802
|
if (supported) {
|
|
@@ -42817,7 +42817,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42817
42817
|
switchAudioTrack(id) {
|
|
42818
42818
|
const tracks = this.el.audioTracks;
|
|
42819
42819
|
const supported = !!tracks;
|
|
42820
|
-
trace(`${T$
|
|
42820
|
+
trace(`${T$j} switchAudioTrack`, {
|
|
42821
42821
|
supported,
|
|
42822
42822
|
});
|
|
42823
42823
|
if (supported) {
|
|
@@ -42836,7 +42836,7 @@ function registerPlaybacks() {
|
|
|
42836
42836
|
Loader.registerPlayback(DashPlayback);
|
|
42837
42837
|
}
|
|
42838
42838
|
|
|
42839
|
-
const T$
|
|
42839
|
+
const T$i = 'GPlayer';
|
|
42840
42840
|
const DEFAULT_OPTIONS = {
|
|
42841
42841
|
autoPlay: false,
|
|
42842
42842
|
debug: 'none',
|
|
@@ -42924,7 +42924,7 @@ class Player {
|
|
|
42924
42924
|
* ```
|
|
42925
42925
|
*/
|
|
42926
42926
|
attachTo(playerElement) {
|
|
42927
|
-
trace(`${T$
|
|
42927
|
+
trace(`${T$i} attachTo`, {
|
|
42928
42928
|
player: !!this.player,
|
|
42929
42929
|
});
|
|
42930
42930
|
assert.ok(!this.player, 'Player already initialized');
|
|
@@ -42934,7 +42934,7 @@ class Player {
|
|
|
42934
42934
|
}
|
|
42935
42935
|
const coreOpts = this.buildCoreOptions(playerElement);
|
|
42936
42936
|
const { core, container } = Player.getRegisteredPlugins();
|
|
42937
|
-
trace(`${T$
|
|
42937
|
+
trace(`${T$i} init`, {
|
|
42938
42938
|
registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.prototype.name),
|
|
42939
42939
|
});
|
|
42940
42940
|
coreOpts.plugins = {
|
|
@@ -42948,7 +42948,7 @@ class Player {
|
|
|
42948
42948
|
* Destroys the player, releasing all resources and unmounting its UI from the DOM.
|
|
42949
42949
|
*/
|
|
42950
42950
|
destroy() {
|
|
42951
|
-
trace(`${T$
|
|
42951
|
+
trace(`${T$i} destroy`, {
|
|
42952
42952
|
player: !!this.player,
|
|
42953
42953
|
});
|
|
42954
42954
|
if (this.player) {
|
|
@@ -43135,7 +43135,7 @@ class Player {
|
|
|
43135
43135
|
this.config = $.extend(true, this.config, config);
|
|
43136
43136
|
}
|
|
43137
43137
|
initPlayer(coreOptions) {
|
|
43138
|
-
trace(`${T$
|
|
43138
|
+
trace(`${T$i} initPlayer`, {
|
|
43139
43139
|
autoPlay: coreOptions.autoPlay,
|
|
43140
43140
|
sources: coreOptions.sources,
|
|
43141
43141
|
player: !!this.player,
|
|
@@ -43160,7 +43160,7 @@ class Player {
|
|
|
43160
43160
|
}
|
|
43161
43161
|
}
|
|
43162
43162
|
triggerAutoPlay() {
|
|
43163
|
-
trace(`${T$
|
|
43163
|
+
trace(`${T$i} triggerAutoPlay`);
|
|
43164
43164
|
setTimeout(() => {
|
|
43165
43165
|
this.player?.play({
|
|
43166
43166
|
autoPlay: true,
|
|
@@ -43178,7 +43178,7 @@ class Player {
|
|
|
43178
43178
|
// TODO test
|
|
43179
43179
|
events = {
|
|
43180
43180
|
onReady: () => {
|
|
43181
|
-
trace(`${T$
|
|
43181
|
+
trace(`${T$i} onReady`, {
|
|
43182
43182
|
ready: this.ready,
|
|
43183
43183
|
});
|
|
43184
43184
|
if (this.ready) {
|
|
@@ -43212,7 +43212,7 @@ class Player {
|
|
|
43212
43212
|
buildCoreOptions(rootNode) {
|
|
43213
43213
|
const sources = this.buildMediaSourcesList();
|
|
43214
43214
|
const source = sources[0];
|
|
43215
|
-
trace(`${T$
|
|
43215
|
+
trace(`${T$i} buildCoreOptions`, {
|
|
43216
43216
|
source,
|
|
43217
43217
|
sources,
|
|
43218
43218
|
});
|
|
@@ -43273,7 +43273,7 @@ class Player {
|
|
|
43273
43273
|
assert.ok(this.player, 'Player is not initialized');
|
|
43274
43274
|
const core = this.player.core;
|
|
43275
43275
|
core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
|
|
43276
|
-
trace(`${T$
|
|
43276
|
+
trace(`${T$i} on CORE_SCREEN_ORIENTATION_CHANGED`, {
|
|
43277
43277
|
orientation,
|
|
43278
43278
|
rootNode: {
|
|
43279
43279
|
width: this.rootNode?.clientWidth,
|
|
@@ -43288,14 +43288,14 @@ class Player {
|
|
|
43288
43288
|
}
|
|
43289
43289
|
}, null);
|
|
43290
43290
|
core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
|
|
43291
|
-
trace(`${T$
|
|
43291
|
+
trace(`${T$i} on CORE_RESIZE`, {
|
|
43292
43292
|
width,
|
|
43293
43293
|
height,
|
|
43294
43294
|
});
|
|
43295
43295
|
this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
|
|
43296
43296
|
}, null);
|
|
43297
43297
|
core.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
|
|
43298
|
-
trace(`${T$
|
|
43298
|
+
trace(`${T$i} CORE_FULLSCREEN`, {
|
|
43299
43299
|
isFullscreen,
|
|
43300
43300
|
});
|
|
43301
43301
|
this.safeTriggerEvent(PlayerEvent.Fullscreen, isFullscreen);
|
|
@@ -43303,7 +43303,7 @@ class Player {
|
|
|
43303
43303
|
}
|
|
43304
43304
|
}
|
|
43305
43305
|
|
|
43306
|
-
var version$1 = "2.22.
|
|
43306
|
+
var version$1 = "2.22.21";
|
|
43307
43307
|
|
|
43308
43308
|
var packages = {
|
|
43309
43309
|
"node_modules/@clappr/core": {
|
|
@@ -43502,7 +43502,7 @@ const volumeOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
|
|
|
43502
43502
|
|
|
43503
43503
|
const pluginHtml$6 = "<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";
|
|
43504
43504
|
|
|
43505
|
-
const T$
|
|
43505
|
+
const T$h = 'plugins.big_mute_button';
|
|
43506
43506
|
// TODO rewrite as a container plugin
|
|
43507
43507
|
/**
|
|
43508
43508
|
* `PLUGIN` that displays a big mute button over the video when it's muted.
|
|
@@ -43543,7 +43543,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43543
43543
|
this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
43544
43544
|
this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
|
|
43545
43545
|
this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
|
|
43546
|
-
trace(`${T$
|
|
43546
|
+
trace(`${T$h} bindEvents`, {
|
|
43547
43547
|
mediacontrol: !!this.core.mediaControl,
|
|
43548
43548
|
});
|
|
43549
43549
|
this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
|
|
@@ -43568,12 +43568,12 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43568
43568
|
}
|
|
43569
43569
|
mediaControlRendered() {
|
|
43570
43570
|
const container = this.core.activeContainer;
|
|
43571
|
-
trace(`${T$
|
|
43571
|
+
trace(`${T$h} mediaControlRendered`, {
|
|
43572
43572
|
container: !!container,
|
|
43573
43573
|
});
|
|
43574
43574
|
if (container) {
|
|
43575
43575
|
this.listenTo(container.playback, Events$1.PLAYBACK_PLAY, () => {
|
|
43576
|
-
trace(`${T$
|
|
43576
|
+
trace(`${T$h} PLAYBACK_PLAY`);
|
|
43577
43577
|
this.render();
|
|
43578
43578
|
});
|
|
43579
43579
|
}
|
|
@@ -43597,7 +43597,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43597
43597
|
}
|
|
43598
43598
|
const { autoPlay, wasMuted } = this.options;
|
|
43599
43599
|
const volume = container.volume;
|
|
43600
|
-
trace(`${T$
|
|
43600
|
+
trace(`${T$h} shouldRender`, {
|
|
43601
43601
|
autoPlay,
|
|
43602
43602
|
wasMuted,
|
|
43603
43603
|
volume,
|
|
@@ -43609,7 +43609,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43609
43609
|
*/
|
|
43610
43610
|
render() {
|
|
43611
43611
|
if (this.shouldRender()) {
|
|
43612
|
-
trace(`${T$
|
|
43612
|
+
trace(`${T$h} render`, {
|
|
43613
43613
|
el: !!this.$el,
|
|
43614
43614
|
});
|
|
43615
43615
|
this.$el.html(BigMuteButton.template());
|
|
@@ -43655,7 +43655,7 @@ const gearIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"n
|
|
|
43655
43655
|
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";
|
|
43656
43656
|
|
|
43657
43657
|
const VERSION$6 = '2.19.12';
|
|
43658
|
-
const T$
|
|
43658
|
+
const T$g = 'plugins.bottom_gear';
|
|
43659
43659
|
/**
|
|
43660
43660
|
* Events triggered by the plugin
|
|
43661
43661
|
* @beta
|
|
@@ -43805,20 +43805,20 @@ class BottomGear extends UICorePlugin {
|
|
|
43805
43805
|
addItem(name, $subMenu) {
|
|
43806
43806
|
const $existingItem = this.$el.find(`#gear-options li[data-${name}`);
|
|
43807
43807
|
if ($existingItem.length) {
|
|
43808
|
-
trace(`${T$
|
|
43808
|
+
trace(`${T$g} addItem already exists`, { name });
|
|
43809
43809
|
return $existingItem;
|
|
43810
43810
|
}
|
|
43811
43811
|
const $item = $('<li></li>')
|
|
43812
43812
|
.attr(`data-${name}`, '')
|
|
43813
43813
|
.appendTo(this.$el.find('#gear-options'));
|
|
43814
43814
|
if ($subMenu) {
|
|
43815
|
-
trace(`${T$
|
|
43815
|
+
trace(`${T$g} addItem adding submenu`, { name });
|
|
43816
43816
|
$subMenu
|
|
43817
43817
|
.addClass('gear-sub-menu-wrapper')
|
|
43818
43818
|
.hide()
|
|
43819
43819
|
.appendTo(this.$el.find('#gear-options-wrapper'));
|
|
43820
43820
|
$item.on('click', (e) => {
|
|
43821
|
-
trace(`${T$
|
|
43821
|
+
trace(`${T$g} addItem submenu clicked`, { name });
|
|
43822
43822
|
e.stopPropagation();
|
|
43823
43823
|
$subMenu.show();
|
|
43824
43824
|
this.$el.find('#gear-options').hide();
|
|
@@ -43827,15 +43827,15 @@ class BottomGear extends UICorePlugin {
|
|
|
43827
43827
|
return $item;
|
|
43828
43828
|
}
|
|
43829
43829
|
onActiveContainerChanged() {
|
|
43830
|
-
trace(`${T$
|
|
43830
|
+
trace(`${T$g} onActiveContainerChanged`);
|
|
43831
43831
|
this.bindContainerEvents();
|
|
43832
43832
|
}
|
|
43833
43833
|
bindContainerEvents() {
|
|
43834
|
-
trace(`${T$
|
|
43834
|
+
trace(`${T$g} bindContainerEvents`);
|
|
43835
43835
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
|
|
43836
43836
|
}
|
|
43837
43837
|
highDefinitionUpdate(isHd) {
|
|
43838
|
-
trace(`${T$
|
|
43838
|
+
trace(`${T$g} highDefinitionUpdate`, { isHd });
|
|
43839
43839
|
this.isHd = isHd;
|
|
43840
43840
|
this.$el.find('.gear-icon').html(isHd ? gearHdIcon : gearIcon);
|
|
43841
43841
|
}
|
|
@@ -43843,7 +43843,7 @@ class BottomGear extends UICorePlugin {
|
|
|
43843
43843
|
* @internal
|
|
43844
43844
|
*/
|
|
43845
43845
|
render() {
|
|
43846
|
-
trace(`${T$
|
|
43846
|
+
trace(`${T$g} render`);
|
|
43847
43847
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43848
43848
|
if (!mediaControl) {
|
|
43849
43849
|
return this; // TODO test
|
|
@@ -43875,14 +43875,14 @@ class BottomGear extends UICorePlugin {
|
|
|
43875
43875
|
this.$el.find('#gear-options-wrapper').hide();
|
|
43876
43876
|
}
|
|
43877
43877
|
onCoreReady() {
|
|
43878
|
-
trace(`${T$
|
|
43878
|
+
trace(`${T$g} onCoreReady`);
|
|
43879
43879
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43880
43880
|
assert(mediaControl, 'media_control plugin is required');
|
|
43881
43881
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMediaControlRendered);
|
|
43882
43882
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.hide);
|
|
43883
43883
|
}
|
|
43884
43884
|
onMediaControlRendered() {
|
|
43885
|
-
trace(`${T$
|
|
43885
|
+
trace(`${T$g} onMediaControlRendered`);
|
|
43886
43886
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43887
43887
|
mediaControl.mount('gear', this.$el);
|
|
43888
43888
|
}
|
|
@@ -46346,7 +46346,7 @@ const PLAYBACK_NAMES = {
|
|
|
46346
46346
|
hls: 'HLS.js',
|
|
46347
46347
|
html5_video: 'Native',
|
|
46348
46348
|
};
|
|
46349
|
-
const T$
|
|
46349
|
+
const T$f = 'plugins.nerd_stats';
|
|
46350
46350
|
/**
|
|
46351
46351
|
* `PLUGIN` that displays useful statistics regarding the playback as well as the network quality estimation.
|
|
46352
46352
|
* @beta
|
|
@@ -46526,7 +46526,7 @@ class NerdStats extends UICorePlugin {
|
|
|
46526
46526
|
.text(this.metrics.general.resolution.height);
|
|
46527
46527
|
}
|
|
46528
46528
|
estimateQuality() {
|
|
46529
|
-
trace(`${T$
|
|
46529
|
+
trace(`${T$f} estimateQuality`);
|
|
46530
46530
|
const videoQualityNames = [
|
|
46531
46531
|
'SD (480p)',
|
|
46532
46532
|
'HD (720p)',
|
|
@@ -46551,7 +46551,7 @@ class NerdStats extends UICorePlugin {
|
|
|
46551
46551
|
prefix + videoQualityNames[liveQuality - 1];
|
|
46552
46552
|
}
|
|
46553
46553
|
updateMetrics(metrics) {
|
|
46554
|
-
trace(`${T$
|
|
46554
|
+
trace(`${T$f} updateMetrics`, { custom: this.speedtestMetrics });
|
|
46555
46555
|
Object.assign(this.metrics, metrics);
|
|
46556
46556
|
this.updateEstimatedQuality();
|
|
46557
46557
|
this.$el
|
|
@@ -46653,7 +46653,7 @@ class NerdStats extends UICorePlugin {
|
|
|
46653
46653
|
return this;
|
|
46654
46654
|
}
|
|
46655
46655
|
attach() {
|
|
46656
|
-
trace(`${T$
|
|
46656
|
+
trace(`${T$f} attach`);
|
|
46657
46657
|
const gear = this.core.getPlugin('bottom_gear');
|
|
46658
46658
|
gear
|
|
46659
46659
|
.addItem('nerd_stats')
|
|
@@ -46720,7 +46720,7 @@ function newMetrics() {
|
|
|
46720
46720
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
46721
46721
|
// Use of this source code is governed by a BSD-style
|
|
46722
46722
|
// license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
|
|
46723
|
-
const T$
|
|
46723
|
+
const T$e = 'plugins.click_to_pause';
|
|
46724
46724
|
/**
|
|
46725
46725
|
* A small `PLUGIN` that toggles the playback state on click over the video container
|
|
46726
46726
|
* @beta
|
|
@@ -46750,7 +46750,7 @@ class ClickToPause extends ContainerPlugin {
|
|
|
46750
46750
|
click() {
|
|
46751
46751
|
const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
|
|
46752
46752
|
const isDvrEnabled = this.container.isDvrEnabled();
|
|
46753
|
-
trace(`${T$
|
|
46753
|
+
trace(`${T$e} click`, {
|
|
46754
46754
|
isLivePlayback,
|
|
46755
46755
|
isDvrEnabled,
|
|
46756
46756
|
});
|
|
@@ -46865,7 +46865,7 @@ function buildSvg(clips, duration, barWidth) {
|
|
|
46865
46865
|
|
|
46866
46866
|
const clipsHTML = "<div class=\"media-clip-text\" id=\"clips-text\"></div>";
|
|
46867
46867
|
|
|
46868
|
-
const T$
|
|
46868
|
+
const T$d = 'plugins.clips';
|
|
46869
46869
|
const VERSION$5 = '2.22.16';
|
|
46870
46870
|
const CLAPPR_VERSION = '0.11.4';
|
|
46871
46871
|
/**
|
|
@@ -46915,7 +46915,7 @@ class Clips extends UICorePlugin {
|
|
|
46915
46915
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
|
|
46916
46916
|
}
|
|
46917
46917
|
render() {
|
|
46918
|
-
trace(`${T$
|
|
46918
|
+
trace(`${T$d} render`);
|
|
46919
46919
|
if (!this.options.clips) {
|
|
46920
46920
|
return this;
|
|
46921
46921
|
}
|
|
@@ -46942,19 +46942,19 @@ class Clips extends UICorePlugin {
|
|
|
46942
46942
|
return super.enable();
|
|
46943
46943
|
}
|
|
46944
46944
|
onCoreReady() {
|
|
46945
|
-
trace(`${T$
|
|
46945
|
+
trace(`${T$d} onCoreReady`);
|
|
46946
46946
|
const mediaControl = this.core.getPlugin('media_control');
|
|
46947
46947
|
assert(mediaControl, 'media_control plugin is required');
|
|
46948
46948
|
this.parseClips(this.options.clips.text);
|
|
46949
46949
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMcRender);
|
|
46950
46950
|
}
|
|
46951
46951
|
onMcRender() {
|
|
46952
|
-
trace(`${T$
|
|
46952
|
+
trace(`${T$d} onMcRender`);
|
|
46953
46953
|
const mediaControl = this.core.getPlugin('media_control');
|
|
46954
46954
|
mediaControl.mount('clips', this.$el);
|
|
46955
46955
|
}
|
|
46956
46956
|
onContainerChanged() {
|
|
46957
|
-
trace(`${T$
|
|
46957
|
+
trace(`${T$d} onContainerChanged`);
|
|
46958
46958
|
// TODO figure out the conditions of changing the container (without destroying the previous one)
|
|
46959
46959
|
if (this.oldContainer) {
|
|
46960
46960
|
this.stopListening(this.oldContainer, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
@@ -47247,7 +47247,7 @@ const reloadIcon = "<svg fill=\"#FFFFFF\" height=\"24\" viewBox=\"0 0 24 24\" wi
|
|
|
47247
47247
|
|
|
47248
47248
|
const templateHtml = "<div class=\"player-error-screen__content\" data-error-screen>\n <% if (icon) { %>\n <div class=\"player-error-screen__icon\" data-error-screen><%= icon %></div>\n <% } %>\n <div class=\"player-error-screen__title\" data-error-screen><%= title %></div>\n <% if (message) { %>\n <div class=\"player-error-screen__message\" data-error-screen><%= message %></div>\n <% } %>\n <% if (code) { %>\n <div class=\"player-error-screen__code\" data-error-screen><%= i18n.t('error_code') %>: <%= code %></div>\n <% } %>\n <% if (reloadIcon) { %>\n <div class=\"player-error-screen__reload\" data-error-screen><%= reloadIcon %></div>\n <% } %>\n</div>\n";
|
|
47249
47249
|
|
|
47250
|
-
const T$
|
|
47250
|
+
const T$c = 'plugins.error_screen';
|
|
47251
47251
|
/**
|
|
47252
47252
|
* `PLUGIN` that displays fatal errors nicely in the overlay on top of the player.
|
|
47253
47253
|
* @public
|
|
@@ -47299,11 +47299,11 @@ class ErrorScreen extends UICorePlugin {
|
|
|
47299
47299
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
47300
47300
|
}
|
|
47301
47301
|
onPlay() {
|
|
47302
|
-
trace(`${T$
|
|
47302
|
+
trace(`${T$c} onPlay`);
|
|
47303
47303
|
this.unmount();
|
|
47304
47304
|
}
|
|
47305
47305
|
unmount() {
|
|
47306
|
-
trace(`${T$
|
|
47306
|
+
trace(`${T$c} unmount`);
|
|
47307
47307
|
this.err = null;
|
|
47308
47308
|
this.$el.remove();
|
|
47309
47309
|
}
|
|
@@ -47316,7 +47316,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
47316
47316
|
};
|
|
47317
47317
|
}
|
|
47318
47318
|
reload() {
|
|
47319
|
-
trace(`${T$
|
|
47319
|
+
trace(`${T$c} reload`);
|
|
47320
47320
|
setTimeout(() => {
|
|
47321
47321
|
this.core.configure({
|
|
47322
47322
|
reloading: true,
|
|
@@ -47326,7 +47326,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
47326
47326
|
}, 0);
|
|
47327
47327
|
}
|
|
47328
47328
|
onActiveContainerChanged() {
|
|
47329
|
-
trace(`${T$
|
|
47329
|
+
trace(`${T$c} onActiveContainerChanged`, {
|
|
47330
47330
|
reloading: this.core.options.reloading,
|
|
47331
47331
|
});
|
|
47332
47332
|
this.err = null;
|
|
@@ -47342,7 +47342,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
47342
47342
|
}
|
|
47343
47343
|
}
|
|
47344
47344
|
onError(err) {
|
|
47345
|
-
trace(`${T$
|
|
47345
|
+
trace(`${T$c} onError`, { err });
|
|
47346
47346
|
if (err.UI) {
|
|
47347
47347
|
if (this.err) {
|
|
47348
47348
|
this.unmount();
|
|
@@ -48062,7 +48062,7 @@ const INITIAL_SETTINGS = {
|
|
|
48062
48062
|
default: [],
|
|
48063
48063
|
seekEnabled: false,
|
|
48064
48064
|
};
|
|
48065
|
-
const T$
|
|
48065
|
+
const T$b = 'plugins.media_control';
|
|
48066
48066
|
const LEFT_ORDER = [
|
|
48067
48067
|
'playpause',
|
|
48068
48068
|
'playstop',
|
|
@@ -48071,6 +48071,10 @@ const LEFT_ORDER = [
|
|
|
48071
48071
|
'duration',
|
|
48072
48072
|
'dvr',
|
|
48073
48073
|
];
|
|
48074
|
+
var ExtendedEvents;
|
|
48075
|
+
(function (ExtendedEvents) {
|
|
48076
|
+
ExtendedEvents["MEDIACONTROL_VOLUME"] = "mediacontrol:volume";
|
|
48077
|
+
})(ExtendedEvents || (ExtendedEvents = {}));
|
|
48074
48078
|
const { Config, Fullscreen, formatTime: formatTime$1, extend, removeArrayItem } = Utils;
|
|
48075
48079
|
function orderByOrderPattern(arr, order) {
|
|
48076
48080
|
const arrWithoutDuplicates = [...new Set(arr)];
|
|
@@ -48308,7 +48312,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48308
48312
|
* Hides the media control UI
|
|
48309
48313
|
*/
|
|
48310
48314
|
disable() {
|
|
48311
|
-
trace(`${T$
|
|
48315
|
+
trace(`${T$b} disable`);
|
|
48312
48316
|
this.userDisabled = true; // TODO distinguish between user and system (e.g., unplayable) disabled?
|
|
48313
48317
|
this.hide();
|
|
48314
48318
|
this.unbindKeyEvents();
|
|
@@ -48318,7 +48322,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48318
48322
|
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
48319
48323
|
*/
|
|
48320
48324
|
enable() {
|
|
48321
|
-
trace(`${T$
|
|
48325
|
+
trace(`${T$b} enable`);
|
|
48322
48326
|
if (this.options.chromeless) {
|
|
48323
48327
|
return;
|
|
48324
48328
|
}
|
|
@@ -48551,14 +48555,15 @@ class MediaControl extends UICorePlugin {
|
|
|
48551
48555
|
// if the container is not ready etc
|
|
48552
48556
|
this.intendedVolume = value;
|
|
48553
48557
|
this.persistConfig && !isInitialVolume && Config.persist('volume', value);
|
|
48554
|
-
// TODO
|
|
48555
48558
|
const setWhenContainerReady = () => {
|
|
48556
48559
|
if (this.core.activeContainer && this.core.activeContainer.isReady) {
|
|
48557
48560
|
this.core.activeContainer.setVolume(value);
|
|
48561
|
+
this.trigger(ExtendedEvents.MEDIACONTROL_VOLUME, value);
|
|
48558
48562
|
}
|
|
48559
48563
|
else {
|
|
48560
48564
|
this.listenToOnce(this.core.activeContainer, Events$1.CONTAINER_READY, () => {
|
|
48561
48565
|
this.core.activeContainer.setVolume(value);
|
|
48566
|
+
this.trigger(ExtendedEvents.MEDIACONTROL_VOLUME, value);
|
|
48562
48567
|
});
|
|
48563
48568
|
}
|
|
48564
48569
|
};
|
|
@@ -48763,13 +48768,13 @@ class MediaControl extends UICorePlugin {
|
|
|
48763
48768
|
}
|
|
48764
48769
|
}
|
|
48765
48770
|
updateSettings() {
|
|
48766
|
-
trace(`${T$
|
|
48771
|
+
trace(`${T$b} updateSettings`, { settings: this.settings });
|
|
48767
48772
|
const newSettings = $.extend(true, {
|
|
48768
48773
|
left: [],
|
|
48769
48774
|
default: [],
|
|
48770
48775
|
right: [],
|
|
48771
48776
|
}, this.core.activeContainer.settings);
|
|
48772
|
-
trace(`${T$
|
|
48777
|
+
trace(`${T$b} updateSettings`, { newSettings });
|
|
48773
48778
|
newSettings.left.push('clips'); // TODO settings
|
|
48774
48779
|
// TODO make order controlled via CSS
|
|
48775
48780
|
newSettings.left = orderByOrderPattern([...newSettings.left, 'volume', 'clips'], LEFT_ORDER);
|
|
@@ -48781,7 +48786,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48781
48786
|
newSettings.right = DEFAULT_SETTINGS.right; // TODO get from the options
|
|
48782
48787
|
if ((!this.fullScreenOnVideoTagSupported && !fullscreenEnabled()) ||
|
|
48783
48788
|
this.options.fullscreenDisable) {
|
|
48784
|
-
trace(`${T$
|
|
48789
|
+
trace(`${T$b} updateSettings removing fullscreen`, {
|
|
48785
48790
|
supported: this.fullScreenOnVideoTagSupported,
|
|
48786
48791
|
enabled: Fullscreen.fullscreenEnabled(),
|
|
48787
48792
|
optionsDisable: this.options.fullscreenDisable,
|
|
@@ -48848,7 +48853,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48848
48853
|
*/
|
|
48849
48854
|
mount(name, element) {
|
|
48850
48855
|
const panel = this.getElementLocation(name);
|
|
48851
|
-
trace(`${T$
|
|
48856
|
+
trace(`${T$b} mount`, { name, panel: !!panel });
|
|
48852
48857
|
if (panel) {
|
|
48853
48858
|
const current = panel.find(`[data-${name}]`);
|
|
48854
48859
|
element.attr(`data-${name}`, '');
|
|
@@ -49044,7 +49049,7 @@ class MediaControl extends UICorePlugin {
|
|
|
49044
49049
|
* @internal
|
|
49045
49050
|
*/
|
|
49046
49051
|
render() {
|
|
49047
|
-
trace(`${T$
|
|
49052
|
+
trace(`${T$b} render`, {
|
|
49048
49053
|
needsUpdate: this.hasUpdate,
|
|
49049
49054
|
metadataLoaded: this.metadataLoaded,
|
|
49050
49055
|
});
|
|
@@ -49174,7 +49179,7 @@ class MediaControl extends UICorePlugin {
|
|
|
49174
49179
|
return isFinite(this.core.activePlayback.getDuration());
|
|
49175
49180
|
}
|
|
49176
49181
|
getElementLocation(name) {
|
|
49177
|
-
trace(`${T$
|
|
49182
|
+
trace(`${T$b} getElementLocation`, {
|
|
49178
49183
|
name,
|
|
49179
49184
|
right: this.settings.right,
|
|
49180
49185
|
left: this.settings.left,
|
|
@@ -49221,7 +49226,7 @@ const streamsMomentoIcon = "<svg id=\"Слой_1\" data-name=\"Слой 1\" xmln
|
|
|
49221
49226
|
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";
|
|
49222
49227
|
|
|
49223
49228
|
const VERSION$4 = '0.0.1';
|
|
49224
|
-
const T$
|
|
49229
|
+
const T$a = 'plugins.multicamera';
|
|
49225
49230
|
/**
|
|
49226
49231
|
* `PLUGIN` that adds support for loading multiple streams and switching between them using the media control UI.
|
|
49227
49232
|
* @beta
|
|
@@ -49367,7 +49372,7 @@ class MultiCamera extends UICorePlugin {
|
|
|
49367
49372
|
}
|
|
49368
49373
|
onCameraSelect(event) {
|
|
49369
49374
|
const value = event.currentTarget.dataset.multicameraSelectorSelect;
|
|
49370
|
-
trace(`${T$
|
|
49375
|
+
trace(`${T$a} onCameraSelect`, { value });
|
|
49371
49376
|
if (value !== undefined) {
|
|
49372
49377
|
this.changeById(parseInt(value, 10));
|
|
49373
49378
|
}
|
|
@@ -49493,13 +49498,13 @@ class MultiCamera extends UICorePlugin {
|
|
|
49493
49498
|
}
|
|
49494
49499
|
}
|
|
49495
49500
|
changeById(id) {
|
|
49496
|
-
trace(`${T$
|
|
49501
|
+
trace(`${T$a} changeById`, { id });
|
|
49497
49502
|
queueMicrotask(() => {
|
|
49498
49503
|
const playbackOptions = this.core.options.playback || {};
|
|
49499
49504
|
// TODO figure out what this does
|
|
49500
49505
|
playbackOptions.recycleVideo = Browser.isMobile;
|
|
49501
49506
|
this.currentCamera = this.findElementById(id) ?? null;
|
|
49502
|
-
trace(`${T$
|
|
49507
|
+
trace(`${T$a} changeById`, { id, currentCamera: this.currentCamera, multicamera: this.multicamera });
|
|
49503
49508
|
if (!this.currentCamera) {
|
|
49504
49509
|
return;
|
|
49505
49510
|
}
|
|
@@ -49516,7 +49521,7 @@ class MultiCamera extends UICorePlugin {
|
|
|
49516
49521
|
// TODO remove?
|
|
49517
49522
|
// for html5 playback:
|
|
49518
49523
|
this.options.dvrEnabled = this.currentCamera.dvr;
|
|
49519
|
-
trace(`${T$
|
|
49524
|
+
trace(`${T$a} changeById`, { currentCamera: this.currentCamera });
|
|
49520
49525
|
// TODO
|
|
49521
49526
|
this.core.configure({
|
|
49522
49527
|
playback: playbackOptions,
|
|
@@ -49574,7 +49579,7 @@ const pipIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"no
|
|
|
49574
49579
|
const buttonHtml$2 = "<button class=\"gplayer-lite-btn gcore-skin-button-color\">\n <%= pipIcon %>\n</button>\n";
|
|
49575
49580
|
|
|
49576
49581
|
const VERSION$3 = '0.0.1';
|
|
49577
|
-
const T$
|
|
49582
|
+
const T$9 = `plugins.pip`;
|
|
49578
49583
|
/**
|
|
49579
49584
|
* `PLUGIN` that enables picture in picture mode.
|
|
49580
49585
|
* @beta
|
|
@@ -49632,7 +49637,7 @@ class PictureInPicture extends UICorePlugin {
|
|
|
49632
49637
|
});
|
|
49633
49638
|
}
|
|
49634
49639
|
isPiPSupported() {
|
|
49635
|
-
trace(`${T$
|
|
49640
|
+
trace(`${T$9} isPiPSupported`, {
|
|
49636
49641
|
pictureInPictureEnabled: !!document.pictureInPictureEnabled,
|
|
49637
49642
|
requestPictureInPicture: !!HTMLVideoElement.prototype.requestPictureInPicture,
|
|
49638
49643
|
});
|
|
@@ -49653,7 +49658,7 @@ class PictureInPicture extends UICorePlugin {
|
|
|
49653
49658
|
return this;
|
|
49654
49659
|
}
|
|
49655
49660
|
togglePictureInPicture() {
|
|
49656
|
-
trace(`${T$
|
|
49661
|
+
trace(`${T$9} togglePictureInPicture`);
|
|
49657
49662
|
if (this.videoElement !== document.pictureInPictureElement) {
|
|
49658
49663
|
this.requestPictureInPicture();
|
|
49659
49664
|
}
|
|
@@ -49662,13 +49667,13 @@ class PictureInPicture extends UICorePlugin {
|
|
|
49662
49667
|
}
|
|
49663
49668
|
}
|
|
49664
49669
|
requestPictureInPicture() {
|
|
49665
|
-
trace(`${T$
|
|
49670
|
+
trace(`${T$9} requestPictureInPicture`, {
|
|
49666
49671
|
videoElement: !!this.videoElement,
|
|
49667
49672
|
});
|
|
49668
49673
|
this.videoElement.requestPictureInPicture();
|
|
49669
49674
|
}
|
|
49670
49675
|
exitPictureInPicture() {
|
|
49671
|
-
trace(`${T$
|
|
49676
|
+
trace(`${T$9} exitPictureInPicture`);
|
|
49672
49677
|
document.exitPictureInPicture();
|
|
49673
49678
|
}
|
|
49674
49679
|
}
|
|
@@ -49695,7 +49700,7 @@ const DEFAULT_PLAYBACK_RATES = [
|
|
|
49695
49700
|
{ value: 2.0, label: '2x' },
|
|
49696
49701
|
];
|
|
49697
49702
|
const DEFAULT_PLAYBACK_RATE = 1;
|
|
49698
|
-
const T$
|
|
49703
|
+
const T$8 = 'plugins.playback_rate';
|
|
49699
49704
|
/**
|
|
49700
49705
|
* `PLUGIN` that allows changing the playback speed of the video.
|
|
49701
49706
|
* @beta
|
|
@@ -49781,7 +49786,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49781
49786
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChange);
|
|
49782
49787
|
}
|
|
49783
49788
|
onCoreReady() {
|
|
49784
|
-
trace(`${T$
|
|
49789
|
+
trace(`${T$8} onCoreReady`);
|
|
49785
49790
|
const mediaControl = this.core.getPlugin('media_control');
|
|
49786
49791
|
assert(mediaControl, 'media_control plugin is required');
|
|
49787
49792
|
const gear = this.core.getPlugin('bottom_gear');
|
|
@@ -49790,7 +49795,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49790
49795
|
this.listenTo(gear, GearEvents.RENDERED, this.onGearRendered);
|
|
49791
49796
|
}
|
|
49792
49797
|
onActiveContainerChange() {
|
|
49793
|
-
trace(`${T$
|
|
49798
|
+
trace(`${T$8} onActiveContainerChange`);
|
|
49794
49799
|
this.metadataLoaded = false;
|
|
49795
49800
|
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_STOP, this.onStop);
|
|
49796
49801
|
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_PLAY, this.onPlay);
|
|
@@ -49798,15 +49803,15 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49798
49803
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_LOADEDMETADATA, this.onMetaDataLoaded);
|
|
49799
49804
|
}
|
|
49800
49805
|
onMediaControlRendered() {
|
|
49801
|
-
trace(`${T$
|
|
49806
|
+
trace(`${T$8} onMediaControlRendered`);
|
|
49802
49807
|
this.render();
|
|
49803
49808
|
}
|
|
49804
49809
|
onGearRendered() {
|
|
49805
|
-
trace(`${T$
|
|
49810
|
+
trace(`${T$8} onGearRendered`);
|
|
49806
49811
|
this.mount();
|
|
49807
49812
|
}
|
|
49808
49813
|
mount() {
|
|
49809
|
-
trace(`${T$
|
|
49814
|
+
trace(`${T$8} mount`, {
|
|
49810
49815
|
shouldMount: this.shouldMount(),
|
|
49811
49816
|
});
|
|
49812
49817
|
if (!this.shouldMount()) {
|
|
@@ -49823,7 +49828,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49823
49828
|
})));
|
|
49824
49829
|
}
|
|
49825
49830
|
onMetaDataLoaded() {
|
|
49826
|
-
trace(`${T$
|
|
49831
|
+
trace(`${T$8} onMetaDataLoaded`, {
|
|
49827
49832
|
playbackType: this.core.activePlayback.getPlaybackType(),
|
|
49828
49833
|
dvrEnabled: this.core.activePlayback.dvrEnabled,
|
|
49829
49834
|
});
|
|
@@ -49845,14 +49850,14 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49845
49850
|
this.core.activePlayback?.setPlaybackRate(this.selectedRate);
|
|
49846
49851
|
}
|
|
49847
49852
|
else {
|
|
49848
|
-
trace(`${T$
|
|
49853
|
+
trace(`${T$8} onPlaybackRateChange not steering to the selected rate, it is seemingly a catchup algorithm working`, {
|
|
49849
49854
|
playbackRate,
|
|
49850
49855
|
selectedRate: this.selectedRate,
|
|
49851
49856
|
});
|
|
49852
49857
|
}
|
|
49853
49858
|
}
|
|
49854
49859
|
shouldMount() {
|
|
49855
|
-
trace(`${T$
|
|
49860
|
+
trace(`${T$8} shouldMount`, {
|
|
49856
49861
|
playbackType: this.core.activePlayback?.getPlaybackType(),
|
|
49857
49862
|
dvrEnabled: this.core.activePlayback?.dvrEnabled,
|
|
49858
49863
|
});
|
|
@@ -49869,7 +49874,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49869
49874
|
* @internal
|
|
49870
49875
|
*/
|
|
49871
49876
|
render() {
|
|
49872
|
-
trace(`${T$
|
|
49877
|
+
trace(`${T$8} render`, {
|
|
49873
49878
|
shouldMount: this.shouldMount(),
|
|
49874
49879
|
});
|
|
49875
49880
|
this.$el.html(PlaybackRate.listTemplate({
|
|
@@ -49915,13 +49920,13 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49915
49920
|
}
|
|
49916
49921
|
}
|
|
49917
49922
|
syncRate() {
|
|
49918
|
-
trace(`${T$
|
|
49923
|
+
trace(`${T$8} syncRate`, {
|
|
49919
49924
|
selectedRate: this.selectedRate,
|
|
49920
49925
|
});
|
|
49921
49926
|
this.core.activePlayback?.setPlaybackRate(this.selectedRate);
|
|
49922
49927
|
}
|
|
49923
49928
|
resetPlaybackRate() {
|
|
49924
|
-
trace(`${T$
|
|
49929
|
+
trace(`${T$8} resetPlaybackRate`, {
|
|
49925
49930
|
selectedRate: this.selectedRate,
|
|
49926
49931
|
});
|
|
49927
49932
|
this.core.activePlayback?.setPlaybackRate(DEFAULT_PLAYBACK_RATE);
|
|
@@ -49956,7 +49961,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49956
49961
|
?.label || `x${rate}`);
|
|
49957
49962
|
}
|
|
49958
49963
|
highlightCurrentRate() {
|
|
49959
|
-
trace(`${T$
|
|
49964
|
+
trace(`${T$8} highlightCurrentRate`, {
|
|
49960
49965
|
selectedRate: this.selectedRate,
|
|
49961
49966
|
});
|
|
49962
49967
|
this.allRateElements().removeClass('current');
|
|
@@ -49967,7 +49972,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49967
49972
|
.addClass('gcore-skin-active');
|
|
49968
49973
|
}
|
|
49969
49974
|
updateGearOptionLabel() {
|
|
49970
|
-
trace(`${T$
|
|
49975
|
+
trace(`${T$8} updateGearOptionLabel`, {
|
|
49971
49976
|
selectedRate: this.selectedRate,
|
|
49972
49977
|
});
|
|
49973
49978
|
this.mount();
|
|
@@ -49979,7 +49984,7 @@ const posterHTML = "<div class=\"play-wrapper\" data-poster></div>\n";
|
|
|
49979
49984
|
//Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
49980
49985
|
// Use of this source code is governed by a BSD-style
|
|
49981
49986
|
// license that can be found in the LICENSE file.
|
|
49982
|
-
const T$
|
|
49987
|
+
const T$7 = 'plugins.poster';
|
|
49983
49988
|
/**
|
|
49984
49989
|
* `PLUGIN` that displays a poster image in the background and a big play button on top when playback is stopped
|
|
49985
49990
|
* @beta
|
|
@@ -50085,13 +50090,13 @@ class Poster extends UIContainerPlugin {
|
|
|
50085
50090
|
* Disables the plugin, unmounting it from the DOM
|
|
50086
50091
|
*/
|
|
50087
50092
|
disable() {
|
|
50088
|
-
trace(`${T$
|
|
50093
|
+
trace(`${T$7} disable`);
|
|
50089
50094
|
this.hasStartedPlaying = false;
|
|
50090
50095
|
this.playRequested = false;
|
|
50091
50096
|
super.disable();
|
|
50092
50097
|
}
|
|
50093
50098
|
onError(error) {
|
|
50094
|
-
trace(`${T$
|
|
50099
|
+
trace(`${T$7} onError`, {
|
|
50095
50100
|
error,
|
|
50096
50101
|
enabled: this.enabled,
|
|
50097
50102
|
});
|
|
@@ -50104,18 +50109,18 @@ class Poster extends UIContainerPlugin {
|
|
|
50104
50109
|
}
|
|
50105
50110
|
}
|
|
50106
50111
|
onPlay() {
|
|
50107
|
-
trace(`${T$
|
|
50112
|
+
trace(`${T$7} onPlay`);
|
|
50108
50113
|
this.hasStartedPlaying = true;
|
|
50109
50114
|
this.playRequested = false;
|
|
50110
50115
|
this.update();
|
|
50111
50116
|
}
|
|
50112
50117
|
onPlayIntent() {
|
|
50113
|
-
trace(`${T$
|
|
50118
|
+
trace(`${T$7} onPlayIntent`);
|
|
50114
50119
|
this.playRequested = true;
|
|
50115
50120
|
this.update();
|
|
50116
50121
|
}
|
|
50117
50122
|
onStop() {
|
|
50118
|
-
trace(`${T$
|
|
50123
|
+
trace(`${T$7} onStop`, {
|
|
50119
50124
|
enabled: this.enabled,
|
|
50120
50125
|
});
|
|
50121
50126
|
this.hasStartedPlaying = false;
|
|
@@ -50123,7 +50128,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50123
50128
|
this.update();
|
|
50124
50129
|
}
|
|
50125
50130
|
updatePlayButton(show) {
|
|
50126
|
-
trace(`${T$
|
|
50131
|
+
trace(`${T$7} updatePlayButton`, {
|
|
50127
50132
|
show,
|
|
50128
50133
|
chromeless: this.options.chromeless,
|
|
50129
50134
|
allowUserInteraction: this.options.allowUserInteraction,
|
|
@@ -50152,7 +50157,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50152
50157
|
this.$el.removeClass('clickable');
|
|
50153
50158
|
}
|
|
50154
50159
|
clicked() {
|
|
50155
|
-
trace(`${T$
|
|
50160
|
+
trace(`${T$7} clicked`, {
|
|
50156
50161
|
hasStartedPlaying: this.hasStartedPlaying,
|
|
50157
50162
|
chromeless: this.options.chromeless,
|
|
50158
50163
|
allowUserInteraction: this.options.allowUserInteraction,
|
|
@@ -50173,7 +50178,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50173
50178
|
return !this.container.playback.isAudioOnly;
|
|
50174
50179
|
}
|
|
50175
50180
|
update() {
|
|
50176
|
-
trace(`${T$
|
|
50181
|
+
trace(`${T$7} update`, {
|
|
50177
50182
|
shouldRender: this.shouldRender,
|
|
50178
50183
|
});
|
|
50179
50184
|
if (!this.shouldRender) {
|
|
@@ -50186,7 +50191,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50186
50191
|
this.updatePoster();
|
|
50187
50192
|
}
|
|
50188
50193
|
updatePoster() {
|
|
50189
|
-
trace(`${T$
|
|
50194
|
+
trace(`${T$7} updatePoster`, {
|
|
50190
50195
|
hasStartedPlaying: this.hasStartedPlaying,
|
|
50191
50196
|
});
|
|
50192
50197
|
if (!this.hasStartedPlaying) {
|
|
@@ -50201,7 +50206,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50201
50206
|
this.$el.show();
|
|
50202
50207
|
}
|
|
50203
50208
|
hidePoster() {
|
|
50204
|
-
trace(`${T$
|
|
50209
|
+
trace(`${T$7} hidePoster`, {
|
|
50205
50210
|
shouldHideOnPlay: this.shouldHideOnPlay(),
|
|
50206
50211
|
});
|
|
50207
50212
|
if (!this.options.disableMediaControl) {
|
|
@@ -50251,13 +50256,13 @@ class Poster extends UIContainerPlugin {
|
|
|
50251
50256
|
}
|
|
50252
50257
|
}
|
|
50253
50258
|
|
|
50254
|
-
const buttonHtml = "<button class='gplayer-lite-btn gcore-skin-text-color gear-option' aria-haspopup=\"menu\">\n <span class=\"gear-option_icon<%= isHd ? '' : ' hidden' %>\"><%= hdIcon %></span>\n <span class=\"gear-option_label\"><%= i18n.t('quality') %></span>\n <span class='gear-option_value'><%= currentText %></span>\n <span class=\"gear-option_arrow-right-icon\"><%= arrowRightIcon %></span>\n</button>\n";
|
|
50259
|
+
const buttonHtml = "<button class='gplayer-lite-btn gcore-skin-text-color gear-option' aria-haspopup=\"menu\" id=\"quality-levels\">\n <span class=\"gear-option_icon<%= isHd ? '' : ' hidden' %>\"><%= hdIcon %></span>\n <span class=\"gear-option_label\"><%= i18n.t('quality') %></span>\n <span class='gear-option_value'><%= currentText %></span>\n <span class=\"gear-option_arrow-right-icon\"><%= arrowRightIcon %></span>\n</button>\n";
|
|
50255
50260
|
|
|
50256
50261
|
const listHtml = "<button class=\"gplayer-lite-btn go-back gcore-skin-text-color\" id=\"level-selector-back-button\">\n <span class=\"arrow-left-icon\"><%= arrowLeftIcon %></span>\n <%= i18n.t('quality') %>\n</button>\n<ul class=\"gear-sub-menu quality-levels\" id=\"level-selector-menu\" role=\"menu\">\n <% if (!removeAuto) { %>\n <li>\n <a href=\"#\"\n class=\"gear-sub-menu_btn gcore-skin-text-color\"\n data-id=\"-1\"\n id=\"level_selector_auto\"\n aria-checked=\"<%= current === -1 %>\"\n role=\"menuitemradio\"\n >\n <span class=\"check-icon\"><%= checkIcon %></span>\n <%= i18n.t('auto') %>\n </a>\n </li>\n <% } %>\n <% for (const item of levels.slice().reverse()) {\n var disabled = maxLevel >= 0 && item.level > maxLevel\n var checked = item.level === current\n %>\n <li class=\"<%= disabled ? ' disabled' : ''%><%=checked ? ' current' : ''%>\">\n <a href=\"#\"\n class=\"gear-sub-menu_btn gcore-skin-text-color<%= checked ? ' gcore-skin-active' : '' %>\"\n data-id=\"<%= item.level %>\"\n aria-disabled=\"<%= disabled %>\"\n aria-checked=\"<%= checked %>\"\n role=\"menuitemradio\"\n id=\"level_selector_<%= item.width > item.height ? item.height : item.width %>\"\n >\n <span class=\"check-icon\"><%= checkIcon %></span>\n <%= labels[item.level] %>\n </a>\n </li>\n <% } %>\n</ul>\n";
|
|
50257
50262
|
|
|
50258
50263
|
const hdIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M14.9562 8.22232H13.9961V15.1873H14.9562C15.8914 15.1873 16.766 14.8253 17.4195 14.1676C18.0786 13.5037 18.4415 12.6281 18.4415 11.7026C18.4415 9.7837 16.8781 8.22253 14.9561 8.22253L14.9562 8.22232Z\"\n fill=\"#C9C9C9\"/>\n <path\n d=\"M22.0801 4H1.91994C0.859222 4 0 4.86406 0 5.91994V17.4878C0 18.5437 0.859222 19.4078 1.91994 19.4078H22.0801C23.1408 19.4078 24 18.5437 24 17.4878V5.91994C24 4.86406 23.1408 4 22.0801 4ZM10.3975 15.3473C10.3975 15.6124 10.1827 15.8272 9.91754 15.8272C9.65216 15.8272 9.43761 15.6122 9.43761 15.3473V12.0239H5.55956V15.3473C5.55956 15.6124 5.34481 15.8272 5.07963 15.8272C4.81425 15.8272 4.5997 15.6122 4.5997 15.3473L4.59949 7.74042C4.59949 7.47524 4.81425 7.26049 5.07943 7.26049C5.34481 7.26049 5.55936 7.47544 5.55936 7.74042V11.0636H9.43741V7.74042C9.43741 7.47524 9.65216 7.26049 9.91734 7.26049C10.1827 7.26049 10.3973 7.47544 10.3973 7.74042L10.3975 15.3473ZM18.1005 14.8438C17.2652 15.6844 16.1486 16.1472 14.9561 16.1472H13.5161C13.2507 16.1472 13.0361 15.9323 13.0361 15.6673V7.74263C13.0361 7.47745 13.2509 7.26269 13.5161 7.26269H14.9561C17.4072 7.26269 19.4013 9.25438 19.4013 11.7027C19.4013 12.8835 18.9392 13.9991 18.1005 14.844V14.8438Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
|
|
50259
50264
|
|
|
50260
|
-
const T$
|
|
50265
|
+
const T$6 = 'plugins.quality_levels';
|
|
50261
50266
|
const VERSION$2 = 'v2.22.5';
|
|
50262
50267
|
/**
|
|
50263
50268
|
* `PLUGIN` that provides a UI to select the desired quality level of the playback.
|
|
@@ -50334,14 +50339,14 @@ class QualityLevels extends UICorePlugin {
|
|
|
50334
50339
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChange);
|
|
50335
50340
|
}
|
|
50336
50341
|
onCoreReady() {
|
|
50337
|
-
trace(`${T$
|
|
50342
|
+
trace(`${T$6} onCoreReady`);
|
|
50338
50343
|
const gear = this.core.getPlugin('bottom_gear');
|
|
50339
50344
|
assert(gear, 'bottom_gear plugin is required');
|
|
50340
50345
|
this.currentText = this.core.i18n.t('auto');
|
|
50341
50346
|
this.listenTo(gear, GearEvents.RENDERED, this.onGearRendered);
|
|
50342
50347
|
}
|
|
50343
50348
|
onGearRendered() {
|
|
50344
|
-
trace(`${T$
|
|
50349
|
+
trace(`${T$6} onGearRendered`);
|
|
50345
50350
|
this.render();
|
|
50346
50351
|
}
|
|
50347
50352
|
onActiveContainerChange() {
|
|
@@ -50370,7 +50375,7 @@ class QualityLevels extends UICorePlugin {
|
|
|
50370
50375
|
}
|
|
50371
50376
|
}
|
|
50372
50377
|
onStop() {
|
|
50373
|
-
trace(`${T$
|
|
50378
|
+
trace(`${T$6} onStop`);
|
|
50374
50379
|
this.listenToOnce(this.core.activePlayback, Events$1.PLAYBACK_PLAY, () => {
|
|
50375
50380
|
if (this.core.activePlayback.getPlaybackType() === 'live') {
|
|
50376
50381
|
if (this.selectedLevelId !== -1) {
|
|
@@ -50466,7 +50471,7 @@ class QualityLevels extends UICorePlugin {
|
|
|
50466
50471
|
return false;
|
|
50467
50472
|
}
|
|
50468
50473
|
goBack() {
|
|
50469
|
-
trace(`${T$
|
|
50474
|
+
trace(`${T$6} goBack`);
|
|
50470
50475
|
this.core.getPlugin('bottom_gear').refresh();
|
|
50471
50476
|
}
|
|
50472
50477
|
setLevel(index) {
|
|
@@ -50501,11 +50506,11 @@ class QualityLevels extends UICorePlugin {
|
|
|
50501
50506
|
return this.levelLabels[index] ?? formatLevelLabel(this.levels[index]);
|
|
50502
50507
|
}
|
|
50503
50508
|
onBitrate(info) {
|
|
50504
|
-
trace(`${T$
|
|
50509
|
+
trace(`${T$6} updateCurrentLevel`, { info });
|
|
50505
50510
|
this.highlightCurrentLevel();
|
|
50506
50511
|
}
|
|
50507
50512
|
highlightCurrentLevel() {
|
|
50508
|
-
trace(`${T$
|
|
50513
|
+
trace(`${T$6} highlightCurrentLevel`, {
|
|
50509
50514
|
selectedLevelId: this.selectedLevelId,
|
|
50510
50515
|
});
|
|
50511
50516
|
this.allLevelElements()
|
|
@@ -50905,7 +50910,7 @@ const spinnerHTML = "<div data-bounce1></div>\n<div data-bounce2></div>\n<div da
|
|
|
50905
50910
|
// Use of this source code is governed by a BSD-style
|
|
50906
50911
|
// license that can be found in the LICENSE file.
|
|
50907
50912
|
// https://github.com/clappr/clappr-plugins/blob/ffaa9d27005fa5a8a7c243ffc47eb5655b84b371/LICENSE
|
|
50908
|
-
const T$
|
|
50913
|
+
const T$5 = 'plugins.spinner';
|
|
50909
50914
|
/**
|
|
50910
50915
|
* Custom events emitted by the plugin
|
|
50911
50916
|
* @public
|
|
@@ -50975,18 +50980,18 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
50975
50980
|
this.hasBuffering = false;
|
|
50976
50981
|
}
|
|
50977
50982
|
onPlay() {
|
|
50978
|
-
trace(`${T$
|
|
50983
|
+
trace(`${T$5} onPlay`);
|
|
50979
50984
|
this._hide();
|
|
50980
50985
|
}
|
|
50981
50986
|
onStop() {
|
|
50982
|
-
trace(`${T$
|
|
50987
|
+
trace(`${T$5} onStop`, {
|
|
50983
50988
|
hasFatalError: this.hasFatalError,
|
|
50984
50989
|
});
|
|
50985
50990
|
this._hide();
|
|
50986
50991
|
}
|
|
50987
50992
|
onError(e) {
|
|
50988
50993
|
this.hasFatalError = e.code === PlaybackErrorCode.MediaSourceUnavailable;
|
|
50989
|
-
trace(`${T$
|
|
50994
|
+
trace(`${T$5} onError`, {
|
|
50990
50995
|
e,
|
|
50991
50996
|
hasFatalError: this.hasFatalError,
|
|
50992
50997
|
error: e.code,
|
|
@@ -51001,7 +51006,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
51001
51006
|
* @param delay - The delay in milliseconds before the spinner is shown.
|
|
51002
51007
|
*/
|
|
51003
51008
|
show(delay = 300) {
|
|
51004
|
-
trace(`${T$
|
|
51009
|
+
trace(`${T$5} show`);
|
|
51005
51010
|
this.userShown = true;
|
|
51006
51011
|
this._show(delay);
|
|
51007
51012
|
}
|
|
@@ -51021,7 +51026,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
51021
51026
|
}
|
|
51022
51027
|
}
|
|
51023
51028
|
_hide() {
|
|
51024
|
-
trace(`${T$
|
|
51029
|
+
trace(`${T$5} _hide`, {
|
|
51025
51030
|
userShown: this.userShown,
|
|
51026
51031
|
});
|
|
51027
51032
|
if (this.userShown) {
|
|
@@ -51038,7 +51043,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
51038
51043
|
* @internal
|
|
51039
51044
|
*/
|
|
51040
51045
|
render() {
|
|
51041
|
-
trace(`${T$
|
|
51046
|
+
trace(`${T$5} render`, {
|
|
51042
51047
|
buffering: this.container.buffering,
|
|
51043
51048
|
});
|
|
51044
51049
|
this.$el.html(this.template());
|
|
@@ -51056,7 +51061,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
51056
51061
|
}
|
|
51057
51062
|
}
|
|
51058
51063
|
|
|
51059
|
-
const T$
|
|
51064
|
+
const T$4 = 'plugins.source_controller';
|
|
51060
51065
|
const INITIAL_RETRY_DELAY = 1000;
|
|
51061
51066
|
const MAX_RETRY_DELAY = 5000;
|
|
51062
51067
|
const RETRY_DELAY_BLUR = 500;
|
|
@@ -51198,11 +51203,11 @@ class SourceController extends CorePlugin {
|
|
|
51198
51203
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
51199
51204
|
}
|
|
51200
51205
|
onCoreReady() {
|
|
51201
|
-
trace(`${T$
|
|
51206
|
+
trace(`${T$4} onCoreReady`);
|
|
51202
51207
|
this.core.getPlugin('error_screen')?.disable(); // TODO test
|
|
51203
51208
|
}
|
|
51204
51209
|
onActiveContainerChanged() {
|
|
51205
|
-
trace(`${T$
|
|
51210
|
+
trace(`${T$4} onActiveContainerChanged`, {
|
|
51206
51211
|
retrying: this.active,
|
|
51207
51212
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
51208
51213
|
});
|
|
@@ -51223,7 +51228,7 @@ class SourceController extends CorePlugin {
|
|
|
51223
51228
|
}
|
|
51224
51229
|
bindContainerEventListeners() {
|
|
51225
51230
|
this.core.activePlayback.on(Events$1.PLAYBACK_ERROR, (error) => {
|
|
51226
|
-
trace(`${T$
|
|
51231
|
+
trace(`${T$4} on PLAYBACK_ERROR`, {
|
|
51227
51232
|
error: {
|
|
51228
51233
|
code: error?.code,
|
|
51229
51234
|
description: error?.description,
|
|
@@ -51244,7 +51249,7 @@ class SourceController extends CorePlugin {
|
|
|
51244
51249
|
}
|
|
51245
51250
|
});
|
|
51246
51251
|
this.core.activePlayback.on(Events$1.PLAYBACK_PLAY, () => {
|
|
51247
|
-
trace(`${T$
|
|
51252
|
+
trace(`${T$4} on PLAYBACK_PLAY`, {
|
|
51248
51253
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
51249
51254
|
retrying: this.active,
|
|
51250
51255
|
});
|
|
@@ -51260,7 +51265,7 @@ class SourceController extends CorePlugin {
|
|
|
51260
51265
|
this.sourcesDelay = {};
|
|
51261
51266
|
}
|
|
51262
51267
|
retryPlayback() {
|
|
51263
|
-
trace(`${T$
|
|
51268
|
+
trace(`${T$4} retryPlayback enter`, {
|
|
51264
51269
|
currentSourceIndex: this.currentSourceIndex,
|
|
51265
51270
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
51266
51271
|
});
|
|
@@ -51268,20 +51273,20 @@ class SourceController extends CorePlugin {
|
|
|
51268
51273
|
this.switching = true;
|
|
51269
51274
|
this.core.activeContainer?.getPlugin('spinner')?.show(0);
|
|
51270
51275
|
this.getNextMediaSource().then((nextSource) => {
|
|
51271
|
-
trace(`${T$
|
|
51276
|
+
trace(`${T$4} retryPlayback syncing...`, {
|
|
51272
51277
|
nextSource,
|
|
51273
51278
|
});
|
|
51274
51279
|
const rnd = RETRY_DELAY_BLUR * Math.random();
|
|
51275
51280
|
this.sync(() => {
|
|
51276
|
-
trace(`${T$
|
|
51281
|
+
trace(`${T$4} retryPlayback loading...`);
|
|
51277
51282
|
this.switching = false;
|
|
51278
51283
|
this.core.load(nextSource.source, nextSource.mimeType);
|
|
51279
|
-
trace(`${T$
|
|
51284
|
+
trace(`${T$4} retryPlayback loaded`, {
|
|
51280
51285
|
nextSource,
|
|
51281
51286
|
});
|
|
51282
51287
|
setTimeout(() => {
|
|
51283
51288
|
this.core.activePlayback.play();
|
|
51284
|
-
trace(`${T$
|
|
51289
|
+
trace(`${T$4} retryPlayback playing`);
|
|
51285
51290
|
}, rnd);
|
|
51286
51291
|
});
|
|
51287
51292
|
});
|
|
@@ -51314,7 +51319,7 @@ const stringHTML = "<div class=\"cc-line\" id=\"cc-line\">\n <p></p>\n</div>\n"
|
|
|
51314
51319
|
|
|
51315
51320
|
const VERSION = '2.19.14';
|
|
51316
51321
|
const LOCAL_STORAGE_CC_ID = 'gplayer.plugins.cc.selected';
|
|
51317
|
-
const T$
|
|
51322
|
+
const T$3 = 'plugins.cc';
|
|
51318
51323
|
/**
|
|
51319
51324
|
* `PLUGIN` that provides a UI to select the subtitles when available.
|
|
51320
51325
|
* @beta
|
|
@@ -51397,14 +51402,14 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51397
51402
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
|
|
51398
51403
|
}
|
|
51399
51404
|
onCoreReady() {
|
|
51400
|
-
trace(`${T$
|
|
51405
|
+
trace(`${T$3} onCoreReady`);
|
|
51401
51406
|
const mediaControl = this.core.getPlugin('media_control');
|
|
51402
51407
|
assert(mediaControl, 'media_control plugin is required');
|
|
51403
51408
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.render);
|
|
51404
51409
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.hideMenu);
|
|
51405
51410
|
}
|
|
51406
51411
|
onContainerChanged() {
|
|
51407
|
-
trace(`${T$
|
|
51412
|
+
trace(`${T$3} onContainerChanged`);
|
|
51408
51413
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_FULLSCREEN, this.playerResize);
|
|
51409
51414
|
this.listenTo(this.core.activeContainer, 'container:advertisement:start', this.onStartAd);
|
|
51410
51415
|
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_SUBTITLE_AVAILABLE, this.onSubtitleAvailable);
|
|
@@ -51424,11 +51429,11 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51424
51429
|
});
|
|
51425
51430
|
}
|
|
51426
51431
|
onSubtitleAvailable() {
|
|
51427
|
-
trace(`${T$
|
|
51432
|
+
trace(`${T$3} onSubtitleAvailable`);
|
|
51428
51433
|
this.applyTracks();
|
|
51429
51434
|
}
|
|
51430
51435
|
onSubtitleChanged({ id }) {
|
|
51431
|
-
trace(`${T$
|
|
51436
|
+
trace(`${T$3} onSubtitleChanged`, { id });
|
|
51432
51437
|
if (id === -1) {
|
|
51433
51438
|
this.clearSubtitleText();
|
|
51434
51439
|
}
|
|
@@ -51478,7 +51483,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51478
51483
|
this.stopListening(this.core.activeContainer, 'container:advertisement:finish', this.onFinishAd);
|
|
51479
51484
|
}
|
|
51480
51485
|
playerResize() {
|
|
51481
|
-
trace(`${T$
|
|
51486
|
+
trace(`${T$3} playerResize`);
|
|
51482
51487
|
const shouldShow = this.core.activeContainer &&
|
|
51483
51488
|
isFullscreen(this.core.activeContainer.el) &&
|
|
51484
51489
|
this.track &&
|
|
@@ -51568,7 +51573,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51568
51573
|
}
|
|
51569
51574
|
onItemSelect(event) {
|
|
51570
51575
|
const id = event.target.dataset.ccSelect ?? '-1';
|
|
51571
|
-
trace(`${T$
|
|
51576
|
+
trace(`${T$3} onItemSelect`, { id });
|
|
51572
51577
|
localStorage.setItem(LOCAL_STORAGE_CC_ID, id);
|
|
51573
51578
|
this.selectItem(this.findById(Number(id)));
|
|
51574
51579
|
return false;
|
|
@@ -51588,7 +51593,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51588
51593
|
this.$('[data-cc] ul').hide();
|
|
51589
51594
|
}
|
|
51590
51595
|
toggleMenu() {
|
|
51591
|
-
trace(`${T$
|
|
51596
|
+
trace(`${T$3} toggleMenu`);
|
|
51592
51597
|
this.$('[data-cc] ul').toggle();
|
|
51593
51598
|
}
|
|
51594
51599
|
itemElement(id) {
|
|
@@ -51635,7 +51640,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51635
51640
|
.removeClass('current')
|
|
51636
51641
|
.find('a')
|
|
51637
51642
|
.removeClass('gcore-skin-active');
|
|
51638
|
-
trace(`${T$
|
|
51643
|
+
trace(`${T$3} highlightCurrentSubtitles`, {
|
|
51639
51644
|
track: this.track?.id,
|
|
51640
51645
|
});
|
|
51641
51646
|
const currentLevelElement = this.itemElement(this.track ? this.track.id : -1);
|
|
@@ -51653,7 +51658,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51653
51658
|
// An example implementation of client side performancestatistics
|
|
51654
51659
|
const WATCH_CUTOFF = 5;
|
|
51655
51660
|
const STALL_MEASURE_PERIOD = 10;
|
|
51656
|
-
const T$
|
|
51661
|
+
const T$2 = 'plugins.telemetry';
|
|
51657
51662
|
/**
|
|
51658
51663
|
* Telemetry event type
|
|
51659
51664
|
* @beta
|
|
@@ -51763,7 +51768,7 @@ class Telemetry extends ContainerPlugin {
|
|
|
51763
51768
|
}
|
|
51764
51769
|
onReady() {
|
|
51765
51770
|
this.sendInit();
|
|
51766
|
-
trace(`${T$
|
|
51771
|
+
trace(`${T$2} onReady`, {
|
|
51767
51772
|
autoPlay: this.options.autoPlay,
|
|
51768
51773
|
});
|
|
51769
51774
|
if (this.options.autoPlay) {
|
|
@@ -51944,7 +51949,7 @@ const parseSRT = /*@__PURE__*/getDefaultExportFromCjs$1(parseSrtExports);
|
|
|
51944
51949
|
|
|
51945
51950
|
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";
|
|
51946
51951
|
|
|
51947
|
-
const T = 'plugins.thumbnails';
|
|
51952
|
+
const T$1 = 'plugins.thumbnails';
|
|
51948
51953
|
/**
|
|
51949
51954
|
* `PLUGIN` that displays the thumbnails of the video when available.
|
|
51950
51955
|
* @beta
|
|
@@ -52249,7 +52254,7 @@ class Thumbnails extends UICorePlugin {
|
|
|
52249
52254
|
// calculate how far along the carousel should currently be slid
|
|
52250
52255
|
// depending on where the user is hovering on the progress bar
|
|
52251
52256
|
_updateCarousel() {
|
|
52252
|
-
trace(`${T} _updateCarousel`, {
|
|
52257
|
+
trace(`${T$1} _updateCarousel`, {
|
|
52253
52258
|
backdropHeight: this._getOptions().backdropHeight,
|
|
52254
52259
|
});
|
|
52255
52260
|
if (!this._getOptions().backdropHeight) {
|
|
@@ -52308,7 +52313,7 @@ class Thumbnails extends UICorePlugin {
|
|
|
52308
52313
|
}
|
|
52309
52314
|
}
|
|
52310
52315
|
_updateSpotlightThumb() {
|
|
52311
|
-
trace(`${T} _updateSpotlightThumb`, {
|
|
52316
|
+
trace(`${T$1} _updateSpotlightThumb`, {
|
|
52312
52317
|
spotlightHeight: this._getOptions().spotlightHeight,
|
|
52313
52318
|
});
|
|
52314
52319
|
if (!this._getOptions().spotlightHeight) {
|
|
@@ -52353,7 +52358,7 @@ class Thumbnails extends UICorePlugin {
|
|
|
52353
52358
|
return 0;
|
|
52354
52359
|
}
|
|
52355
52360
|
_renderPlugin() {
|
|
52356
|
-
trace(`${T} _renderPlugin`, {
|
|
52361
|
+
trace(`${T$1} _renderPlugin`, {
|
|
52357
52362
|
show: this._show,
|
|
52358
52363
|
thumbsLoaded: this._thumbsLoaded,
|
|
52359
52364
|
thumbs: this._thumbs.length,
|
|
@@ -52371,7 +52376,7 @@ class Thumbnails extends UICorePlugin {
|
|
|
52371
52376
|
}
|
|
52372
52377
|
}
|
|
52373
52378
|
_createElements() {
|
|
52374
|
-
trace(`${T} _createElements`);
|
|
52379
|
+
trace(`${T$1} _createElements`);
|
|
52375
52380
|
this.$el.html(Thumbnails.template({
|
|
52376
52381
|
backdropHeight: this._getOptions().backdropHeight,
|
|
52377
52382
|
spotlightHeight: this._getOptions().spotlightHeight,
|
|
@@ -52394,100 +52399,101 @@ var VolumeFadeEvents;
|
|
|
52394
52399
|
(function (VolumeFadeEvents) {
|
|
52395
52400
|
VolumeFadeEvents["FADE"] = "core:volume:fade";
|
|
52396
52401
|
})(VolumeFadeEvents || (VolumeFadeEvents = {}));
|
|
52402
|
+
const T = 'plugins.volume_fade';
|
|
52403
|
+
const DEFAULT_DURATION = 600;
|
|
52397
52404
|
/**
|
|
52398
52405
|
* `PLUGIN` that applies fade effect to the player's volume change.
|
|
52399
52406
|
* @beta
|
|
52407
|
+
*
|
|
52408
|
+
* @remarks
|
|
52409
|
+
* Depends on {@link MediaControl} plugin.
|
|
52410
|
+
* Configuration options - {@link VolumeFadeSettings}
|
|
52400
52411
|
*/
|
|
52401
52412
|
class VolumeFade extends UICorePlugin {
|
|
52402
|
-
|
|
52403
|
-
|
|
52404
|
-
|
|
52405
|
-
interval = null;
|
|
52413
|
+
activeVolume = 0;
|
|
52414
|
+
duration = 0;
|
|
52415
|
+
timerId = null;
|
|
52406
52416
|
/**
|
|
52407
52417
|
* @internal
|
|
52408
52418
|
*/
|
|
52409
52419
|
get name() {
|
|
52410
52420
|
return 'volume_fade';
|
|
52411
52421
|
}
|
|
52422
|
+
constructor(core) {
|
|
52423
|
+
super(core);
|
|
52424
|
+
if (typeof this.options.volumeFade?.level === 'number') {
|
|
52425
|
+
this.activeVolume = this.options.volumeFade.level;
|
|
52426
|
+
}
|
|
52427
|
+
}
|
|
52412
52428
|
/**
|
|
52413
52429
|
* @internal
|
|
52414
52430
|
*/
|
|
52415
52431
|
bindEvents() {
|
|
52416
|
-
// TODO on container changed
|
|
52417
52432
|
this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
52418
|
-
if (this.core.mediaControl) {
|
|
52419
|
-
this.listenTo(this.core.mediaControl, 'mediacontrol:volume:user', this._onUserChangeVolume);
|
|
52420
|
-
}
|
|
52421
|
-
// this.listenTo(this.core, 'core:volume:config', this._onVolumeConfig);
|
|
52422
|
-
}
|
|
52423
|
-
unBindEvents() {
|
|
52424
|
-
this.core.$el.off('mouseleave.volume');
|
|
52425
|
-
this.core.$el.off('mouseenter.volume');
|
|
52426
|
-
}
|
|
52427
|
-
_onUserChangeVolume(volume) {
|
|
52428
|
-
this._aboveBorderVolume = volume;
|
|
52429
|
-
}
|
|
52430
|
-
_onVolumeConfig(value) {
|
|
52431
|
-
this._aboveBorderVolume = value;
|
|
52432
|
-
this.container?.setVolume(0);
|
|
52433
52433
|
}
|
|
52434
52434
|
onCoreReady() {
|
|
52435
|
-
this.
|
|
52436
|
-
|
|
52437
|
-
if (this.core && this.core.$el) {
|
|
52438
|
-
// TODO find out why options.playerElement instead of this.core.$el or this.container.$el
|
|
52439
|
-
$(this.options.playerElement).on('mouseenter.volume', () => {
|
|
52440
|
-
this.onEnter();
|
|
52441
|
-
});
|
|
52442
|
-
$(this.options.playerElement).on('mouseleave.volume', () => {
|
|
52443
|
-
this.onLeave();
|
|
52444
|
-
});
|
|
52445
|
-
}
|
|
52446
|
-
if (!this._aboveBorderVolume) {
|
|
52447
|
-
this._aboveBorderVolume = this.container?.volume && !isNaN(this.container.volume) ? this.container.volume : 80;
|
|
52448
|
-
}
|
|
52449
|
-
if (this.options.mute || Browser.isMobile) {
|
|
52435
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
52436
|
+
if (Browser.isMobile) {
|
|
52450
52437
|
this.destroy();
|
|
52451
52438
|
return;
|
|
52452
52439
|
}
|
|
52453
|
-
|
|
52454
|
-
|
|
52440
|
+
if (mediaControl) {
|
|
52441
|
+
this.listenTo(mediaControl, ExtendedEvents.MEDIACONTROL_VOLUME, this.onVolumeChange);
|
|
52442
|
+
}
|
|
52443
|
+
$(this.core.$el).on('mouseenter', () => this.onEnter());
|
|
52444
|
+
$(this.core.$el).on('mouseleave', () => this.onLeave());
|
|
52445
|
+
if (!this.activeVolume) {
|
|
52446
|
+
this.activeVolume =
|
|
52447
|
+
this.core.activeContainer?.volume &&
|
|
52448
|
+
!isNaN(this.core.activeContainer.volume)
|
|
52449
|
+
? this.core.activeContainer.volume
|
|
52450
|
+
: 80;
|
|
52451
|
+
}
|
|
52452
|
+
this.duration = this.options.volumeFade?.duration || DEFAULT_DURATION;
|
|
52453
|
+
// TODO check if mute must be respected
|
|
52454
|
+
this.core.activeContainer?.setVolume(this.activeVolume);
|
|
52455
|
+
this.core.activePlayback.volume(0);
|
|
52456
|
+
}
|
|
52457
|
+
onVolumeChange(volume) {
|
|
52458
|
+
trace(`${T} onVolumeChange`, { volume });
|
|
52459
|
+
this.activeVolume = volume;
|
|
52455
52460
|
}
|
|
52456
52461
|
onEnter() {
|
|
52457
|
-
|
|
52462
|
+
trace(`${T} onEnter`);
|
|
52463
|
+
this.fade(this.duration, 1);
|
|
52458
52464
|
}
|
|
52459
|
-
|
|
52460
|
-
|
|
52465
|
+
onLeave() {
|
|
52466
|
+
trace(`${T} onLeave`);
|
|
52467
|
+
this.fade(this.duration, 0);
|
|
52468
|
+
}
|
|
52469
|
+
fade(duration, to) {
|
|
52470
|
+
this.stopFade();
|
|
52461
52471
|
const start = new Date().getTime();
|
|
52462
|
-
|
|
52463
|
-
|
|
52464
|
-
|
|
52465
|
-
|
|
52466
|
-
|
|
52467
|
-
const
|
|
52472
|
+
const from = 1 - to;
|
|
52473
|
+
this.timerId = setInterval(() => {
|
|
52474
|
+
const delta = new Date().getTime() - start;
|
|
52475
|
+
const progress = Math.min(1, delta / duration);
|
|
52476
|
+
const normVol = progress * to + (1 - progress) * from;
|
|
52477
|
+
const volume = normVol * this.activeVolume;
|
|
52478
|
+
this.core.activePlayback.volume(volume);
|
|
52468
52479
|
try {
|
|
52469
|
-
this.
|
|
52470
|
-
this.core.trigger(VolumeFadeEvents.FADE, progress * this._aboveBorderVolume);
|
|
52480
|
+
this.core.trigger(VolumeFadeEvents.FADE, volume);
|
|
52471
52481
|
}
|
|
52472
52482
|
catch (error) {
|
|
52473
|
-
// LogManager.exception(error);
|
|
52474
52483
|
reportError(error);
|
|
52475
|
-
this.clearCurrentInterval();
|
|
52476
52484
|
}
|
|
52477
|
-
if (progress >= 1
|
|
52478
|
-
this.
|
|
52485
|
+
if (progress >= 1) {
|
|
52486
|
+
this.stopFade();
|
|
52479
52487
|
}
|
|
52480
52488
|
}, 10);
|
|
52481
52489
|
}
|
|
52482
|
-
|
|
52483
|
-
|
|
52484
|
-
|
|
52485
|
-
this.
|
|
52490
|
+
stopFade() {
|
|
52491
|
+
trace(`${T} stopFade`);
|
|
52492
|
+
if (this.timerId !== null) {
|
|
52493
|
+
clearInterval(this.timerId);
|
|
52494
|
+
this.timerId = null;
|
|
52486
52495
|
}
|
|
52487
52496
|
}
|
|
52488
|
-
onLeave() {
|
|
52489
|
-
this.numberTo(this.delay, 1);
|
|
52490
|
-
}
|
|
52491
52497
|
}
|
|
52492
52498
|
|
|
52493
|
-
export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, NerdStats as ClapprNerdStats, ClapprStats, ClapprStatsChronograph, ClapprStatsCounter, ClapprStatsEvents, ClickToPause, Clips, ClosedCaptions, ContextMenu, DvrControls, ErrorScreen, Favicon, GearEvents, GoogleAnalytics, QualityLevels as LevelSelector, LogTracer, Logger, Logo, MediaControl, MultiCamera, NerdStats, PictureInPicture, PlaybackErrorCode, PlaybackRate, Player, PlayerEvent, Poster, QualityLevels, SeekTime, SentryTracer, Share, SkipTime, SourceController, SpinnerThreeBounce as Spinner, SpinnerEvents, SpinnerThreeBounce, ClosedCaptions as Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents, reportError, setTracer, trace, version };
|
|
52499
|
+
export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, NerdStats as ClapprNerdStats, ClapprStats, ClapprStatsChronograph, ClapprStatsCounter, ClapprStatsEvents, ClickToPause, Clips, ClosedCaptions, ContextMenu, DvrControls, ErrorScreen, ExtendedEvents, Favicon, GearEvents, GoogleAnalytics, QualityLevels as LevelSelector, LogTracer, Logger, Logo, MediaControl, MultiCamera, NerdStats, PictureInPicture, PlaybackErrorCode, PlaybackRate, Player, PlayerEvent, Poster, QualityLevels, SeekTime, SentryTracer, Share, SkipTime, SourceController, SpinnerThreeBounce as Spinner, SpinnerEvents, SpinnerThreeBounce, ClosedCaptions as Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents, reportError, setTracer, trace, version };
|