@gcorevideo/player 2.22.29 → 2.22.31
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/media-control/container.scss +2 -3
- package/assets/poster/poster.ejs +3 -1
- package/assets/poster/poster.scss +3 -3
- package/assets/skip-time/skip-time.ejs +4 -4
- package/assets/skip-time/style.scss +4 -4
- package/assets/style/main.scss +1 -1
- package/dist/core.js +1 -1
- package/dist/index.css +573 -574
- package/dist/index.js +225 -230
- package/dist/player.d.ts +63 -33
- package/docs/api/{player.seektime.bindevents.md → player.clapprstats.clearmetrics.md} +3 -3
- package/docs/api/player.clapprstats.md +14 -0
- package/docs/api/player.extendedevents.md +14 -0
- package/docs/api/player.md +13 -2
- package/docs/api/player.seektime.attributes.md +0 -1
- package/docs/api/player.seektime.md +6 -197
- package/docs/api/{player.seektime.render.md → player.seektimesettings.md} +7 -7
- package/docs/api/player.skiptime.md +3 -184
- package/lib/plugins/poster/Poster.d.ts +24 -14
- package/lib/plugins/poster/Poster.d.ts.map +1 -1
- package/lib/plugins/poster/Poster.js +67 -97
- package/lib/plugins/skip-time/SkipTime.d.ts +25 -11
- package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -1
- package/lib/plugins/skip-time/SkipTime.js +43 -17
- package/lib/testUtils.d.ts +13 -39
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +14 -65
- package/package.json +1 -1
- package/src/plugins/poster/Poster.ts +91 -110
- package/src/plugins/poster/__tests__/Poster.test.ts +119 -0
- package/src/plugins/poster/__tests__/__snapshots__/Poster.test.ts.snap +8 -0
- package/src/plugins/skip-time/SkipTime.ts +52 -25
- package/src/plugins/source-controller/__tests__/SourceController.test.ts +1 -2
- package/src/testUtils.ts +14 -86
- package/temp/player.api.json +295 -829
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.seektime.durationshown.md +0 -14
- package/docs/api/player.seektime.getseektime.md +0 -20
- package/docs/api/player.seektime.islivestreamwithdvr.md +0 -14
- package/docs/api/player.seektime.mediacontrol.md +0 -14
- package/docs/api/player.seektime.mediacontrolcontainer.md +0 -14
- package/docs/api/player.seektime.shouldbevisible.md +0 -18
- package/docs/api/player.seektime.template.md +0 -14
- package/docs/api/player.seektime.update.md +0 -18
- package/docs/api/player.skiptime.attributes.md +0 -17
- package/docs/api/player.skiptime.bindevents.md +0 -18
- package/docs/api/player.skiptime.events.md +0 -18
- package/docs/api/player.skiptime.handlerewindclicks.md +0 -18
- package/docs/api/player.skiptime.render.md +0 -18
- package/docs/api/player.skiptime.setback.md +0 -18
- package/docs/api/player.skiptime.setforward.md +0 -18
- package/docs/api/player.skiptime.setmidclick.md +0 -18
- package/docs/api/player.skiptime.template.md +0 -14
- package/docs/api/player.skiptime.togglefullscreen.md +0 -18
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$n = '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$n} _onPlaybackError`, { event });
|
|
12959
12959
|
};
|
|
12960
12960
|
_onDASHJSSError = (event) => {
|
|
12961
|
-
trace(`${T$
|
|
12961
|
+
trace(`${T$n} _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$n} 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$n} dvrEnable no dash player instance`);
|
|
13036
13036
|
return false;
|
|
13037
13037
|
}
|
|
13038
|
-
trace(`${T$
|
|
13038
|
+
trace(`${T$n} 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$n} 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$n} 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$m = '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$m} _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$m} _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$m} _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$m} _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$m} _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$m} _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$m} 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$m} 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$l = '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$l} 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$l} _onWaiting`);
|
|
42728
42728
|
super._onWaiting();
|
|
42729
42729
|
}
|
|
42730
42730
|
_onEnded() {
|
|
42731
|
-
trace(`${T$
|
|
42731
|
+
trace(`${T$l} _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$l} _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$l} _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$l} _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$l} _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$l} 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$l} 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$l} 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$k = '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$k} 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$k} 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$k} 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$k} 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$k} 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$k} 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$k} 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$k} 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$k} 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$k} 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.31";
|
|
43307
43307
|
|
|
43308
43308
|
var packages = {
|
|
43309
43309
|
"node_modules/@clappr/core": {
|
|
@@ -43627,7 +43627,7 @@ const INITIAL_SETTINGS = {
|
|
|
43627
43627
|
default: [],
|
|
43628
43628
|
seekEnabled: false,
|
|
43629
43629
|
};
|
|
43630
|
-
const T$
|
|
43630
|
+
const T$j = 'plugins.media_control';
|
|
43631
43631
|
const LEFT_ORDER = [
|
|
43632
43632
|
'playpause',
|
|
43633
43633
|
'playstop',
|
|
@@ -43878,7 +43878,7 @@ class MediaControl extends UICorePlugin {
|
|
|
43878
43878
|
* Hides the media control UI
|
|
43879
43879
|
*/
|
|
43880
43880
|
disable() {
|
|
43881
|
-
trace(`${T$
|
|
43881
|
+
trace(`${T$j} disable`);
|
|
43882
43882
|
this.userDisabled = true; // TODO distinguish between user and system (e.g., unplayable) disabled?
|
|
43883
43883
|
this.hide();
|
|
43884
43884
|
this.unbindKeyEvents();
|
|
@@ -43888,7 +43888,7 @@ class MediaControl extends UICorePlugin {
|
|
|
43888
43888
|
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
43889
43889
|
*/
|
|
43890
43890
|
enable() {
|
|
43891
|
-
trace(`${T$
|
|
43891
|
+
trace(`${T$j} enable`);
|
|
43892
43892
|
if (this.options.chromeless) {
|
|
43893
43893
|
return;
|
|
43894
43894
|
}
|
|
@@ -44614,7 +44614,7 @@ class MediaControl extends UICorePlugin {
|
|
|
44614
44614
|
return this;
|
|
44615
44615
|
}
|
|
44616
44616
|
const timeout = this.options.hideMediaControlDelay || 2000;
|
|
44617
|
-
trace(`${T$
|
|
44617
|
+
trace(`${T$j} render`, { settings: this.settings });
|
|
44618
44618
|
this.$el.html(MediaControl.template({ settings: this.settings }));
|
|
44619
44619
|
// const style = Styler.getStyleFor(mediaControlStyle, { baseUrl: this.options.baseUrl });
|
|
44620
44620
|
// this.$el.append(style[0]);
|
|
@@ -44770,7 +44770,7 @@ function serializeSettings(s) {
|
|
|
44770
44770
|
}
|
|
44771
44771
|
|
|
44772
44772
|
const VERSION$7 = '2.22.4';
|
|
44773
|
-
const T$
|
|
44773
|
+
const T$i = 'plugins.audiotracks';
|
|
44774
44774
|
/**
|
|
44775
44775
|
* `PLUGIN` that makes possible to switch audio tracks via the media control UI.
|
|
44776
44776
|
* @beta
|
|
@@ -44892,7 +44892,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
44892
44892
|
this.updateText();
|
|
44893
44893
|
}
|
|
44894
44894
|
hideMenu() {
|
|
44895
|
-
trace(`${T$
|
|
44895
|
+
trace(`${T$i} hideMenu`);
|
|
44896
44896
|
this.$el.find('#audiotracks-select').addClass('hidden');
|
|
44897
44897
|
this.$el.find('#audiotracks-button').attr('aria-expanded', 'false');
|
|
44898
44898
|
}
|
|
@@ -44945,7 +44945,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
44945
44945
|
|
|
44946
44946
|
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";
|
|
44947
44947
|
|
|
44948
|
-
const T$
|
|
44948
|
+
const T$h = 'plugins.big_mute_button';
|
|
44949
44949
|
// TODO rewrite as a container plugin
|
|
44950
44950
|
/**
|
|
44951
44951
|
* `PLUGIN` that displays a big mute button over the video when it's muted.
|
|
@@ -44986,7 +44986,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
44986
44986
|
this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
44987
44987
|
this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
|
|
44988
44988
|
this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
|
|
44989
|
-
trace(`${T$
|
|
44989
|
+
trace(`${T$h} bindEvents`, {
|
|
44990
44990
|
mediacontrol: !!this.core.mediaControl,
|
|
44991
44991
|
});
|
|
44992
44992
|
this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
|
|
@@ -45011,12 +45011,12 @@ class BigMuteButton extends UICorePlugin {
|
|
|
45011
45011
|
}
|
|
45012
45012
|
mediaControlRendered() {
|
|
45013
45013
|
const container = this.core.activeContainer;
|
|
45014
|
-
trace(`${T$
|
|
45014
|
+
trace(`${T$h} mediaControlRendered`, {
|
|
45015
45015
|
container: !!container,
|
|
45016
45016
|
});
|
|
45017
45017
|
if (container) {
|
|
45018
45018
|
this.listenTo(container.playback, Events$1.PLAYBACK_PLAY, () => {
|
|
45019
|
-
trace(`${T$
|
|
45019
|
+
trace(`${T$h} PLAYBACK_PLAY`);
|
|
45020
45020
|
this.render();
|
|
45021
45021
|
});
|
|
45022
45022
|
}
|
|
@@ -45040,7 +45040,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
45040
45040
|
}
|
|
45041
45041
|
const { autoPlay, wasMuted } = this.options;
|
|
45042
45042
|
const volume = container.volume;
|
|
45043
|
-
trace(`${T$
|
|
45043
|
+
trace(`${T$h} shouldRender`, {
|
|
45044
45044
|
autoPlay,
|
|
45045
45045
|
wasMuted,
|
|
45046
45046
|
volume,
|
|
@@ -45052,7 +45052,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
45052
45052
|
*/
|
|
45053
45053
|
render() {
|
|
45054
45054
|
if (this.shouldRender()) {
|
|
45055
|
-
trace(`${T$
|
|
45055
|
+
trace(`${T$h} render`, {
|
|
45056
45056
|
el: !!this.$el,
|
|
45057
45057
|
});
|
|
45058
45058
|
this.$el.html(BigMuteButton.template());
|
|
@@ -45098,7 +45098,7 @@ const gearIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"n
|
|
|
45098
45098
|
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";
|
|
45099
45099
|
|
|
45100
45100
|
const VERSION$6 = '2.19.12';
|
|
45101
|
-
const T$
|
|
45101
|
+
const T$g = 'plugins.bottom_gear';
|
|
45102
45102
|
/**
|
|
45103
45103
|
* Events triggered by the plugin
|
|
45104
45104
|
* @beta
|
|
@@ -45248,20 +45248,20 @@ class BottomGear extends UICorePlugin {
|
|
|
45248
45248
|
addItem(name, $subMenu) {
|
|
45249
45249
|
const $existingItem = this.$el.find(`#gear-options li[data-${name}`);
|
|
45250
45250
|
if ($existingItem.length) {
|
|
45251
|
-
trace(`${T$
|
|
45251
|
+
trace(`${T$g} addItem already exists`, { name });
|
|
45252
45252
|
return $existingItem;
|
|
45253
45253
|
}
|
|
45254
45254
|
const $item = $('<li></li>')
|
|
45255
45255
|
.attr(`data-${name}`, '')
|
|
45256
45256
|
.appendTo(this.$el.find('#gear-options'));
|
|
45257
45257
|
if ($subMenu) {
|
|
45258
|
-
trace(`${T$
|
|
45258
|
+
trace(`${T$g} addItem adding submenu`, { name });
|
|
45259
45259
|
$subMenu
|
|
45260
45260
|
.addClass('gear-sub-menu-wrapper')
|
|
45261
45261
|
.hide()
|
|
45262
45262
|
.appendTo(this.$el.find('#gear-options-wrapper'));
|
|
45263
45263
|
$item.on('click', (e) => {
|
|
45264
|
-
trace(`${T$
|
|
45264
|
+
trace(`${T$g} addItem submenu clicked`, { name });
|
|
45265
45265
|
e.stopPropagation();
|
|
45266
45266
|
$subMenu.show();
|
|
45267
45267
|
this.$el.find('#gear-options').hide();
|
|
@@ -45270,15 +45270,15 @@ class BottomGear extends UICorePlugin {
|
|
|
45270
45270
|
return $item;
|
|
45271
45271
|
}
|
|
45272
45272
|
onActiveContainerChanged() {
|
|
45273
|
-
trace(`${T$
|
|
45273
|
+
trace(`${T$g} onActiveContainerChanged`);
|
|
45274
45274
|
this.bindContainerEvents();
|
|
45275
45275
|
}
|
|
45276
45276
|
bindContainerEvents() {
|
|
45277
|
-
trace(`${T$
|
|
45277
|
+
trace(`${T$g} bindContainerEvents`);
|
|
45278
45278
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
|
|
45279
45279
|
}
|
|
45280
45280
|
highDefinitionUpdate(isHd) {
|
|
45281
|
-
trace(`${T$
|
|
45281
|
+
trace(`${T$g} highDefinitionUpdate`, { isHd });
|
|
45282
45282
|
this.hd = isHd;
|
|
45283
45283
|
this.$el.find('.gear-icon').html(isHd ? gearHdIcon : gearIcon);
|
|
45284
45284
|
}
|
|
@@ -45286,7 +45286,7 @@ class BottomGear extends UICorePlugin {
|
|
|
45286
45286
|
* @internal
|
|
45287
45287
|
*/
|
|
45288
45288
|
render() {
|
|
45289
|
-
trace(`${T$
|
|
45289
|
+
trace(`${T$g} render`);
|
|
45290
45290
|
const mediaControl = this.core.getPlugin('media_control');
|
|
45291
45291
|
if (!mediaControl) {
|
|
45292
45292
|
return this; // TODO test
|
|
@@ -45318,11 +45318,11 @@ class BottomGear extends UICorePlugin {
|
|
|
45318
45318
|
this.$el.find('#gear-options-wrapper').toggle();
|
|
45319
45319
|
}
|
|
45320
45320
|
hide() {
|
|
45321
|
-
trace(`${T$
|
|
45321
|
+
trace(`${T$g} hide`);
|
|
45322
45322
|
this.$el.find('#gear-options-wrapper').hide();
|
|
45323
45323
|
}
|
|
45324
45324
|
onCoreReady() {
|
|
45325
|
-
trace(`${T$
|
|
45325
|
+
trace(`${T$g} onCoreReady`);
|
|
45326
45326
|
const mediaControl = this.core.getPlugin('media_control');
|
|
45327
45327
|
assert(mediaControl, 'media_control plugin is required');
|
|
45328
45328
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMediaControlRendered);
|
|
@@ -45334,7 +45334,7 @@ class BottomGear extends UICorePlugin {
|
|
|
45334
45334
|
});
|
|
45335
45335
|
}
|
|
45336
45336
|
onMediaControlRendered() {
|
|
45337
|
-
trace(`${T$
|
|
45337
|
+
trace(`${T$g} onMediaControlRendered`);
|
|
45338
45338
|
const mediaControl = this.core.getPlugin('media_control');
|
|
45339
45339
|
mediaControl.mount('gear', this.$el);
|
|
45340
45340
|
}
|
|
@@ -47804,7 +47804,7 @@ const PLAYBACK_NAMES = {
|
|
|
47804
47804
|
hls: 'HLS.js',
|
|
47805
47805
|
html5_video: 'Native',
|
|
47806
47806
|
};
|
|
47807
|
-
const T$
|
|
47807
|
+
const T$f = 'plugins.nerd_stats';
|
|
47808
47808
|
/**
|
|
47809
47809
|
* `PLUGIN` that displays useful statistics regarding the playback as well as the network quality estimation.
|
|
47810
47810
|
* @beta
|
|
@@ -48123,7 +48123,7 @@ class NerdStats extends UICorePlugin {
|
|
|
48123
48123
|
return this;
|
|
48124
48124
|
}
|
|
48125
48125
|
attach() {
|
|
48126
|
-
trace(`${T$
|
|
48126
|
+
trace(`${T$f} attach`);
|
|
48127
48127
|
const gear = this.core.getPlugin('bottom_gear');
|
|
48128
48128
|
gear
|
|
48129
48129
|
.addItem('nerd_stats')
|
|
@@ -48137,7 +48137,7 @@ class NerdStats extends UICorePlugin {
|
|
|
48137
48137
|
});
|
|
48138
48138
|
}
|
|
48139
48139
|
clearSpeedtestMetrics() {
|
|
48140
|
-
trace(`${T$
|
|
48140
|
+
trace(`${T$f} clearSpeedtestMetrics`);
|
|
48141
48141
|
const clapprStats = this.container?.getPlugin('clappr_stats');
|
|
48142
48142
|
this.speedtestMetrics.connectionSpeed = 0;
|
|
48143
48143
|
this.speedtestMetrics.ping = 0;
|
|
@@ -48192,7 +48192,7 @@ function newMetrics() {
|
|
|
48192
48192
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
48193
48193
|
// Use of this source code is governed by a BSD-style
|
|
48194
48194
|
// license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
|
|
48195
|
-
const T$
|
|
48195
|
+
const T$e = 'plugins.click_to_pause';
|
|
48196
48196
|
/**
|
|
48197
48197
|
* A small `PLUGIN` that toggles the playback state on click over the video container
|
|
48198
48198
|
* @beta
|
|
@@ -48222,7 +48222,7 @@ class ClickToPause extends ContainerPlugin {
|
|
|
48222
48222
|
click() {
|
|
48223
48223
|
const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
|
|
48224
48224
|
const isDvrEnabled = this.container.isDvrEnabled();
|
|
48225
|
-
trace(`${T$
|
|
48225
|
+
trace(`${T$e} click`, {
|
|
48226
48226
|
isLivePlayback,
|
|
48227
48227
|
isDvrEnabled,
|
|
48228
48228
|
});
|
|
@@ -48301,7 +48301,7 @@ function buildSvg(clips, duration, barWidth) {
|
|
|
48301
48301
|
|
|
48302
48302
|
const clipsHTML = "<div class=\"media-clip-text\" id=\"clips-text\"></div>";
|
|
48303
48303
|
|
|
48304
|
-
const T$
|
|
48304
|
+
const T$d = 'plugins.clips';
|
|
48305
48305
|
const VERSION$5 = '2.22.16';
|
|
48306
48306
|
const CLAPPR_VERSION = '0.11.4';
|
|
48307
48307
|
/**
|
|
@@ -48351,7 +48351,7 @@ class Clips extends UICorePlugin {
|
|
|
48351
48351
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
|
|
48352
48352
|
}
|
|
48353
48353
|
render() {
|
|
48354
|
-
trace(`${T$
|
|
48354
|
+
trace(`${T$d} render`);
|
|
48355
48355
|
if (!this.options.clips) {
|
|
48356
48356
|
return this;
|
|
48357
48357
|
}
|
|
@@ -48378,19 +48378,19 @@ class Clips extends UICorePlugin {
|
|
|
48378
48378
|
return super.enable();
|
|
48379
48379
|
}
|
|
48380
48380
|
onCoreReady() {
|
|
48381
|
-
trace(`${T$
|
|
48381
|
+
trace(`${T$d} onCoreReady`);
|
|
48382
48382
|
const mediaControl = this.core.getPlugin('media_control');
|
|
48383
48383
|
assert(mediaControl, 'media_control plugin is required');
|
|
48384
48384
|
this.parseClips(this.options.clips.text);
|
|
48385
48385
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMcRender);
|
|
48386
48386
|
}
|
|
48387
48387
|
onMcRender() {
|
|
48388
|
-
trace(`${T$
|
|
48388
|
+
trace(`${T$d} onMcRender`);
|
|
48389
48389
|
const mediaControl = this.core.getPlugin('media_control');
|
|
48390
48390
|
mediaControl.mount('clips', this.$el);
|
|
48391
48391
|
}
|
|
48392
48392
|
onContainerChanged() {
|
|
48393
|
-
trace(`${T$
|
|
48393
|
+
trace(`${T$d} onContainerChanged`);
|
|
48394
48394
|
// TODO figure out the conditions of changing the container (without destroying the previous one)
|
|
48395
48395
|
if (this.oldContainer) {
|
|
48396
48396
|
this.stopListening(this.oldContainer, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
@@ -48683,7 +48683,7 @@ const reloadIcon = "<svg fill=\"#FFFFFF\" height=\"24\" viewBox=\"0 0 24 24\" wi
|
|
|
48683
48683
|
|
|
48684
48684
|
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";
|
|
48685
48685
|
|
|
48686
|
-
const T$
|
|
48686
|
+
const T$c = 'plugins.error_screen';
|
|
48687
48687
|
/**
|
|
48688
48688
|
* `PLUGIN` that displays fatal errors nicely in the overlay on top of the player.
|
|
48689
48689
|
* @public
|
|
@@ -48735,11 +48735,11 @@ class ErrorScreen extends UICorePlugin {
|
|
|
48735
48735
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
48736
48736
|
}
|
|
48737
48737
|
onPlay() {
|
|
48738
|
-
trace(`${T$
|
|
48738
|
+
trace(`${T$c} onPlay`);
|
|
48739
48739
|
this.unmount();
|
|
48740
48740
|
}
|
|
48741
48741
|
unmount() {
|
|
48742
|
-
trace(`${T$
|
|
48742
|
+
trace(`${T$c} unmount`);
|
|
48743
48743
|
this.err = null;
|
|
48744
48744
|
this.$el.remove();
|
|
48745
48745
|
}
|
|
@@ -48752,7 +48752,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
48752
48752
|
};
|
|
48753
48753
|
}
|
|
48754
48754
|
reload() {
|
|
48755
|
-
trace(`${T$
|
|
48755
|
+
trace(`${T$c} reload`);
|
|
48756
48756
|
setTimeout(() => {
|
|
48757
48757
|
this.core.configure({
|
|
48758
48758
|
reloading: true,
|
|
@@ -48762,7 +48762,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
48762
48762
|
}, 0);
|
|
48763
48763
|
}
|
|
48764
48764
|
onActiveContainerChanged() {
|
|
48765
|
-
trace(`${T$
|
|
48765
|
+
trace(`${T$c} onActiveContainerChanged`, {
|
|
48766
48766
|
reloading: this.core.options.reloading,
|
|
48767
48767
|
});
|
|
48768
48768
|
this.err = null;
|
|
@@ -48778,7 +48778,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
48778
48778
|
}
|
|
48779
48779
|
}
|
|
48780
48780
|
onError(err) {
|
|
48781
|
-
trace(`${T$
|
|
48781
|
+
trace(`${T$c} onError`, { err });
|
|
48782
48782
|
if (err.UI) {
|
|
48783
48783
|
if (this.err) {
|
|
48784
48784
|
this.unmount();
|
|
@@ -49248,7 +49248,7 @@ const streamsMomentoIcon = "<svg id=\"Слой_1\" data-name=\"Слой 1\" xmln
|
|
|
49248
49248
|
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";
|
|
49249
49249
|
|
|
49250
49250
|
const VERSION$4 = '0.0.1';
|
|
49251
|
-
const T$
|
|
49251
|
+
const T$b = 'plugins.multicamera';
|
|
49252
49252
|
/**
|
|
49253
49253
|
* `PLUGIN` that adds support for loading multiple streams and switching between them using the media control UI.
|
|
49254
49254
|
* @beta
|
|
@@ -49394,7 +49394,7 @@ class MultiCamera extends UICorePlugin {
|
|
|
49394
49394
|
}
|
|
49395
49395
|
onCameraSelect(event) {
|
|
49396
49396
|
const value = event.currentTarget.dataset.multicameraSelectorSelect;
|
|
49397
|
-
trace(`${T$
|
|
49397
|
+
trace(`${T$b} onCameraSelect`, { value });
|
|
49398
49398
|
if (value !== undefined) {
|
|
49399
49399
|
this.changeById(parseInt(value, 10));
|
|
49400
49400
|
}
|
|
@@ -49520,13 +49520,13 @@ class MultiCamera extends UICorePlugin {
|
|
|
49520
49520
|
}
|
|
49521
49521
|
}
|
|
49522
49522
|
changeById(id) {
|
|
49523
|
-
trace(`${T$
|
|
49523
|
+
trace(`${T$b} changeById`, { id });
|
|
49524
49524
|
queueMicrotask(() => {
|
|
49525
49525
|
const playbackOptions = this.core.options.playback || {};
|
|
49526
49526
|
// TODO figure out what this does
|
|
49527
49527
|
playbackOptions.recycleVideo = Browser.isMobile;
|
|
49528
49528
|
this.currentCamera = this.findElementById(id) ?? null;
|
|
49529
|
-
trace(`${T$
|
|
49529
|
+
trace(`${T$b} changeById`, { id, currentCamera: this.currentCamera, multicamera: this.multicamera });
|
|
49530
49530
|
if (!this.currentCamera) {
|
|
49531
49531
|
return;
|
|
49532
49532
|
}
|
|
@@ -49543,7 +49543,7 @@ class MultiCamera extends UICorePlugin {
|
|
|
49543
49543
|
// TODO remove?
|
|
49544
49544
|
// for html5 playback:
|
|
49545
49545
|
this.options.dvrEnabled = this.currentCamera.dvr;
|
|
49546
|
-
trace(`${T$
|
|
49546
|
+
trace(`${T$b} changeById`, { currentCamera: this.currentCamera });
|
|
49547
49547
|
// TODO
|
|
49548
49548
|
this.core.configure({
|
|
49549
49549
|
playback: playbackOptions,
|
|
@@ -49601,7 +49601,7 @@ const pipIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"no
|
|
|
49601
49601
|
const buttonHtml$2 = "<button class=\"gplayer-lite-btn gcore-skin-button-color\">\n <%= pipIcon %>\n</button>\n";
|
|
49602
49602
|
|
|
49603
49603
|
const VERSION$3 = '0.0.1';
|
|
49604
|
-
const T$
|
|
49604
|
+
const T$a = `plugins.pip`;
|
|
49605
49605
|
/**
|
|
49606
49606
|
* `PLUGIN` that enables picture in picture mode.
|
|
49607
49607
|
* @beta
|
|
@@ -49659,7 +49659,7 @@ class PictureInPicture extends UICorePlugin {
|
|
|
49659
49659
|
});
|
|
49660
49660
|
}
|
|
49661
49661
|
isPiPSupported() {
|
|
49662
|
-
trace(`${T$
|
|
49662
|
+
trace(`${T$a} isPiPSupported`, {
|
|
49663
49663
|
pictureInPictureEnabled: !!document.pictureInPictureEnabled,
|
|
49664
49664
|
requestPictureInPicture: !!HTMLVideoElement.prototype.requestPictureInPicture,
|
|
49665
49665
|
});
|
|
@@ -49680,7 +49680,7 @@ class PictureInPicture extends UICorePlugin {
|
|
|
49680
49680
|
return this;
|
|
49681
49681
|
}
|
|
49682
49682
|
togglePictureInPicture() {
|
|
49683
|
-
trace(`${T$
|
|
49683
|
+
trace(`${T$a} togglePictureInPicture`);
|
|
49684
49684
|
if (this.videoElement !== document.pictureInPictureElement) {
|
|
49685
49685
|
this.requestPictureInPicture();
|
|
49686
49686
|
}
|
|
@@ -49689,13 +49689,13 @@ class PictureInPicture extends UICorePlugin {
|
|
|
49689
49689
|
}
|
|
49690
49690
|
}
|
|
49691
49691
|
requestPictureInPicture() {
|
|
49692
|
-
trace(`${T$
|
|
49692
|
+
trace(`${T$a} requestPictureInPicture`, {
|
|
49693
49693
|
videoElement: !!this.videoElement,
|
|
49694
49694
|
});
|
|
49695
49695
|
this.videoElement.requestPictureInPicture();
|
|
49696
49696
|
}
|
|
49697
49697
|
exitPictureInPicture() {
|
|
49698
|
-
trace(`${T$
|
|
49698
|
+
trace(`${T$a} exitPictureInPicture`);
|
|
49699
49699
|
document.exitPictureInPicture();
|
|
49700
49700
|
}
|
|
49701
49701
|
}
|
|
@@ -49722,7 +49722,7 @@ const DEFAULT_PLAYBACK_RATES = [
|
|
|
49722
49722
|
{ value: 2.0, label: '2x' },
|
|
49723
49723
|
];
|
|
49724
49724
|
const DEFAULT_PLAYBACK_RATE = 1;
|
|
49725
|
-
const T$
|
|
49725
|
+
const T$9 = 'plugins.playback_rate';
|
|
49726
49726
|
/**
|
|
49727
49727
|
* `PLUGIN` that allows changing the playback speed of the video.
|
|
49728
49728
|
* @beta
|
|
@@ -49808,7 +49808,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49808
49808
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChange);
|
|
49809
49809
|
}
|
|
49810
49810
|
onCoreReady() {
|
|
49811
|
-
trace(`${T$
|
|
49811
|
+
trace(`${T$9} onCoreReady`);
|
|
49812
49812
|
const mediaControl = this.core.getPlugin('media_control');
|
|
49813
49813
|
assert(mediaControl, 'media_control plugin is required');
|
|
49814
49814
|
const gear = this.core.getPlugin('bottom_gear');
|
|
@@ -49817,7 +49817,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49817
49817
|
this.listenTo(gear, GearEvents.RENDERED, this.onGearRendered);
|
|
49818
49818
|
}
|
|
49819
49819
|
onActiveContainerChange() {
|
|
49820
|
-
trace(`${T$
|
|
49820
|
+
trace(`${T$9} onActiveContainerChange`);
|
|
49821
49821
|
this.metadataLoaded = false;
|
|
49822
49822
|
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_STOP, this.onStop);
|
|
49823
49823
|
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_PLAY, this.onPlay);
|
|
@@ -49825,15 +49825,15 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49825
49825
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_LOADEDMETADATA, this.onMetaDataLoaded);
|
|
49826
49826
|
}
|
|
49827
49827
|
onMediaControlRendered() {
|
|
49828
|
-
trace(`${T$
|
|
49828
|
+
trace(`${T$9} onMediaControlRendered`);
|
|
49829
49829
|
this.render();
|
|
49830
49830
|
}
|
|
49831
49831
|
onGearRendered() {
|
|
49832
|
-
trace(`${T$
|
|
49832
|
+
trace(`${T$9} onGearRendered`);
|
|
49833
49833
|
this.mount();
|
|
49834
49834
|
}
|
|
49835
49835
|
mount() {
|
|
49836
|
-
trace(`${T$
|
|
49836
|
+
trace(`${T$9} mount`, {
|
|
49837
49837
|
shouldMount: this.shouldMount(),
|
|
49838
49838
|
});
|
|
49839
49839
|
if (!this.shouldMount()) {
|
|
@@ -49850,7 +49850,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49850
49850
|
})));
|
|
49851
49851
|
}
|
|
49852
49852
|
onMetaDataLoaded() {
|
|
49853
|
-
trace(`${T$
|
|
49853
|
+
trace(`${T$9} onMetaDataLoaded`, {
|
|
49854
49854
|
playbackType: this.core.activePlayback.getPlaybackType(),
|
|
49855
49855
|
dvrEnabled: this.core.activePlayback.dvrEnabled,
|
|
49856
49856
|
});
|
|
@@ -49872,14 +49872,14 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49872
49872
|
this.core.activePlayback?.setPlaybackRate(this.selectedRate);
|
|
49873
49873
|
}
|
|
49874
49874
|
else {
|
|
49875
|
-
trace(`${T$
|
|
49875
|
+
trace(`${T$9} onPlaybackRateChange not steering to the selected rate, it is seemingly a catchup algorithm working`, {
|
|
49876
49876
|
playbackRate,
|
|
49877
49877
|
selectedRate: this.selectedRate,
|
|
49878
49878
|
});
|
|
49879
49879
|
}
|
|
49880
49880
|
}
|
|
49881
49881
|
shouldMount() {
|
|
49882
|
-
trace(`${T$
|
|
49882
|
+
trace(`${T$9} shouldMount`, {
|
|
49883
49883
|
playbackType: this.core.activePlayback?.getPlaybackType(),
|
|
49884
49884
|
dvrEnabled: this.core.activePlayback?.dvrEnabled,
|
|
49885
49885
|
});
|
|
@@ -49896,7 +49896,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49896
49896
|
* @internal
|
|
49897
49897
|
*/
|
|
49898
49898
|
render() {
|
|
49899
|
-
trace(`${T$
|
|
49899
|
+
trace(`${T$9} render`, {
|
|
49900
49900
|
shouldMount: this.shouldMount(),
|
|
49901
49901
|
});
|
|
49902
49902
|
this.$el.html(PlaybackRate.listTemplate({
|
|
@@ -49942,13 +49942,13 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49942
49942
|
}
|
|
49943
49943
|
}
|
|
49944
49944
|
syncRate() {
|
|
49945
|
-
trace(`${T$
|
|
49945
|
+
trace(`${T$9} syncRate`, {
|
|
49946
49946
|
selectedRate: this.selectedRate,
|
|
49947
49947
|
});
|
|
49948
49948
|
this.core.activePlayback?.setPlaybackRate(this.selectedRate);
|
|
49949
49949
|
}
|
|
49950
49950
|
resetPlaybackRate() {
|
|
49951
|
-
trace(`${T$
|
|
49951
|
+
trace(`${T$9} resetPlaybackRate`, {
|
|
49952
49952
|
selectedRate: this.selectedRate,
|
|
49953
49953
|
});
|
|
49954
49954
|
this.core.activePlayback?.setPlaybackRate(DEFAULT_PLAYBACK_RATE);
|
|
@@ -49983,7 +49983,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49983
49983
|
?.label || `x${rate}`);
|
|
49984
49984
|
}
|
|
49985
49985
|
highlightCurrentRate() {
|
|
49986
|
-
trace(`${T$
|
|
49986
|
+
trace(`${T$9} highlightCurrentRate`, {
|
|
49987
49987
|
selectedRate: this.selectedRate,
|
|
49988
49988
|
});
|
|
49989
49989
|
this.allRateElements().removeClass('current');
|
|
@@ -49994,36 +49994,30 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49994
49994
|
.addClass('gcore-skin-active');
|
|
49995
49995
|
}
|
|
49996
49996
|
updateGearOptionLabel() {
|
|
49997
|
-
trace(`${T$
|
|
49997
|
+
trace(`${T$9} updateGearOptionLabel`, {
|
|
49998
49998
|
selectedRate: this.selectedRate,
|
|
49999
49999
|
});
|
|
50000
50000
|
this.mount();
|
|
50001
50001
|
}
|
|
50002
50002
|
}
|
|
50003
50003
|
|
|
50004
|
-
const posterHTML = "<div class=\"play-wrapper\"
|
|
50004
|
+
const posterHTML = "<div class=\"play-wrapper\" id=\"gplayer-poster\">\n <div class='circle-poster gcore-skin-button-color gcore-skin-border-color' id='poster-play'></div>\n</div>\n";
|
|
50005
50005
|
|
|
50006
50006
|
//Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
50007
50007
|
// Use of this source code is governed by a BSD-style
|
|
50008
50008
|
// license that can be found in the LICENSE file.
|
|
50009
|
-
const T$
|
|
50009
|
+
const T$8 = 'plugins.poster';
|
|
50010
50010
|
/**
|
|
50011
50011
|
* `PLUGIN` that displays a poster image in the background and a big play button on top when playback is stopped
|
|
50012
50012
|
* @beta
|
|
50013
50013
|
* @remarks
|
|
50014
|
-
* When the playback is stopped, media control UI is disabled.
|
|
50014
|
+
* When the playback is stopped or not yet started, the media control UI is disabled and hidden.
|
|
50015
|
+
* Media control gets activated once the metadata is loaded after playback is initiated.
|
|
50016
|
+
* This plugin displays a big play button on top of the poster image to allow user to start playback.
|
|
50015
50017
|
* Note that the poster image, if specified via the player config, will be used to update video element's poster attribute by the
|
|
50016
50018
|
* HTML5-video-based playback module.
|
|
50017
50019
|
*
|
|
50018
|
-
* Configuration options
|
|
50019
|
-
*
|
|
50020
|
-
* - `poster.custom` - custom CSS background
|
|
50021
|
-
*
|
|
50022
|
-
* - `poster.showForNoOp` - whether to show the poster when the playback is not started
|
|
50023
|
-
*
|
|
50024
|
-
* - `poster.url` - the URL of the poster image
|
|
50025
|
-
*
|
|
50026
|
-
* - `poster.showOnVideoEnd` - whether to show the poster when the playback is ended
|
|
50020
|
+
* Configuration options - {@link PosterPluginSettings}
|
|
50027
50021
|
*
|
|
50028
50022
|
* @example
|
|
50029
50023
|
* ```ts
|
|
@@ -50039,10 +50033,9 @@ const T$7 = 'plugins.poster';
|
|
|
50039
50033
|
class Poster extends UIContainerPlugin {
|
|
50040
50034
|
// TODO merge non-poster related functionality into the ClickToPause plugin
|
|
50041
50035
|
hasFatalError = false;
|
|
50042
|
-
|
|
50036
|
+
playing = false;
|
|
50043
50037
|
playRequested = false;
|
|
50044
50038
|
$playButton = null;
|
|
50045
|
-
$playWrapper = null;
|
|
50046
50039
|
/**
|
|
50047
50040
|
* @internal
|
|
50048
50041
|
*/
|
|
@@ -50062,8 +50055,10 @@ class Poster extends UIContainerPlugin {
|
|
|
50062
50055
|
}
|
|
50063
50056
|
const showForNoOp = !!this.options.poster?.showForNoOp;
|
|
50064
50057
|
return (this.container.playback.name !== 'html_img' &&
|
|
50065
|
-
(this.
|
|
50066
|
-
|
|
50058
|
+
(!this.isNoOp || showForNoOp));
|
|
50059
|
+
}
|
|
50060
|
+
get isNoOp() {
|
|
50061
|
+
return this.container.playback.getPlaybackType() === Playback.NO_OP;
|
|
50067
50062
|
}
|
|
50068
50063
|
/**
|
|
50069
50064
|
* @internal
|
|
@@ -50071,7 +50066,6 @@ class Poster extends UIContainerPlugin {
|
|
|
50071
50066
|
get attributes() {
|
|
50072
50067
|
return {
|
|
50073
50068
|
class: 'player-poster',
|
|
50074
|
-
'data-poster': '',
|
|
50075
50069
|
};
|
|
50076
50070
|
}
|
|
50077
50071
|
/**
|
|
@@ -50082,9 +50076,6 @@ class Poster extends UIContainerPlugin {
|
|
|
50082
50076
|
click: 'clicked',
|
|
50083
50077
|
};
|
|
50084
50078
|
}
|
|
50085
|
-
get showOnVideoEnd() {
|
|
50086
|
-
return this.options.poster?.showOnVideoEnd !== false;
|
|
50087
|
-
}
|
|
50088
50079
|
/**
|
|
50089
50080
|
* @internal
|
|
50090
50081
|
*/
|
|
@@ -50093,70 +50084,71 @@ class Poster extends UIContainerPlugin {
|
|
|
50093
50084
|
this.listenTo(this.container, Events$1.CONTAINER_PLAY, this.onPlay);
|
|
50094
50085
|
this.listenTo(this.container, Events$1.CONTAINER_STATE_BUFFERING, this.update);
|
|
50095
50086
|
this.listenTo(this.container, Events$1.CONTAINER_STATE_BUFFERFULL, this.update);
|
|
50096
|
-
this.listenTo(this.container, Events$1.CONTAINER_OPTIONS_CHANGE, this.
|
|
50087
|
+
this.listenTo(this.container, Events$1.CONTAINER_OPTIONS_CHANGE, this.update);
|
|
50097
50088
|
this.listenTo(this.container, Events$1.CONTAINER_ERROR, this.onError);
|
|
50098
|
-
this
|
|
50089
|
+
// TODO check if this event is always accompanied with the CONTAINER_STOP
|
|
50090
|
+
if (this.options.poster?.showOnVideoEnd !== false) {
|
|
50099
50091
|
this.listenTo(this.container, Events$1.CONTAINER_ENDED, this.onStop);
|
|
50092
|
+
}
|
|
50100
50093
|
this.listenTo(this.container, Events$1.CONTAINER_READY, this.render);
|
|
50101
|
-
this.listenTo(this.container, Events$1.PLAYBACK_PLAY_INTENT, this.onPlayIntent);
|
|
50094
|
+
this.listenTo(this.container.playback, Events$1.PLAYBACK_PLAY_INTENT, this.onPlayIntent);
|
|
50102
50095
|
}
|
|
50103
50096
|
/**
|
|
50104
50097
|
* Reenables earlier disabled plugin
|
|
50105
50098
|
*/
|
|
50106
50099
|
enable() {
|
|
50100
|
+
trace(`${T$8} enable`);
|
|
50107
50101
|
super.enable();
|
|
50108
|
-
this.
|
|
50102
|
+
this.playing = this.container.playback.isPlaying();
|
|
50109
50103
|
this.update();
|
|
50110
50104
|
}
|
|
50111
50105
|
/**
|
|
50112
50106
|
* Disables the plugin, unmounting it from the DOM
|
|
50113
50107
|
*/
|
|
50114
50108
|
disable() {
|
|
50115
|
-
trace(`${T$
|
|
50116
|
-
this.
|
|
50109
|
+
trace(`${T$8} disable`);
|
|
50110
|
+
this.playing = false;
|
|
50117
50111
|
this.playRequested = false;
|
|
50118
50112
|
super.disable();
|
|
50119
50113
|
}
|
|
50120
50114
|
onError(error) {
|
|
50121
|
-
trace(`${T$
|
|
50115
|
+
trace(`${T$8} onError`, {
|
|
50122
50116
|
error,
|
|
50123
50117
|
enabled: this.enabled,
|
|
50124
50118
|
});
|
|
50125
|
-
this.hasFatalError = error.level === PlayerError.Levels.FATAL;
|
|
50126
50119
|
if (this.hasFatalError) {
|
|
50127
|
-
|
|
50128
|
-
if (!this.playRequested) {
|
|
50129
|
-
this.showPlayButton();
|
|
50130
|
-
}
|
|
50120
|
+
return;
|
|
50131
50121
|
}
|
|
50122
|
+
this.hasFatalError = error.level === PlayerError.Levels.FATAL;
|
|
50123
|
+
// this.hasFatalError is reset on container recreate
|
|
50132
50124
|
}
|
|
50133
50125
|
onPlay() {
|
|
50134
|
-
trace(`${T$
|
|
50135
|
-
this.
|
|
50126
|
+
trace(`${T$8} onPlay`);
|
|
50127
|
+
this.playing = true;
|
|
50136
50128
|
this.playRequested = false;
|
|
50137
50129
|
this.update();
|
|
50138
50130
|
}
|
|
50139
50131
|
onPlayIntent() {
|
|
50140
|
-
trace(`${T$
|
|
50132
|
+
trace(`${T$8} onPlayIntent`);
|
|
50141
50133
|
this.playRequested = true;
|
|
50142
50134
|
this.update();
|
|
50143
50135
|
}
|
|
50144
50136
|
onStop() {
|
|
50145
|
-
trace(`${T$
|
|
50146
|
-
|
|
50147
|
-
});
|
|
50148
|
-
this.hasStartedPlaying = false;
|
|
50137
|
+
trace(`${T$8} onStop`);
|
|
50138
|
+
this.playing = false;
|
|
50149
50139
|
this.playRequested = false;
|
|
50150
50140
|
this.update();
|
|
50151
50141
|
}
|
|
50152
|
-
updatePlayButton(
|
|
50153
|
-
trace(`${T$
|
|
50154
|
-
|
|
50155
|
-
chromeless
|
|
50156
|
-
|
|
50157
|
-
|
|
50158
|
-
|
|
50159
|
-
|
|
50142
|
+
updatePlayButton() {
|
|
50143
|
+
trace(`${T$8} updatePlayButton`);
|
|
50144
|
+
const show = !this.isNoOp &&
|
|
50145
|
+
!(this.options.chromeless && !this.options.allowUserInteraction) &&
|
|
50146
|
+
!this.playRequested &&
|
|
50147
|
+
!this.playing &&
|
|
50148
|
+
!this.container.buffering &&
|
|
50149
|
+
!this.hasFatalError &&
|
|
50150
|
+
!this.options.disableMediaControl;
|
|
50151
|
+
if (show) {
|
|
50160
50152
|
this.showPlayButton();
|
|
50161
50153
|
}
|
|
50162
50154
|
else {
|
|
@@ -50164,59 +50156,42 @@ class Poster extends UIContainerPlugin {
|
|
|
50164
50156
|
}
|
|
50165
50157
|
}
|
|
50166
50158
|
showPlayButton() {
|
|
50167
|
-
|
|
50168
|
-
|
|
50169
|
-
}
|
|
50170
|
-
if (this.hasFatalError && !this.options.disableErrorScreen) {
|
|
50171
|
-
return;
|
|
50172
|
-
}
|
|
50173
|
-
this.$playButton?.show();
|
|
50159
|
+
trace(`${T$8} showPlayButton`);
|
|
50160
|
+
this.$el.find('#poster-play').show();
|
|
50174
50161
|
this.$el.addClass('clickable');
|
|
50175
50162
|
this.container.$el.addClass('container-with-poster-clickable');
|
|
50176
50163
|
}
|
|
50177
50164
|
hidePlayButton() {
|
|
50178
|
-
|
|
50165
|
+
trace(`${T$8} hidePlayButton`);
|
|
50166
|
+
this.$el.find('#poster-play').hide();
|
|
50179
50167
|
this.$el.removeClass('clickable');
|
|
50180
50168
|
}
|
|
50181
|
-
clicked() {
|
|
50182
|
-
trace(`${T$
|
|
50183
|
-
|
|
50184
|
-
|
|
50185
|
-
|
|
50186
|
-
|
|
50169
|
+
clicked(e) {
|
|
50170
|
+
trace(`${T$8} clicked`);
|
|
50171
|
+
e.preventDefault();
|
|
50172
|
+
e.stopPropagation();
|
|
50173
|
+
if (this.options.chromeless && !this.options.allowUserInteraction) {
|
|
50174
|
+
return;
|
|
50175
|
+
}
|
|
50187
50176
|
// Let "click_to_pause" plugin handle click event if media has started playing
|
|
50188
|
-
if (!this.
|
|
50189
|
-
|
|
50190
|
-
|
|
50191
|
-
|
|
50192
|
-
this.container.playback.consent();
|
|
50193
|
-
this.container.playback.play();
|
|
50194
|
-
}
|
|
50177
|
+
if (!this.playing) {
|
|
50178
|
+
this.playRequested = true;
|
|
50179
|
+
this.update();
|
|
50180
|
+
this.container.play();
|
|
50195
50181
|
}
|
|
50196
|
-
return false;
|
|
50197
50182
|
}
|
|
50198
50183
|
shouldHideOnPlay() {
|
|
50199
50184
|
// Audio broadcasts should keep the poster up; video should hide poster while playing.
|
|
50200
50185
|
return !this.container.playback.isAudioOnly;
|
|
50201
50186
|
}
|
|
50202
50187
|
update() {
|
|
50203
|
-
trace(`${T$
|
|
50204
|
-
|
|
50205
|
-
});
|
|
50206
|
-
if (!this.shouldRender) {
|
|
50207
|
-
return;
|
|
50208
|
-
}
|
|
50209
|
-
const showPlayButton = !this.playRequested &&
|
|
50210
|
-
!this.hasStartedPlaying &&
|
|
50211
|
-
!this.container.buffering;
|
|
50212
|
-
this.updatePlayButton(showPlayButton);
|
|
50188
|
+
trace(`${T$8} update`);
|
|
50189
|
+
this.updatePlayButton();
|
|
50213
50190
|
this.updatePoster();
|
|
50214
50191
|
}
|
|
50215
50192
|
updatePoster() {
|
|
50216
|
-
trace(`${T$
|
|
50217
|
-
|
|
50218
|
-
});
|
|
50219
|
-
if (!this.hasStartedPlaying) {
|
|
50193
|
+
trace(`${T$8} updatePoster`);
|
|
50194
|
+
if (!this.playing) {
|
|
50220
50195
|
this.showPoster();
|
|
50221
50196
|
}
|
|
50222
50197
|
else {
|
|
@@ -50228,9 +50203,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50228
50203
|
this.$el.show();
|
|
50229
50204
|
}
|
|
50230
50205
|
hidePoster() {
|
|
50231
|
-
trace(`${T$
|
|
50232
|
-
shouldHideOnPlay: this.shouldHideOnPlay(),
|
|
50233
|
-
});
|
|
50206
|
+
trace(`${T$8} hidePoster`);
|
|
50234
50207
|
if (!this.options.disableMediaControl) {
|
|
50235
50208
|
this.container.enableMediaControl();
|
|
50236
50209
|
}
|
|
@@ -50246,27 +50219,24 @@ class Poster extends UIContainerPlugin {
|
|
|
50246
50219
|
return this;
|
|
50247
50220
|
}
|
|
50248
50221
|
this.$el.html(Poster.template());
|
|
50249
|
-
const
|
|
50250
|
-
if (
|
|
50251
|
-
const posterUrl = this.options.poster.url || this.options.poster;
|
|
50252
|
-
this.$el.css({ 'background-image': 'url(' + posterUrl + ')' });
|
|
50253
|
-
}
|
|
50254
|
-
else if (this.options.poster) {
|
|
50222
|
+
const isCustomPoster = this.options.poster?.custom !== undefined;
|
|
50223
|
+
if (isCustomPoster) {
|
|
50255
50224
|
this.$el.css({ background: this.options.poster.custom });
|
|
50256
50225
|
}
|
|
50226
|
+
else {
|
|
50227
|
+
const posterUrl = typeof this.options.poster === 'string'
|
|
50228
|
+
? this.options.poster
|
|
50229
|
+
: this.options.poster?.url;
|
|
50230
|
+
if (posterUrl) {
|
|
50231
|
+
this.$el.css({ 'background-image': 'url(' + posterUrl + ')' });
|
|
50232
|
+
}
|
|
50233
|
+
}
|
|
50257
50234
|
this.container.$el.removeClass('container-with-poster-clickable');
|
|
50258
50235
|
this.container.$el.append(this.el);
|
|
50259
|
-
this.$
|
|
50260
|
-
this
|
|
50261
|
-
|
|
50262
|
-
this.$playWrapper.append(this.$playButton);
|
|
50263
|
-
this.$playButton.append(playIcon);
|
|
50264
|
-
if (this.options.autoPlay) {
|
|
50265
|
-
this.$playButton.hide();
|
|
50236
|
+
this.$el.find('#poster-play').append(playIcon);
|
|
50237
|
+
if (this.options.autoPlay || this.isNoOp) {
|
|
50238
|
+
this.$el.find('#poster-play').hide();
|
|
50266
50239
|
}
|
|
50267
|
-
this.$playButton.addClass('poster-icon');
|
|
50268
|
-
this.$playButton.attr('data-poster', '');
|
|
50269
|
-
this.update();
|
|
50270
50240
|
return this;
|
|
50271
50241
|
}
|
|
50272
50242
|
/**
|
|
@@ -50284,7 +50254,7 @@ const listHtml = "<button class=\"gplayer-lite-btn go-back gcore-skin-text-color
|
|
|
50284
50254
|
|
|
50285
50255
|
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";
|
|
50286
50256
|
|
|
50287
|
-
const T$
|
|
50257
|
+
const T$7 = 'plugins.quality_levels';
|
|
50288
50258
|
const VERSION$2 = 'v2.22.5';
|
|
50289
50259
|
/**
|
|
50290
50260
|
* `PLUGIN` that provides a UI to select the desired quality level of the playback.
|
|
@@ -50361,14 +50331,14 @@ class QualityLevels extends UICorePlugin {
|
|
|
50361
50331
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChange);
|
|
50362
50332
|
}
|
|
50363
50333
|
onCoreReady() {
|
|
50364
|
-
trace(`${T$
|
|
50334
|
+
trace(`${T$7} onCoreReady`);
|
|
50365
50335
|
const gear = this.core.getPlugin('bottom_gear');
|
|
50366
50336
|
assert(gear, 'bottom_gear plugin is required');
|
|
50367
50337
|
this.currentText = this.core.i18n.t('auto');
|
|
50368
50338
|
this.listenTo(gear, GearEvents.RENDERED, this.onGearRendered);
|
|
50369
50339
|
}
|
|
50370
50340
|
onGearRendered() {
|
|
50371
|
-
trace(`${T$
|
|
50341
|
+
trace(`${T$7} onGearRendered`);
|
|
50372
50342
|
this.render();
|
|
50373
50343
|
}
|
|
50374
50344
|
onActiveContainerChange() {
|
|
@@ -50397,7 +50367,7 @@ class QualityLevels extends UICorePlugin {
|
|
|
50397
50367
|
}
|
|
50398
50368
|
}
|
|
50399
50369
|
onStop() {
|
|
50400
|
-
trace(`${T$
|
|
50370
|
+
trace(`${T$7} onStop`);
|
|
50401
50371
|
this.listenToOnce(this.core.activePlayback, Events$1.PLAYBACK_PLAY, () => {
|
|
50402
50372
|
if (this.core.activePlayback.getPlaybackType() === 'live') {
|
|
50403
50373
|
if (this.selectedLevelId !== -1) {
|
|
@@ -50493,7 +50463,7 @@ class QualityLevels extends UICorePlugin {
|
|
|
50493
50463
|
return false;
|
|
50494
50464
|
}
|
|
50495
50465
|
goBack() {
|
|
50496
|
-
trace(`${T$
|
|
50466
|
+
trace(`${T$7} goBack`);
|
|
50497
50467
|
this.core.getPlugin('bottom_gear').refresh();
|
|
50498
50468
|
}
|
|
50499
50469
|
setLevel(index) {
|
|
@@ -50528,11 +50498,11 @@ class QualityLevels extends UICorePlugin {
|
|
|
50528
50498
|
return this.levelLabels[index] ?? formatLevelLabel(this.levels[index]);
|
|
50529
50499
|
}
|
|
50530
50500
|
onBitrate(info) {
|
|
50531
|
-
trace(`${T$
|
|
50501
|
+
trace(`${T$7} updateCurrentLevel`, { info });
|
|
50532
50502
|
this.highlightCurrentLevel();
|
|
50533
50503
|
}
|
|
50534
50504
|
highlightCurrentLevel() {
|
|
50535
|
-
trace(`${T$
|
|
50505
|
+
trace(`${T$7} highlightCurrentLevel`, {
|
|
50536
50506
|
selectedLevelId: this.selectedLevelId,
|
|
50537
50507
|
});
|
|
50538
50508
|
this.allLevelElements()
|
|
@@ -50823,10 +50793,11 @@ class Share extends UICorePlugin {
|
|
|
50823
50793
|
}
|
|
50824
50794
|
}
|
|
50825
50795
|
|
|
50826
|
-
const pluginHtml$1 = "<div class=\"skip-container\"
|
|
50796
|
+
const pluginHtml$1 = "<div class=\"skip-container\" id=\"mc-skip-container\">\n <div class=\"skip-item\" id=\"mc-skip-left\">\n </div>\n <div class=\"skip-item\" id=\"mc-skip-mid\">\n </div>\n <div class=\"skip-item\" id=\"mc-skip-right\">\n </div>\n</div>\n";
|
|
50827
50797
|
|
|
50798
|
+
const T$6 = 'plugins.skip_time';
|
|
50828
50799
|
/**
|
|
50829
|
-
* `PLUGIN` that
|
|
50800
|
+
* `PLUGIN` that allows skipping time by tapping on the left or right side of the video.
|
|
50830
50801
|
* @beta
|
|
50831
50802
|
*/
|
|
50832
50803
|
class SkipTime extends UICorePlugin {
|
|
@@ -50839,39 +50810,56 @@ class SkipTime extends UICorePlugin {
|
|
|
50839
50810
|
get container() {
|
|
50840
50811
|
return this.core && this.core.activeContainer;
|
|
50841
50812
|
}
|
|
50842
|
-
|
|
50843
|
-
|
|
50844
|
-
|
|
50813
|
+
static template = tmpl(pluginHtml$1);
|
|
50814
|
+
/**
|
|
50815
|
+
* @internal
|
|
50816
|
+
*/
|
|
50845
50817
|
get attributes() {
|
|
50846
50818
|
return {
|
|
50847
|
-
class:
|
|
50848
|
-
'data-skip-time': '',
|
|
50819
|
+
class: 'mc-skip-time',
|
|
50849
50820
|
};
|
|
50850
50821
|
}
|
|
50851
50822
|
position = 'mid';
|
|
50823
|
+
/**
|
|
50824
|
+
* @internal
|
|
50825
|
+
*/
|
|
50852
50826
|
get events() {
|
|
50853
50827
|
return {
|
|
50854
|
-
'click
|
|
50855
|
-
'click
|
|
50856
|
-
'click
|
|
50828
|
+
'click #mc-skip-left': 'setBack',
|
|
50829
|
+
'click #mc-skip-mid': 'setMidClick',
|
|
50830
|
+
'click #mc-skip-right': 'setForward',
|
|
50857
50831
|
};
|
|
50858
50832
|
}
|
|
50833
|
+
/**
|
|
50834
|
+
* @internal
|
|
50835
|
+
*/
|
|
50859
50836
|
bindEvents() {
|
|
50860
50837
|
this.listenTo(this.core, Events$1.CORE_READY, this.render);
|
|
50861
|
-
|
|
50862
|
-
|
|
50863
|
-
|
|
50838
|
+
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
|
|
50839
|
+
}
|
|
50840
|
+
onContainerChanged() {
|
|
50864
50841
|
this.listenTo(this.container, Events$1.CONTAINER_DBLCLICK, this.handleRewindClicks);
|
|
50842
|
+
this.mount();
|
|
50865
50843
|
}
|
|
50866
50844
|
setBack() {
|
|
50845
|
+
trace(`${T$6} setBack`);
|
|
50867
50846
|
this.position = 'left';
|
|
50868
50847
|
}
|
|
50869
50848
|
handleRewindClicks() {
|
|
50849
|
+
trace(`${T$6} handleRewindClicks`, {
|
|
50850
|
+
position: this.position,
|
|
50851
|
+
});
|
|
50870
50852
|
if (this.core.getPlaybackType() === Playback.LIVE &&
|
|
50871
50853
|
!this.container.isDvrEnabled()) {
|
|
50872
50854
|
this.toggleFullscreen();
|
|
50873
50855
|
return;
|
|
50874
50856
|
}
|
|
50857
|
+
this.handleSkip();
|
|
50858
|
+
}
|
|
50859
|
+
handleSkip() {
|
|
50860
|
+
trace(`${T$6} handleSkip`, {
|
|
50861
|
+
position: this.position,
|
|
50862
|
+
});
|
|
50875
50863
|
if (Browser.isMobile) {
|
|
50876
50864
|
if (this.position === 'left') {
|
|
50877
50865
|
const seekPos = this.container.getCurrentTime() - 10;
|
|
@@ -50893,24 +50881,31 @@ class SkipTime extends UICorePlugin {
|
|
|
50893
50881
|
}
|
|
50894
50882
|
}
|
|
50895
50883
|
setMidClick() {
|
|
50884
|
+
trace(`${T$6} setMidClick`);
|
|
50896
50885
|
this.position = 'mid';
|
|
50897
50886
|
}
|
|
50898
50887
|
setForward() {
|
|
50888
|
+
trace(`${T$6} setForward`);
|
|
50899
50889
|
this.position = 'right';
|
|
50900
50890
|
}
|
|
50901
50891
|
toggleFullscreen() {
|
|
50892
|
+
trace(`${T$6} toggleFullscreen`);
|
|
50902
50893
|
this.trigger(Events$1.MEDIACONTROL_FULLSCREEN, this.name);
|
|
50903
50894
|
this.container.fullscreen();
|
|
50904
50895
|
this.core.toggleFullscreen();
|
|
50905
50896
|
}
|
|
50897
|
+
/**
|
|
50898
|
+
* @internal
|
|
50899
|
+
*/
|
|
50906
50900
|
render() {
|
|
50907
|
-
|
|
50908
|
-
|
|
50909
|
-
this.core.activeContainer.$el.append(this.el);
|
|
50910
|
-
}
|
|
50911
|
-
this.bindEvents();
|
|
50901
|
+
trace(`${T$6} render`);
|
|
50902
|
+
this.$el.html(SkipTime.template());
|
|
50912
50903
|
return this;
|
|
50913
50904
|
}
|
|
50905
|
+
mount() {
|
|
50906
|
+
trace(`${T$6} mount`);
|
|
50907
|
+
this.core.activeContainer.$el.append(this.el);
|
|
50908
|
+
}
|
|
50914
50909
|
}
|
|
50915
50910
|
|
|
50916
50911
|
const spinnerHTML = "<div data-bounce1></div>\n<div data-bounce2></div>\n<div data-bounce3></div>\n";
|