@gcorevideo/player 2.22.14 → 2.22.16
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/clips/clips.ejs +1 -0
- package/assets/clips/clips.scss +23 -3
- package/assets/context-menu/context_menu.ejs +14 -6
- package/assets/context-menu/context_menu.scss +18 -4
- package/assets/level-selector/list.ejs +9 -3
- package/assets/media-control/media-control.ejs +1 -9
- package/assets/media-control/media-control.scss +0 -25
- package/assets/media-control/width370.scss +4 -4
- package/dist/core.js +5 -23
- package/dist/index.css +424 -412
- package/dist/index.js +294 -286
- package/dist/player.d.ts +211 -144
- package/dist/plugins/index.css +1513 -1501
- package/dist/plugins/index.js +224 -227
- package/docs/api/{player.audioselector.md → player.audiotracks.md} +3 -3
- package/docs/api/player.contextmenu.md +2 -0
- package/docs/api/player.contextmenupluginsettings.md +2 -40
- package/docs/api/{player.contextmenupluginsettings.label.md → player.contextmenupluginsettings.options.md} +3 -3
- package/docs/api/player.md +78 -23
- package/docs/api/player.mediacontrol.md +8 -14
- package/docs/api/player.mediacontrolelement.md +4 -2
- package/docs/api/{player.contextmenupluginsettings.preventshowcontextmenu.md → player.mediacontrollayerelement.md} +5 -3
- package/docs/api/player.mediacontrolleftelement.md +16 -0
- package/docs/api/player.mediacontrolrightelement.md +16 -0
- package/docs/api/player.mediacontrolsettings.md +23 -0
- package/docs/api/{player.contextmenupluginsettings.url.md → player.menuoption.md} +10 -3
- package/docs/api/player.playbackrate.md +1 -1
- package/docs/api/player.playerconfig.md +1 -1
- package/docs/api/player.playerconfig.playbacktype.md +1 -1
- package/docs/api/{player.levelselector.events.md → player.qualitylevels.events.md} +2 -2
- package/docs/api/{player.levelselector.md → player.qualitylevels.md} +6 -6
- package/docs/api/{player.levelselectorpluginsettings.labels.md → player.qualitylevelspluginsettings.labels.md} +2 -2
- package/docs/api/{player.levelselectorpluginsettings.md → player.qualitylevelspluginsettings.md} +6 -6
- package/docs/api/{player.levelselectorpluginsettings.restrictresolution.md → player.qualitylevelspluginsettings.restrictresolution.md} +2 -2
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +4 -1
- package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
- package/lib/playback/hls-playback/HlsPlayback.js +0 -21
- package/lib/plugins/click-to-pause/ClickToPause.js +1 -1
- package/lib/plugins/clips/Clips.d.ts +21 -16
- package/lib/plugins/clips/Clips.d.ts.map +1 -1
- package/lib/plugins/clips/Clips.js +96 -98
- package/lib/plugins/clips/types.d.ts +19 -0
- package/lib/plugins/clips/types.d.ts.map +1 -0
- package/lib/plugins/clips/types.js +1 -0
- package/lib/plugins/clips/utils.d.ts +4 -0
- package/lib/plugins/clips/utils.d.ts.map +1 -0
- package/lib/plugins/clips/utils.js +36 -0
- package/lib/plugins/context-menu/ContextMenu.d.ts +33 -12
- package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
- package/lib/plugins/context-menu/ContextMenu.js +40 -37
- package/lib/plugins/media-control/MediaControl.d.ts +4 -7
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +19 -31
- package/lib/plugins/utils.d.ts +9 -1
- package/lib/plugins/utils.d.ts.map +1 -1
- package/lib/plugins/utils.js +9 -10
- package/lib/plugins/vast-ads/loaderxml.js +2 -2
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +2 -5
- package/package.json +1 -1
- package/src/Player.ts +4 -3
- package/src/playback/hls-playback/HlsPlayback.ts +0 -22
- package/src/plugins/click-to-pause/ClickToPause.ts +1 -1
- package/src/plugins/clips/Clips.ts +116 -135
- package/src/plugins/clips/__tests__/Clips.test.ts +72 -0
- package/src/plugins/clips/__tests__/__snapshots__/Clips.test.ts.snap +14 -0
- package/src/plugins/clips/types.ts +22 -0
- package/src/plugins/clips/utils.ts +54 -0
- package/src/plugins/context-menu/ContextMenu.ts +72 -56
- package/src/plugins/level-selector/__tests__/__snapshots__/QualityLevels.test.ts.snap +18 -18
- package/src/plugins/media-control/MediaControl.ts +31 -58
- package/src/plugins/media-control/__tests__/MediaControl.test.ts +66 -30
- package/src/plugins/media-control/__tests__/__snapshots__/MediaControl.test.ts.snap +7 -35
- package/src/plugins/utils.ts +9 -7
- package/src/plugins/vast-ads/loaderxml.ts +2 -2
- package/src/testUtils.ts +2 -5
- package/temp/player.api.json +332 -262
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.mediacontrol.handlecustomarea.md +0 -52
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;
|
|
@@ -12956,10 +12956,10 @@ class DashPlayback extends BasePlayback {
|
|
|
12956
12956
|
}
|
|
12957
12957
|
_onPlaybackError = (event) => {
|
|
12958
12958
|
// TODO
|
|
12959
|
-
trace(`${T$
|
|
12959
|
+
trace(`${T$l} _onPlaybackError`, { event });
|
|
12960
12960
|
};
|
|
12961
12961
|
_onDASHJSSError = (event) => {
|
|
12962
|
-
trace(`${T$
|
|
12962
|
+
trace(`${T$l} _onDASHJSSError`, { event });
|
|
12963
12963
|
this._stopTimeUpdateTimer();
|
|
12964
12964
|
// Note that the other error types are deprecated
|
|
12965
12965
|
const e = event.error;
|
|
@@ -12994,7 +12994,7 @@ class DashPlayback extends BasePlayback {
|
|
|
12994
12994
|
}
|
|
12995
12995
|
};
|
|
12996
12996
|
triggerError(error) {
|
|
12997
|
-
trace(`${T$
|
|
12997
|
+
trace(`${T$l} triggerError`, { error });
|
|
12998
12998
|
// this triggers Events.ERROR to be handled by the UI
|
|
12999
12999
|
this.trigger(Events$1.PLAYBACK_ERROR, this.createError(error, {
|
|
13000
13000
|
useCodePrefix: false,
|
|
@@ -13033,10 +13033,10 @@ class DashPlayback extends BasePlayback {
|
|
|
13033
13033
|
}
|
|
13034
13034
|
get dvrEnabled() {
|
|
13035
13035
|
if (!this._dash) {
|
|
13036
|
-
trace(`${T$
|
|
13036
|
+
trace(`${T$l} dvrEnable no dash player instance`);
|
|
13037
13037
|
return false;
|
|
13038
13038
|
}
|
|
13039
|
-
trace(`${T$
|
|
13039
|
+
trace(`${T$l} get.dvrEnabled`, {
|
|
13040
13040
|
dvrWindowSize: this._dash?.getDVRWindowSize(),
|
|
13041
13041
|
minDvrSize: this._minDvrSize,
|
|
13042
13042
|
playbackType: this.getPlaybackType(),
|
|
@@ -13060,7 +13060,7 @@ class DashPlayback extends BasePlayback {
|
|
|
13060
13060
|
this.trigger(Events$1.PLAYBACK_PROGRESS, progress, {});
|
|
13061
13061
|
}
|
|
13062
13062
|
play() {
|
|
13063
|
-
trace(`${T$
|
|
13063
|
+
trace(`${T$l} play`, { dash: !!this._dash });
|
|
13064
13064
|
if (!this._dash) {
|
|
13065
13065
|
this._setup();
|
|
13066
13066
|
}
|
|
@@ -13146,7 +13146,7 @@ class DashPlayback extends BasePlayback {
|
|
|
13146
13146
|
}
|
|
13147
13147
|
// @ts-expect-error
|
|
13148
13148
|
get currentAudioTrack() {
|
|
13149
|
-
trace(`${T$
|
|
13149
|
+
trace(`${T$l} get currentAudioTrack`);
|
|
13150
13150
|
assert.ok(this._dash, 'DASH.js MediaPlayer is not initialized');
|
|
13151
13151
|
const t = this._dash.getCurrentTrackFor('audio');
|
|
13152
13152
|
if (!t) {
|
|
@@ -41837,7 +41837,7 @@ Hls.defaultConfig = undefined;
|
|
|
41837
41837
|
|
|
41838
41838
|
// assert(process.env.CLAPPR_VERSION, 'CLAPPR_VERSION is required');
|
|
41839
41839
|
// export const CLAPPR_VERSION: string = process.env.CLAPPR_VERSION || '0.11.3';
|
|
41840
|
-
const CLAPPR_VERSION = '0.11.3';
|
|
41840
|
+
const CLAPPR_VERSION$1 = '0.11.3';
|
|
41841
41841
|
|
|
41842
41842
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
41843
41843
|
// Use of this source code is governed by a BSD-style
|
|
@@ -41847,7 +41847,7 @@ const AUTO = -1;
|
|
|
41847
41847
|
const DEFAULT_RECOVER_ATTEMPTS = 16;
|
|
41848
41848
|
Events$1.register('PLAYBACK_FRAGMENT_CHANGED');
|
|
41849
41849
|
Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
|
|
41850
|
-
const T$
|
|
41850
|
+
const T$k = 'playback.hls';
|
|
41851
41851
|
class HlsPlayback extends BasePlayback {
|
|
41852
41852
|
_ccIsSetup = false;
|
|
41853
41853
|
_ccTracksUpdated = false;
|
|
@@ -41878,7 +41878,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
41878
41878
|
return 'hls';
|
|
41879
41879
|
}
|
|
41880
41880
|
get supportedVersion() {
|
|
41881
|
-
return { min: CLAPPR_VERSION };
|
|
41881
|
+
return { min: CLAPPR_VERSION$1 };
|
|
41882
41882
|
}
|
|
41883
41883
|
get levels() {
|
|
41884
41884
|
return this._levels || [];
|
|
@@ -42076,7 +42076,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42076
42076
|
maxBufferLength: 2,
|
|
42077
42077
|
maxMaxBufferLength: 4,
|
|
42078
42078
|
}, this.options.playback.hlsjsConfig);
|
|
42079
|
-
trace(`${T$
|
|
42079
|
+
trace(`${T$k} _createHLSInstance`, { config });
|
|
42080
42080
|
this._hls = new Hls(config);
|
|
42081
42081
|
}
|
|
42082
42082
|
_attachHLSMedia() {
|
|
@@ -42167,7 +42167,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42167
42167
|
}
|
|
42168
42168
|
else {
|
|
42169
42169
|
Log.error('hlsjs: failed to recover', { evt, data });
|
|
42170
|
-
trace(`${T$
|
|
42170
|
+
trace(`${T$k} _recover failed to recover`, {
|
|
42171
42171
|
type: data.type,
|
|
42172
42172
|
details: data.details,
|
|
42173
42173
|
});
|
|
@@ -42219,16 +42219,6 @@ class HlsPlayback extends BasePlayback {
|
|
|
42219
42219
|
this.seek(seekTo);
|
|
42220
42220
|
}
|
|
42221
42221
|
seek(time) {
|
|
42222
|
-
// trace(`${T} seek`, {
|
|
42223
|
-
// time,
|
|
42224
|
-
// duration: this._duration,
|
|
42225
|
-
// startTime: this._startTime,
|
|
42226
|
-
// currentTimestamp: this.currentTimestamp,
|
|
42227
|
-
// playbackType: this.getPlaybackType(),
|
|
42228
|
-
// dvrEnabled: this.dvrEnabled,
|
|
42229
|
-
// durationExcludesAfterLiveSyncPoint: this._durationExcludesAfterLiveSyncPoint,
|
|
42230
|
-
// minDvrSize: this._minDvrSize,
|
|
42231
|
-
// })
|
|
42232
42222
|
if (time < 0) {
|
|
42233
42223
|
Log.warn('Attempt to seek to a negative time. Resetting to live point. Use seekToLivePoint() to seek to the live point.');
|
|
42234
42224
|
time = this.getDuration();
|
|
@@ -42263,7 +42253,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42263
42253
|
this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
|
|
42264
42254
|
}
|
|
42265
42255
|
_onHLSJSError(evt, data) {
|
|
42266
|
-
trace(`${T$
|
|
42256
|
+
trace(`${T$k} _onHLSJSError`, {
|
|
42267
42257
|
fatal: data.fatal,
|
|
42268
42258
|
type: data.type,
|
|
42269
42259
|
details: data.details,
|
|
@@ -42311,7 +42301,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42311
42301
|
evt,
|
|
42312
42302
|
data,
|
|
42313
42303
|
});
|
|
42314
|
-
trace(`${T$
|
|
42304
|
+
trace(`${T$k} _onHLSJSError trying to recover from network error`, {
|
|
42315
42305
|
details: data.details,
|
|
42316
42306
|
});
|
|
42317
42307
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42324,7 +42314,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42324
42314
|
evt,
|
|
42325
42315
|
data,
|
|
42326
42316
|
});
|
|
42327
|
-
trace(`${T$
|
|
42317
|
+
trace(`${T$k} _onHLSJSError trying to recover from media error`, {
|
|
42328
42318
|
details: data.details,
|
|
42329
42319
|
});
|
|
42330
42320
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42354,7 +42344,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42354
42344
|
return;
|
|
42355
42345
|
}
|
|
42356
42346
|
Log.warn('hlsjs: non-fatal error occurred', { evt, data });
|
|
42357
|
-
trace(`${T$
|
|
42347
|
+
trace(`${T$k} _onHLSJSError non-fatal error occurred`, {
|
|
42358
42348
|
type: data.type,
|
|
42359
42349
|
details: data.details,
|
|
42360
42350
|
});
|
|
@@ -42380,11 +42370,6 @@ class HlsPlayback extends BasePlayback {
|
|
|
42380
42370
|
return;
|
|
42381
42371
|
}
|
|
42382
42372
|
this._lastTimeUpdate = update;
|
|
42383
|
-
// trace(`${T} _onTimeUpdate`, {
|
|
42384
|
-
// current: update.current,
|
|
42385
|
-
// total: update.total,
|
|
42386
|
-
// firstFragDateTime: update.firstFragDateTime,
|
|
42387
|
-
// })
|
|
42388
42373
|
this.trigger(Events$1.PLAYBACK_TIMEUPDATE, update, this.name);
|
|
42389
42374
|
}
|
|
42390
42375
|
_onDurationChange() {
|
|
@@ -42655,12 +42640,6 @@ class HlsPlayback extends BasePlayback {
|
|
|
42655
42640
|
this.trigger(Events$1.PLAYBACK_LEVEL_SWITCH_END);
|
|
42656
42641
|
}
|
|
42657
42642
|
get dvrEnabled() {
|
|
42658
|
-
// trace(`${T} dvrEnabled`, {
|
|
42659
|
-
// durationExcludesAfterLiveSyncPoint: this._durationExcludesAfterLiveSyncPoint,
|
|
42660
|
-
// duration: this._duration,
|
|
42661
|
-
// minDvrSize: this._minDvrSize,
|
|
42662
|
-
// playbackType: this.getPlaybackType(),
|
|
42663
|
-
// })
|
|
42664
42643
|
// enabled when:
|
|
42665
42644
|
// - the duration does not include content after hlsjs's live sync point
|
|
42666
42645
|
// - the playable region duration is longer than the configured duration to enable dvr after
|
|
@@ -42700,11 +42679,11 @@ class HlsPlayback extends BasePlayback {
|
|
|
42700
42679
|
this._hls.audioTrack = Number(id); // TODO or find index by .id == id?
|
|
42701
42680
|
}
|
|
42702
42681
|
_onAudioTracksUpdated(_, data) {
|
|
42703
|
-
trace(`${T$
|
|
42682
|
+
trace(`${T$k} onAudioTracksUpdated`);
|
|
42704
42683
|
this.trigger(Events$1.PLAYBACK_AUDIO_AVAILABLE, data.audioTracks.map(toClapprTrack));
|
|
42705
42684
|
}
|
|
42706
42685
|
_onAudioTrackSwitched(_, data) {
|
|
42707
|
-
trace(`${T$
|
|
42686
|
+
trace(`${T$k} onAudioTrackSwitched`);
|
|
42708
42687
|
// @ts-ignore
|
|
42709
42688
|
const track = this._hls.audioTracks[data.id];
|
|
42710
42689
|
this.trigger(Events$1.PLAYBACK_AUDIO_CHANGED, toClapprTrack(track));
|
|
@@ -42725,7 +42704,7 @@ function toClapprTrack(t) {
|
|
|
42725
42704
|
};
|
|
42726
42705
|
}
|
|
42727
42706
|
|
|
42728
|
-
const T$
|
|
42707
|
+
const T$j = 'playback.html5_video';
|
|
42729
42708
|
const STALL_TIMEOUT = 15000;
|
|
42730
42709
|
class HTML5Video extends BasePlayback {
|
|
42731
42710
|
stallTimerId = null;
|
|
@@ -42733,7 +42712,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42733
42712
|
* @internal
|
|
42734
42713
|
*/
|
|
42735
42714
|
createError(errorData, options) {
|
|
42736
|
-
trace(`${T$
|
|
42715
|
+
trace(`${T$j} createError`, {
|
|
42737
42716
|
errorData: { ...errorData },
|
|
42738
42717
|
});
|
|
42739
42718
|
const i18n = this.i18n ||
|
|
@@ -42749,11 +42728,11 @@ class HTML5Video extends BasePlayback {
|
|
|
42749
42728
|
return super.createError(errorData, { ...options, useCodePrefix: false });
|
|
42750
42729
|
}
|
|
42751
42730
|
_onWaiting() {
|
|
42752
|
-
trace(`${T$
|
|
42731
|
+
trace(`${T$j} _onWaiting`);
|
|
42753
42732
|
super._onWaiting();
|
|
42754
42733
|
}
|
|
42755
42734
|
_onEnded() {
|
|
42756
|
-
trace(`${T$
|
|
42735
|
+
trace(`${T$j} _onEnded`);
|
|
42757
42736
|
if (this.stallTimerId) {
|
|
42758
42737
|
clearTimeout(this.stallTimerId);
|
|
42759
42738
|
this.stallTimerId = null;
|
|
@@ -42761,12 +42740,12 @@ class HTML5Video extends BasePlayback {
|
|
|
42761
42740
|
super._onEnded();
|
|
42762
42741
|
}
|
|
42763
42742
|
_handleBufferingEvents() {
|
|
42764
|
-
trace(`${T$
|
|
42743
|
+
trace(`${T$j} _handleBufferingEvents`, {
|
|
42765
42744
|
networkState: this.el.networkState,
|
|
42766
42745
|
});
|
|
42767
42746
|
if (!this.stallTimerId) {
|
|
42768
42747
|
this.stallTimerId = setTimeout(() => {
|
|
42769
|
-
trace(`${T$
|
|
42748
|
+
trace(`${T$j} _handleBufferingEvents stall timeout`, {
|
|
42770
42749
|
buffering: this.buffering,
|
|
42771
42750
|
ended: this.ended,
|
|
42772
42751
|
});
|
|
@@ -42784,7 +42763,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42784
42763
|
super._handleBufferingEvents();
|
|
42785
42764
|
}
|
|
42786
42765
|
_onPlaying() {
|
|
42787
|
-
trace(`${T$
|
|
42766
|
+
trace(`${T$j} _onPlaying`);
|
|
42788
42767
|
if (this.stallTimerId) {
|
|
42789
42768
|
clearTimeout(this.stallTimerId);
|
|
42790
42769
|
this.stallTimerId = null;
|
|
@@ -42792,7 +42771,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42792
42771
|
super._onPlaying();
|
|
42793
42772
|
}
|
|
42794
42773
|
_onPause() {
|
|
42795
|
-
trace(`${T$
|
|
42774
|
+
trace(`${T$j} _onPause`);
|
|
42796
42775
|
super._onPause();
|
|
42797
42776
|
if (this.stallTimerId) {
|
|
42798
42777
|
clearTimeout(this.stallTimerId);
|
|
@@ -42802,7 +42781,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42802
42781
|
get audioTracks() {
|
|
42803
42782
|
const tracks = this.el.audioTracks;
|
|
42804
42783
|
const supported = !!tracks;
|
|
42805
|
-
trace(`${T$
|
|
42784
|
+
trace(`${T$j} get audioTracks`, { supported });
|
|
42806
42785
|
const retval = [];
|
|
42807
42786
|
if (supported) {
|
|
42808
42787
|
for (let i = 0; i < tracks.length; i++) {
|
|
@@ -42821,7 +42800,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42821
42800
|
get currentAudioTrack() {
|
|
42822
42801
|
const tracks = this.el.audioTracks;
|
|
42823
42802
|
const supported = !!tracks;
|
|
42824
|
-
trace(`${T$
|
|
42803
|
+
trace(`${T$j} get currentAudioTrack`, {
|
|
42825
42804
|
supported,
|
|
42826
42805
|
});
|
|
42827
42806
|
if (supported) {
|
|
@@ -42842,7 +42821,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42842
42821
|
switchAudioTrack(id) {
|
|
42843
42822
|
const tracks = this.el.audioTracks;
|
|
42844
42823
|
const supported = !!tracks;
|
|
42845
|
-
trace(`${T$
|
|
42824
|
+
trace(`${T$j} switchAudioTrack`, {
|
|
42846
42825
|
supported,
|
|
42847
42826
|
});
|
|
42848
42827
|
if (supported) {
|
|
@@ -42861,7 +42840,7 @@ function registerPlaybacks() {
|
|
|
42861
42840
|
Loader.registerPlayback(DashPlayback);
|
|
42862
42841
|
}
|
|
42863
42842
|
|
|
42864
|
-
const T$
|
|
42843
|
+
const T$i = 'GPlayer';
|
|
42865
42844
|
const DEFAULT_OPTIONS = {
|
|
42866
42845
|
autoPlay: false,
|
|
42867
42846
|
debug: 'none',
|
|
@@ -42949,6 +42928,9 @@ class Player {
|
|
|
42949
42928
|
* ```
|
|
42950
42929
|
*/
|
|
42951
42930
|
attachTo(playerElement) {
|
|
42931
|
+
trace(`${T$i} attachTo`, {
|
|
42932
|
+
player: !!this.player,
|
|
42933
|
+
});
|
|
42952
42934
|
assert.ok(!this.player, 'Player already initialized');
|
|
42953
42935
|
assert.ok(playerElement, 'Player container element is required');
|
|
42954
42936
|
if (this.config.debug === 'all' || this.config.debug === 'clappr') {
|
|
@@ -42956,7 +42938,7 @@ class Player {
|
|
|
42956
42938
|
}
|
|
42957
42939
|
const coreOpts = this.buildCoreOptions(playerElement);
|
|
42958
42940
|
const { core, container } = Player.getRegisteredPlugins();
|
|
42959
|
-
trace(`${T$
|
|
42941
|
+
trace(`${T$i} init`, {
|
|
42960
42942
|
registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.prototype.name),
|
|
42961
42943
|
});
|
|
42962
42944
|
coreOpts.plugins = {
|
|
@@ -42970,7 +42952,7 @@ class Player {
|
|
|
42970
42952
|
* Destroys the player, releasing all resources and unmounting its UI from the DOM.
|
|
42971
42953
|
*/
|
|
42972
42954
|
destroy() {
|
|
42973
|
-
trace(`${T$
|
|
42955
|
+
trace(`${T$i} destroy`, {
|
|
42974
42956
|
player: !!this.player,
|
|
42975
42957
|
});
|
|
42976
42958
|
if (this.player) {
|
|
@@ -43157,12 +43139,12 @@ class Player {
|
|
|
43157
43139
|
this.config = $.extend(true, this.config, config);
|
|
43158
43140
|
}
|
|
43159
43141
|
initPlayer(coreOptions) {
|
|
43160
|
-
trace(`${T$
|
|
43142
|
+
trace(`${T$i} initPlayer`, {
|
|
43161
43143
|
autoPlay: coreOptions.autoPlay,
|
|
43162
43144
|
sources: coreOptions.sources,
|
|
43145
|
+
player: !!this.player,
|
|
43163
43146
|
// TODO selected options
|
|
43164
43147
|
});
|
|
43165
|
-
assert.ok(!this.player, 'Player already initialized');
|
|
43166
43148
|
const player = new Player$1(coreOptions);
|
|
43167
43149
|
this.player = player;
|
|
43168
43150
|
this.bindCoreListeners();
|
|
@@ -43182,7 +43164,7 @@ class Player {
|
|
|
43182
43164
|
}
|
|
43183
43165
|
}
|
|
43184
43166
|
triggerAutoPlay() {
|
|
43185
|
-
trace(`${T$
|
|
43167
|
+
trace(`${T$i} triggerAutoPlay`);
|
|
43186
43168
|
setTimeout(() => {
|
|
43187
43169
|
this.player?.play({
|
|
43188
43170
|
autoPlay: true,
|
|
@@ -43200,7 +43182,7 @@ class Player {
|
|
|
43200
43182
|
// TODO test
|
|
43201
43183
|
events = {
|
|
43202
43184
|
onReady: () => {
|
|
43203
|
-
trace(`${T$
|
|
43185
|
+
trace(`${T$i} onReady`, {
|
|
43204
43186
|
ready: this.ready,
|
|
43205
43187
|
});
|
|
43206
43188
|
if (this.ready) {
|
|
@@ -43234,7 +43216,7 @@ class Player {
|
|
|
43234
43216
|
buildCoreOptions(rootNode) {
|
|
43235
43217
|
const sources = this.buildMediaSourcesList();
|
|
43236
43218
|
const source = sources[0];
|
|
43237
|
-
trace(`${T$
|
|
43219
|
+
trace(`${T$i} buildCoreOptions`, {
|
|
43238
43220
|
source,
|
|
43239
43221
|
sources,
|
|
43240
43222
|
});
|
|
@@ -43295,7 +43277,7 @@ class Player {
|
|
|
43295
43277
|
assert.ok(this.player, 'Player is not initialized');
|
|
43296
43278
|
const core = this.player.core;
|
|
43297
43279
|
core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
|
|
43298
|
-
trace(`${T$
|
|
43280
|
+
trace(`${T$i} on CORE_SCREEN_ORIENTATION_CHANGED`, {
|
|
43299
43281
|
orientation,
|
|
43300
43282
|
rootNode: {
|
|
43301
43283
|
width: this.rootNode?.clientWidth,
|
|
@@ -43310,14 +43292,14 @@ class Player {
|
|
|
43310
43292
|
}
|
|
43311
43293
|
}, null);
|
|
43312
43294
|
core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
|
|
43313
|
-
trace(`${T$
|
|
43295
|
+
trace(`${T$i} on CORE_RESIZE`, {
|
|
43314
43296
|
width,
|
|
43315
43297
|
height,
|
|
43316
43298
|
});
|
|
43317
43299
|
this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
|
|
43318
43300
|
}, null);
|
|
43319
43301
|
core.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
|
|
43320
|
-
trace(`${T$
|
|
43302
|
+
trace(`${T$i} CORE_FULLSCREEN`, {
|
|
43321
43303
|
isFullscreen,
|
|
43322
43304
|
});
|
|
43323
43305
|
this.safeTriggerEvent(PlayerEvent.Fullscreen, isFullscreen);
|
|
@@ -43325,7 +43307,7 @@ class Player {
|
|
|
43325
43307
|
}
|
|
43326
43308
|
}
|
|
43327
43309
|
|
|
43328
|
-
var version$1 = "2.22.
|
|
43310
|
+
var version$1 = "2.22.16";
|
|
43329
43311
|
|
|
43330
43312
|
var packages = {
|
|
43331
43313
|
"node_modules/@clappr/core": {
|
|
@@ -43353,7 +43335,7 @@ const pluginHtml$7 = "<button data-audiotracks-button class='gcore-skin-button-c
|
|
|
43353
43335
|
|
|
43354
43336
|
const audioArrow = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg width=\"9px\" height=\"6px\" viewBox=\"0 0 9 6\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <!-- Generator: Sketch 49 (51002) - http://www.bohemiancoding.com/sketch -->\n <title>quality-arrow</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id=\"quality-arrow\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <path\n d=\"M5.07079194,5.78553848 C4.91457318,5.94277844 4.70551573,6.00941824 4.50028717,5.99893557 C4.2950586,6.00941824 4.08676693,5.94277844 3.92978239,5.78553848 L0.221118462,1.2997069 C-0.0737061539,1.00469478 -0.0737061539,0.526236029 0.221118462,0.231972666 C0.515177299,-0.0630394586 1.23500883,0.00734414472 1.64852907,0.00734414472 L7.77475484,0.00734414472 C8.21201421,0.00734414472 8.48539703,-0.0630394586 8.77945587,0.231972666 C9.07351471,0.526236029 9.07351471,1.00469478 8.77945587,1.2997069 L5.07079194,5.78553848 Z\"\n fill=\"#FFFFFE\"></path>\n </g>\n</svg>\n";
|
|
43355
43337
|
|
|
43356
|
-
const VERSION$
|
|
43338
|
+
const VERSION$7 = '2.22.4';
|
|
43357
43339
|
// const T = 'plugins.audiotracks'
|
|
43358
43340
|
/**
|
|
43359
43341
|
* `PLUGIN` that makes possible to switch audio tracks via the media control UI.
|
|
@@ -43378,13 +43360,13 @@ class AudioTracks extends UICorePlugin {
|
|
|
43378
43360
|
* @internal
|
|
43379
43361
|
*/
|
|
43380
43362
|
get supportedVersion() {
|
|
43381
|
-
return { min: CLAPPR_VERSION };
|
|
43363
|
+
return { min: CLAPPR_VERSION$1 };
|
|
43382
43364
|
}
|
|
43383
43365
|
/**
|
|
43384
43366
|
* @internal
|
|
43385
43367
|
*/
|
|
43386
43368
|
static get version() {
|
|
43387
|
-
return VERSION$
|
|
43369
|
+
return VERSION$7;
|
|
43388
43370
|
}
|
|
43389
43371
|
static template = tmpl(pluginHtml$7);
|
|
43390
43372
|
/**
|
|
@@ -43517,7 +43499,7 @@ const volumeOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
|
|
|
43517
43499
|
|
|
43518
43500
|
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";
|
|
43519
43501
|
|
|
43520
|
-
const T$
|
|
43502
|
+
const T$h = 'plugins.big_mute_button';
|
|
43521
43503
|
// TODO rewrite as a container plugin
|
|
43522
43504
|
/**
|
|
43523
43505
|
* `PLUGIN` that displays a big mute button over the video when it's muted.
|
|
@@ -43539,7 +43521,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43539
43521
|
* @internal
|
|
43540
43522
|
*/
|
|
43541
43523
|
get supportedVersion() {
|
|
43542
|
-
return { min: CLAPPR_VERSION };
|
|
43524
|
+
return { min: CLAPPR_VERSION$1 };
|
|
43543
43525
|
}
|
|
43544
43526
|
static template = tmpl(pluginHtml$6);
|
|
43545
43527
|
/**
|
|
@@ -43558,7 +43540,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43558
43540
|
this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
43559
43541
|
this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
|
|
43560
43542
|
this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
|
|
43561
|
-
trace(`${T$
|
|
43543
|
+
trace(`${T$h} bindEvents`, {
|
|
43562
43544
|
mediacontrol: !!this.core.mediaControl,
|
|
43563
43545
|
});
|
|
43564
43546
|
this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
|
|
@@ -43583,12 +43565,12 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43583
43565
|
}
|
|
43584
43566
|
mediaControlRendered() {
|
|
43585
43567
|
const container = this.core.activeContainer;
|
|
43586
|
-
trace(`${T$
|
|
43568
|
+
trace(`${T$h} mediaControlRendered`, {
|
|
43587
43569
|
container: !!container,
|
|
43588
43570
|
});
|
|
43589
43571
|
if (container) {
|
|
43590
43572
|
this.listenTo(container.playback, Events$1.PLAYBACK_PLAY, () => {
|
|
43591
|
-
trace(`${T$
|
|
43573
|
+
trace(`${T$h} PLAYBACK_PLAY`);
|
|
43592
43574
|
this.render();
|
|
43593
43575
|
});
|
|
43594
43576
|
}
|
|
@@ -43612,7 +43594,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43612
43594
|
}
|
|
43613
43595
|
const { autoPlay, wasMuted } = this.options;
|
|
43614
43596
|
const volume = container.volume;
|
|
43615
|
-
trace(`${T$
|
|
43597
|
+
trace(`${T$h} shouldRender`, {
|
|
43616
43598
|
autoPlay,
|
|
43617
43599
|
wasMuted,
|
|
43618
43600
|
volume,
|
|
@@ -43624,7 +43606,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43624
43606
|
*/
|
|
43625
43607
|
render() {
|
|
43626
43608
|
if (this.shouldRender()) {
|
|
43627
|
-
trace(`${T$
|
|
43609
|
+
trace(`${T$h} render`, {
|
|
43628
43610
|
el: !!this.$el,
|
|
43629
43611
|
});
|
|
43630
43612
|
this.$el.html(BigMuteButton.template());
|
|
@@ -43669,8 +43651,8 @@ const gearIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"n
|
|
|
43669
43651
|
|
|
43670
43652
|
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";
|
|
43671
43653
|
|
|
43672
|
-
const VERSION$
|
|
43673
|
-
const T$
|
|
43654
|
+
const VERSION$6 = '2.19.12';
|
|
43655
|
+
const T$g = 'plugins.bottom_gear';
|
|
43674
43656
|
/**
|
|
43675
43657
|
* Events triggered by the plugin
|
|
43676
43658
|
* @beta
|
|
@@ -43763,13 +43745,13 @@ class BottomGear extends UICorePlugin {
|
|
|
43763
43745
|
* @internal
|
|
43764
43746
|
*/
|
|
43765
43747
|
get supportedVersion() {
|
|
43766
|
-
return { min: CLAPPR_VERSION };
|
|
43748
|
+
return { min: CLAPPR_VERSION$1 };
|
|
43767
43749
|
}
|
|
43768
43750
|
/**
|
|
43769
43751
|
* @internal
|
|
43770
43752
|
*/
|
|
43771
43753
|
static get version() {
|
|
43772
|
-
return VERSION$
|
|
43754
|
+
return VERSION$6;
|
|
43773
43755
|
}
|
|
43774
43756
|
static template = tmpl(pluginHtml$5);
|
|
43775
43757
|
/**
|
|
@@ -43820,20 +43802,20 @@ class BottomGear extends UICorePlugin {
|
|
|
43820
43802
|
addItem(name, $subMenu) {
|
|
43821
43803
|
const $existingItem = this.$el.find(`#gear-options li[data-${name}`);
|
|
43822
43804
|
if ($existingItem.length) {
|
|
43823
|
-
trace(`${T$
|
|
43805
|
+
trace(`${T$g} addItem already exists`, { name });
|
|
43824
43806
|
return $existingItem;
|
|
43825
43807
|
}
|
|
43826
43808
|
const $item = $('<li></li>')
|
|
43827
43809
|
.attr(`data-${name}`, '')
|
|
43828
43810
|
.appendTo(this.$el.find('#gear-options'));
|
|
43829
43811
|
if ($subMenu) {
|
|
43830
|
-
trace(`${T$
|
|
43812
|
+
trace(`${T$g} addItem adding submenu`, { name });
|
|
43831
43813
|
$subMenu
|
|
43832
43814
|
.addClass('gear-sub-menu-wrapper')
|
|
43833
43815
|
.hide()
|
|
43834
43816
|
.appendTo(this.$el.find('#gear-options-wrapper'));
|
|
43835
43817
|
$item.on('click', (e) => {
|
|
43836
|
-
trace(`${T$
|
|
43818
|
+
trace(`${T$g} addItem submenu clicked`, { name });
|
|
43837
43819
|
e.stopPropagation();
|
|
43838
43820
|
$subMenu.show();
|
|
43839
43821
|
this.$el.find('#gear-options').hide();
|
|
@@ -43842,15 +43824,15 @@ class BottomGear extends UICorePlugin {
|
|
|
43842
43824
|
return $item;
|
|
43843
43825
|
}
|
|
43844
43826
|
onActiveContainerChanged() {
|
|
43845
|
-
trace(`${T$
|
|
43827
|
+
trace(`${T$g} onActiveContainerChanged`);
|
|
43846
43828
|
this.bindContainerEvents();
|
|
43847
43829
|
}
|
|
43848
43830
|
bindContainerEvents() {
|
|
43849
|
-
trace(`${T$
|
|
43831
|
+
trace(`${T$g} bindContainerEvents`);
|
|
43850
43832
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
|
|
43851
43833
|
}
|
|
43852
43834
|
highDefinitionUpdate(isHd) {
|
|
43853
|
-
trace(`${T$
|
|
43835
|
+
trace(`${T$g} highDefinitionUpdate`, { isHd });
|
|
43854
43836
|
this.isHd = isHd;
|
|
43855
43837
|
this.$el.find('.gear-icon').html(isHd ? gearHdIcon : gearIcon);
|
|
43856
43838
|
}
|
|
@@ -43858,7 +43840,7 @@ class BottomGear extends UICorePlugin {
|
|
|
43858
43840
|
* @internal
|
|
43859
43841
|
*/
|
|
43860
43842
|
render() {
|
|
43861
|
-
trace(`${T$
|
|
43843
|
+
trace(`${T$g} render`);
|
|
43862
43844
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43863
43845
|
if (!mediaControl) {
|
|
43864
43846
|
return this; // TODO test
|
|
@@ -43890,14 +43872,14 @@ class BottomGear extends UICorePlugin {
|
|
|
43890
43872
|
this.$el.find('#gear-options-wrapper').hide();
|
|
43891
43873
|
}
|
|
43892
43874
|
onCoreReady() {
|
|
43893
|
-
trace(`${T$
|
|
43875
|
+
trace(`${T$g} onCoreReady`);
|
|
43894
43876
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43895
43877
|
assert(mediaControl, 'media_control plugin is required');
|
|
43896
43878
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMediaControlRendered);
|
|
43897
43879
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.hide);
|
|
43898
43880
|
}
|
|
43899
43881
|
onMediaControlRendered() {
|
|
43900
|
-
trace(`${T$
|
|
43882
|
+
trace(`${T$g} onMediaControlRendered`);
|
|
43901
43883
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43902
43884
|
mediaControl.putElement('gear', this.$el);
|
|
43903
43885
|
}
|
|
@@ -46044,7 +46026,7 @@ const drawSummary = (customMetrics, vodContainer, liveContainer) => {
|
|
|
46044
46026
|
vodContainer.html(vodHtml);
|
|
46045
46027
|
liveContainer.html(liveHtml);
|
|
46046
46028
|
};
|
|
46047
|
-
const T$
|
|
46029
|
+
const T$f = 'plugins.clappr_nerd_stats';
|
|
46048
46030
|
/**
|
|
46049
46031
|
* `PLUGIN` that displays useful network-related statistics.
|
|
46050
46032
|
* @beta
|
|
@@ -46083,7 +46065,7 @@ class ClapprNerdStats extends UICorePlugin {
|
|
|
46083
46065
|
* @internal
|
|
46084
46066
|
*/
|
|
46085
46067
|
get supportedVersion() {
|
|
46086
|
-
return { min: CLAPPR_VERSION };
|
|
46068
|
+
return { min: CLAPPR_VERSION$1 };
|
|
46087
46069
|
}
|
|
46088
46070
|
static template = tmpl(pluginHtml$4);
|
|
46089
46071
|
/**
|
|
@@ -46253,14 +46235,14 @@ class ClapprNerdStats extends UICorePlugin {
|
|
|
46253
46235
|
* @internal
|
|
46254
46236
|
*/
|
|
46255
46237
|
render() {
|
|
46256
|
-
trace(`${T$
|
|
46238
|
+
trace(`${T$f} render`);
|
|
46257
46239
|
// TODO append to the container
|
|
46258
46240
|
this.core.$el.append(this.$el[0]);
|
|
46259
46241
|
this.hide();
|
|
46260
46242
|
return this;
|
|
46261
46243
|
}
|
|
46262
46244
|
addToBottomGear() {
|
|
46263
|
-
trace(`${T$
|
|
46245
|
+
trace(`${T$f} addToBottomGear`);
|
|
46264
46246
|
const gear = this.core.getPlugin('bottom_gear');
|
|
46265
46247
|
gear
|
|
46266
46248
|
.addItem('nerd')
|
|
@@ -46344,7 +46326,7 @@ class ClapprStats extends ContainerPlugin {
|
|
|
46344
46326
|
* @internal
|
|
46345
46327
|
*/
|
|
46346
46328
|
get supportedVersion() {
|
|
46347
|
-
return { min: CLAPPR_VERSION };
|
|
46329
|
+
return { min: CLAPPR_VERSION$1 };
|
|
46348
46330
|
}
|
|
46349
46331
|
get _playbackName() {
|
|
46350
46332
|
return String(this.container.playback.name || '');
|
|
@@ -46666,7 +46648,7 @@ class ClapprStats extends ContainerPlugin {
|
|
|
46666
46648
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
46667
46649
|
// Use of this source code is governed by a BSD-style
|
|
46668
46650
|
// license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
|
|
46669
|
-
const T$
|
|
46651
|
+
const T$e = 'plugins.click_to_pause';
|
|
46670
46652
|
/**
|
|
46671
46653
|
* A small `PLUGIN` that toggles the playback state on click over the video container
|
|
46672
46654
|
* @beta
|
|
@@ -46684,7 +46666,7 @@ class ClickToPause extends ContainerPlugin {
|
|
|
46684
46666
|
* @internal
|
|
46685
46667
|
*/
|
|
46686
46668
|
get supportedVersion() {
|
|
46687
|
-
return { min: CLAPPR_VERSION };
|
|
46669
|
+
return { min: CLAPPR_VERSION$1 };
|
|
46688
46670
|
}
|
|
46689
46671
|
/**
|
|
46690
46672
|
* @internal
|
|
@@ -46696,7 +46678,7 @@ class ClickToPause extends ContainerPlugin {
|
|
|
46696
46678
|
click() {
|
|
46697
46679
|
const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
|
|
46698
46680
|
const isDvrEnabled = this.container.isDvrEnabled();
|
|
46699
|
-
trace(`${T$
|
|
46681
|
+
trace(`${T$e} click`, {
|
|
46700
46682
|
isLivePlayback,
|
|
46701
46683
|
isDvrEnabled,
|
|
46702
46684
|
});
|
|
@@ -46738,7 +46720,15 @@ class ClickToPause extends ContainerPlugin {
|
|
|
46738
46720
|
}
|
|
46739
46721
|
}
|
|
46740
46722
|
|
|
46741
|
-
|
|
46723
|
+
/**
|
|
46724
|
+
* Parse a time string in the format "hh:mm:ss" or "mm:ss" or "ss" to seconds.
|
|
46725
|
+
* @param str - The time string to parse.
|
|
46726
|
+
* @returns The time in seconds.
|
|
46727
|
+
* @example "01:01:00" -> 3660
|
|
46728
|
+
* @example "01:00" -> 60
|
|
46729
|
+
* @example "33" -> 33
|
|
46730
|
+
*/
|
|
46731
|
+
function parseClipTime(str) {
|
|
46742
46732
|
if (!str) {
|
|
46743
46733
|
return 0;
|
|
46744
46734
|
}
|
|
@@ -46747,21 +46737,12 @@ function strtimeToMiliseconds(str) {
|
|
|
46747
46737
|
if (arr.length >= 3) {
|
|
46748
46738
|
h = parseInt(arr[arr.length - 3]) * 60 * 60;
|
|
46749
46739
|
}
|
|
46750
|
-
else {
|
|
46751
|
-
h = 0;
|
|
46752
|
-
}
|
|
46753
46740
|
if (arr.length >= 2) {
|
|
46754
46741
|
m = parseInt(arr[arr.length - 2]) * 60;
|
|
46755
46742
|
}
|
|
46756
|
-
else {
|
|
46757
|
-
m = 0;
|
|
46758
|
-
}
|
|
46759
46743
|
if (arr.length >= 1) {
|
|
46760
46744
|
s = parseInt(arr[arr.length - 1]);
|
|
46761
46745
|
}
|
|
46762
|
-
else {
|
|
46763
|
-
s = 0;
|
|
46764
|
-
}
|
|
46765
46746
|
return (h + m + s);
|
|
46766
46747
|
}
|
|
46767
46748
|
function getPageX(event) {
|
|
@@ -46774,22 +46755,65 @@ function getPageX(event) {
|
|
|
46774
46755
|
return 0;
|
|
46775
46756
|
}
|
|
46776
46757
|
|
|
46758
|
+
function parseClips(text) {
|
|
46759
|
+
const clipsArr = text
|
|
46760
|
+
.split('\n')
|
|
46761
|
+
.map((val) => {
|
|
46762
|
+
const matchRes = val.match(/(((\d+:)?\d+:)?\d+) (.+)/i);
|
|
46763
|
+
return matchRes
|
|
46764
|
+
? {
|
|
46765
|
+
start: parseClipTime(matchRes[1]),
|
|
46766
|
+
text: matchRes[4],
|
|
46767
|
+
}
|
|
46768
|
+
: null;
|
|
46769
|
+
})
|
|
46770
|
+
.filter((clip) => clip !== null)
|
|
46771
|
+
.sort((a, b) => a.start - b.start);
|
|
46772
|
+
return clipsArr.map((clip, index) => ({
|
|
46773
|
+
start: clip.start,
|
|
46774
|
+
text: clip.text,
|
|
46775
|
+
end: index < clipsArr.length - 1 ? clipsArr[index + 1].start : 0,
|
|
46776
|
+
}));
|
|
46777
|
+
}
|
|
46778
|
+
function buildSvg(clips, duration, barWidth) {
|
|
46779
|
+
let svg = '<svg width="0" height="0">\n' + '<defs>\n' + '<clipPath id="myClip">\n';
|
|
46780
|
+
let rightEdge = 0;
|
|
46781
|
+
clips.forEach((val) => {
|
|
46782
|
+
const end = val.end || duration;
|
|
46783
|
+
const chunkWidth = Math.round(((end - val.start) * barWidth) / duration);
|
|
46784
|
+
svg += `<rect x="${rightEdge}" y="0" width="${chunkWidth - 2}" height="30"/>\n`;
|
|
46785
|
+
rightEdge += chunkWidth;
|
|
46786
|
+
});
|
|
46787
|
+
if (rightEdge < barWidth) {
|
|
46788
|
+
svg += `<rect x="${rightEdge}" y="0" width="${barWidth - rightEdge}" height="30"/>\n`;
|
|
46789
|
+
}
|
|
46790
|
+
svg += '</clipPath>' + '</defs>' + '</svg>';
|
|
46791
|
+
return svg;
|
|
46792
|
+
}
|
|
46793
|
+
|
|
46794
|
+
const clipsHTML = "<div class=\"media-clip-text\" id=\"clips-text\"></div>";
|
|
46795
|
+
|
|
46796
|
+
const T$d = 'plugins.clips';
|
|
46797
|
+
const VERSION$5 = '2.22.16';
|
|
46798
|
+
const CLAPPR_VERSION = '0.11.4';
|
|
46777
46799
|
/**
|
|
46778
|
-
* `PLUGIN` that
|
|
46800
|
+
* `PLUGIN` that allows marking up the timeline of the video
|
|
46779
46801
|
* @beta
|
|
46780
46802
|
* @remarks
|
|
46803
|
+
* The plugin decorates the seekbar with notches to indicate the clips of the video and displays current clip text in the left panel
|
|
46804
|
+
*
|
|
46781
46805
|
* Depends on:
|
|
46782
46806
|
*
|
|
46783
46807
|
* - {@link MediaControl}
|
|
46784
46808
|
*
|
|
46785
46809
|
* Configuration options - {@link ClipsPluginSettings}
|
|
46786
46810
|
*/
|
|
46787
|
-
class
|
|
46788
|
-
|
|
46789
|
-
|
|
46790
|
-
|
|
46791
|
-
_oldContainer;
|
|
46811
|
+
class Clips extends UICorePlugin {
|
|
46812
|
+
barStyle = null;
|
|
46813
|
+
clips = [];
|
|
46814
|
+
oldContainer;
|
|
46792
46815
|
svgMask = null;
|
|
46816
|
+
static template = tmpl(clipsHTML);
|
|
46793
46817
|
/**
|
|
46794
46818
|
* @internal
|
|
46795
46819
|
*/
|
|
@@ -46801,146 +46825,137 @@ class ClipsPlugin extends UICorePlugin {
|
|
|
46801
46825
|
*/
|
|
46802
46826
|
get attributes() {
|
|
46803
46827
|
return {
|
|
46804
|
-
class:
|
|
46828
|
+
class: 'media-control-clips',
|
|
46805
46829
|
};
|
|
46806
46830
|
}
|
|
46831
|
+
get version() {
|
|
46832
|
+
return VERSION$5;
|
|
46833
|
+
}
|
|
46834
|
+
get supportedVersion() {
|
|
46835
|
+
return { min: CLAPPR_VERSION };
|
|
46836
|
+
}
|
|
46807
46837
|
/**
|
|
46808
46838
|
* @internal
|
|
46809
46839
|
*/
|
|
46810
46840
|
bindEvents() {
|
|
46811
|
-
|
|
46812
|
-
assert(mediaControl, 'media_control plugin is required');
|
|
46813
|
-
this.listenToOnce(this.core, Events$1.CORE_READY, this._onCoreReady);
|
|
46814
|
-
// TODO listen to CORE_ACTIVE_CONTAINER_CHANGED
|
|
46815
|
-
this.listenTo(mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this._onMediaControlContainerChanged);
|
|
46841
|
+
this.listenToOnce(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
46816
46842
|
this.listenTo(this.core, Events$1.CORE_RESIZE, this.playerResize);
|
|
46843
|
+
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
|
|
46817
46844
|
}
|
|
46818
|
-
|
|
46845
|
+
render() {
|
|
46846
|
+
trace(`${T$d} render`);
|
|
46819
46847
|
if (!this.options.clips) {
|
|
46820
|
-
this
|
|
46821
|
-
return;
|
|
46848
|
+
return this;
|
|
46822
46849
|
}
|
|
46823
|
-
this.
|
|
46824
|
-
|
|
46825
|
-
|
|
46826
|
-
this._bindContainerEvents();
|
|
46850
|
+
this.$el.html(Clips.template());
|
|
46851
|
+
this.$el.hide();
|
|
46852
|
+
return this;
|
|
46827
46853
|
}
|
|
46828
|
-
|
|
46829
|
-
this.
|
|
46830
|
-
|
|
46831
|
-
this.
|
|
46854
|
+
destroy() {
|
|
46855
|
+
if (this.barStyle) {
|
|
46856
|
+
this.barStyle.remove();
|
|
46857
|
+
this.barStyle = null;
|
|
46832
46858
|
}
|
|
46859
|
+
return super.destroy();
|
|
46833
46860
|
}
|
|
46834
|
-
|
|
46835
|
-
if (this.
|
|
46836
|
-
this.
|
|
46861
|
+
disable() {
|
|
46862
|
+
if (this.barStyle) {
|
|
46863
|
+
this.barStyle.remove();
|
|
46864
|
+
this.barStyle = null;
|
|
46837
46865
|
}
|
|
46866
|
+
return super.disable();
|
|
46867
|
+
}
|
|
46868
|
+
enable() {
|
|
46869
|
+
this.render();
|
|
46870
|
+
return super.enable();
|
|
46871
|
+
}
|
|
46872
|
+
onCoreReady() {
|
|
46873
|
+
trace(`${T$d} onCoreReady`);
|
|
46838
46874
|
const mediaControl = this.core.getPlugin('media_control');
|
|
46839
|
-
|
|
46840
|
-
this.
|
|
46841
|
-
this.listenTo(mediaControl
|
|
46875
|
+
assert(mediaControl, 'media_control plugin is required');
|
|
46876
|
+
this.parseClips(this.options.clips.text);
|
|
46877
|
+
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMcRender);
|
|
46878
|
+
}
|
|
46879
|
+
onMcRender() {
|
|
46880
|
+
trace(`${T$d} onMcRender`);
|
|
46881
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
46882
|
+
mediaControl.mount('clips', this.$el);
|
|
46883
|
+
}
|
|
46884
|
+
onContainerChanged() {
|
|
46885
|
+
trace(`${T$d} onContainerChanged`);
|
|
46886
|
+
// TODO figure out the conditions of changing the container (without destroying the previous one)
|
|
46887
|
+
if (this.oldContainer) {
|
|
46888
|
+
this.stopListening(this.oldContainer, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
46889
|
+
}
|
|
46890
|
+
this.oldContainer = this.core.activeContainer;
|
|
46891
|
+
if (this.svgMask) {
|
|
46892
|
+
this.svgMask.remove();
|
|
46893
|
+
this.svgMask = null;
|
|
46894
|
+
}
|
|
46895
|
+
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
46896
|
+
}
|
|
46897
|
+
playerResize() {
|
|
46898
|
+
const duration = this.core.activeContainer.getDuration();
|
|
46899
|
+
if (duration) {
|
|
46900
|
+
this.makeSvg(duration);
|
|
46901
|
+
}
|
|
46842
46902
|
}
|
|
46843
46903
|
onTimeUpdate(event) {
|
|
46844
|
-
if (!this.
|
|
46845
|
-
this.duration = event.total;
|
|
46904
|
+
if (!this.svgMask) {
|
|
46846
46905
|
this.makeSvg(event.total);
|
|
46847
|
-
this.durationGetting = true;
|
|
46848
46906
|
}
|
|
46849
|
-
for (const value of this.clips
|
|
46850
|
-
if (event.current >= value.start &&
|
|
46907
|
+
for (const value of this.clips) {
|
|
46908
|
+
if ((event.current >= value.start && !value.end) ||
|
|
46909
|
+
event.current < value.end) {
|
|
46851
46910
|
this.setClipText(value.text);
|
|
46852
46911
|
break;
|
|
46853
46912
|
}
|
|
46854
46913
|
}
|
|
46855
46914
|
}
|
|
46856
|
-
parseClips() {
|
|
46857
|
-
|
|
46858
|
-
const clipsArr = textArr
|
|
46859
|
-
.map((val) => {
|
|
46860
|
-
const matchRes = val.match(/(\d+:\d+|:\d+) (.+)/i);
|
|
46861
|
-
return matchRes
|
|
46862
|
-
? {
|
|
46863
|
-
start: strtimeToMiliseconds(matchRes[1]),
|
|
46864
|
-
text: matchRes[2],
|
|
46865
|
-
}
|
|
46866
|
-
: null;
|
|
46867
|
-
})
|
|
46868
|
-
.filter((clip) => clip !== null);
|
|
46869
|
-
clipsArr.sort((a, b) => a.start - b.start);
|
|
46870
|
-
clipsArr.forEach((clip, index) => {
|
|
46871
|
-
this.clips.set(clip.start, {
|
|
46872
|
-
index,
|
|
46873
|
-
start: clip.start,
|
|
46874
|
-
text: clip.text,
|
|
46875
|
-
end: clipsArr[index + 1] ? clipsArr[index + 1].start : null,
|
|
46876
|
-
});
|
|
46877
|
-
});
|
|
46878
|
-
}
|
|
46879
|
-
/**
|
|
46880
|
-
* Returns the text of the current clip.
|
|
46881
|
-
* @param time - The current time of the player.
|
|
46882
|
-
* @returns The text of the current clip.
|
|
46883
|
-
*/
|
|
46884
|
-
getText(time) {
|
|
46885
|
-
for (const [key, value] of this.clips.entries()) {
|
|
46886
|
-
if (time >= value.start && time < value.end) {
|
|
46887
|
-
return value.text;
|
|
46888
|
-
}
|
|
46889
|
-
}
|
|
46890
|
-
return '';
|
|
46915
|
+
parseClips(text) {
|
|
46916
|
+
this.clips = parseClips(text);
|
|
46891
46917
|
}
|
|
46892
46918
|
makeSvg(duration) {
|
|
46893
|
-
|
|
46894
|
-
const widthOfSeek = this.core.activeContainer.$el.width();
|
|
46895
|
-
let finishValue = 0;
|
|
46896
|
-
this.clips.forEach((val) => {
|
|
46897
|
-
let end = val.end;
|
|
46898
|
-
if (!end) {
|
|
46899
|
-
end = val.end = duration;
|
|
46900
|
-
}
|
|
46901
|
-
const widthChunk = ((end - val.start) * widthOfSeek) / duration;
|
|
46902
|
-
svg += `<rect x="${finishValue}" y="0" width="${widthChunk - 2}" height="30"/>\n`;
|
|
46903
|
-
finishValue += widthChunk;
|
|
46904
|
-
});
|
|
46905
|
-
svg += `<rect x="${finishValue}" y="0" width="${widthOfSeek - finishValue}" height="30"/>\n`;
|
|
46906
|
-
svg += '</clipPath>' + '</defs>' + '</svg>';
|
|
46919
|
+
const svg = buildSvg(this.clips, duration, this.core.activeContainer.$el.width());
|
|
46907
46920
|
this.setSVGMask(svg);
|
|
46908
46921
|
}
|
|
46909
46922
|
setSVGMask(svg) {
|
|
46910
|
-
// this.core.mediaControl.setSVGMask(svg);
|
|
46911
46923
|
if (this.svgMask) {
|
|
46912
46924
|
this.svgMask.remove();
|
|
46913
46925
|
}
|
|
46914
|
-
const mediaControl = this.core.getPlugin('media_control');
|
|
46915
|
-
const $seekBarContainer = mediaControl.getElement('seekBarContainer');
|
|
46916
|
-
if ($seekBarContainer?.get(0)) {
|
|
46917
|
-
$seekBarContainer.addClass('clips');
|
|
46918
|
-
}
|
|
46919
46926
|
this.svgMask = $(svg);
|
|
46920
|
-
|
|
46927
|
+
this.$el.append(this.svgMask);
|
|
46928
|
+
if (!this.barStyle) {
|
|
46929
|
+
this.barStyle = document.createElement('style');
|
|
46930
|
+
this.barStyle.textContent = `
|
|
46931
|
+
.bar-container[data-seekbar] {
|
|
46932
|
+
clip-path: url("#myClip");
|
|
46933
|
+
}`;
|
|
46934
|
+
this.$el.append(this.barStyle);
|
|
46935
|
+
}
|
|
46921
46936
|
}
|
|
46922
46937
|
setClipText(text) {
|
|
46923
|
-
|
|
46924
|
-
|
|
46925
|
-
|
|
46926
|
-
|
|
46927
|
-
|
|
46938
|
+
if (text) {
|
|
46939
|
+
this.$el.show().find('#clips-text').text(text);
|
|
46940
|
+
}
|
|
46941
|
+
else {
|
|
46942
|
+
this.$el.hide();
|
|
46928
46943
|
}
|
|
46929
46944
|
}
|
|
46930
46945
|
}
|
|
46931
46946
|
|
|
46932
|
-
const templateHtml$1 = "<ul class=\"context-menu-list\">\n <%
|
|
46947
|
+
const templateHtml$1 = "<ul class=\"context-menu-list\" role=\"menu\" id=\"context-menu-options\">\n <% for (const item of options) { %>\n <li class=\"context-menu-list-item <%= item.class %>\">\n <button role=\"menuitem\" data-name=\"<%= item.name %>\">\n <% if (iconic) { %>\n <span class=\"context-menu-list-item_icon\"><%= item.icon || '' %></span>\n <% } %>\n <% if (item.labelKey) { %>\n <%= i18n.t(item.labelKey) %>\n <% } else { %>\n <%= item.label %>\n <% } %>\n </button>\n </li>\n <% } %>\n</ul>\n";
|
|
46933
46948
|
|
|
46934
46949
|
/**
|
|
46935
46950
|
* `PLUGIN` that displays a small context menu when clicked on the player container.
|
|
46936
46951
|
* @beta
|
|
46937
46952
|
* @remarks
|
|
46938
46953
|
* Configuration options - {@link ContextMenuPluginSettings}
|
|
46954
|
+
*
|
|
46955
|
+
* Should not be used together with {@link ClickToPause} plugin
|
|
46939
46956
|
*/
|
|
46940
46957
|
class ContextMenu extends UIContainerPlugin {
|
|
46941
|
-
|
|
46942
|
-
_url = '';
|
|
46943
|
-
menuOptions = [];
|
|
46958
|
+
open = false;
|
|
46944
46959
|
/**
|
|
46945
46960
|
* @internal
|
|
46946
46961
|
*/
|
|
@@ -46951,7 +46966,7 @@ class ContextMenu extends UIContainerPlugin {
|
|
|
46951
46966
|
* @internal
|
|
46952
46967
|
*/
|
|
46953
46968
|
get supportedVersion() {
|
|
46954
|
-
return { min: CLAPPR_VERSION };
|
|
46969
|
+
return { min: CLAPPR_VERSION$1 };
|
|
46955
46970
|
}
|
|
46956
46971
|
/**
|
|
46957
46972
|
* @internal
|
|
@@ -46960,34 +46975,16 @@ class ContextMenu extends UIContainerPlugin {
|
|
|
46960
46975
|
return { class: 'context-menu' };
|
|
46961
46976
|
}
|
|
46962
46977
|
static template = tmpl(templateHtml$1);
|
|
46963
|
-
get label() {
|
|
46964
|
-
return this._label || 'Gcore player ver. ' + version().gplayer;
|
|
46965
|
-
}
|
|
46966
|
-
get url() {
|
|
46967
|
-
return this._url || 'https://gcore.com/';
|
|
46968
|
-
}
|
|
46969
|
-
get exposeVersion() {
|
|
46970
|
-
return {
|
|
46971
|
-
label: this.label,
|
|
46972
|
-
name: 'version',
|
|
46973
|
-
};
|
|
46974
|
-
}
|
|
46975
46978
|
/**
|
|
46976
46979
|
* @internal
|
|
46977
46980
|
*/
|
|
46978
46981
|
get events() {
|
|
46979
46982
|
return {
|
|
46980
|
-
'click [
|
|
46983
|
+
'click [role="menuitem"]': 'runAction',
|
|
46981
46984
|
};
|
|
46982
46985
|
}
|
|
46983
46986
|
constructor(container) {
|
|
46984
46987
|
super(container);
|
|
46985
|
-
if (this.options.contextMenu && this.options.contextMenu.label) {
|
|
46986
|
-
this._label = this.options.contextMenu.label;
|
|
46987
|
-
}
|
|
46988
|
-
if (this.options.contextMenu && this.options.contextMenu.url) {
|
|
46989
|
-
this._url = this.options.contextMenu.url;
|
|
46990
|
-
}
|
|
46991
46988
|
this.render();
|
|
46992
46989
|
$('body').on('click', this.hideOnBodyClick);
|
|
46993
46990
|
}
|
|
@@ -46995,8 +46992,8 @@ class ContextMenu extends UIContainerPlugin {
|
|
|
46995
46992
|
* @internal
|
|
46996
46993
|
*/
|
|
46997
46994
|
bindEvents() {
|
|
46998
|
-
this.listenTo(this.container, Events$1.CONTAINER_CONTEXTMENU, this.
|
|
46999
|
-
this.listenTo(this.container, Events$1.CONTAINER_CLICK, this.
|
|
46995
|
+
this.listenTo(this.container, Events$1.CONTAINER_CONTEXTMENU, this.onContextMenu);
|
|
46996
|
+
this.listenTo(this.container, Events$1.CONTAINER_CLICK, this.onContainerClick);
|
|
47000
46997
|
}
|
|
47001
46998
|
/**
|
|
47002
46999
|
* @internal
|
|
@@ -47005,34 +47002,55 @@ class ContextMenu extends UIContainerPlugin {
|
|
|
47005
47002
|
$('body').off('click', this.hideOnBodyClick);
|
|
47006
47003
|
return super.destroy();
|
|
47007
47004
|
}
|
|
47008
|
-
|
|
47005
|
+
onContainerClick() {
|
|
47006
|
+
this.hide();
|
|
47007
|
+
}
|
|
47008
|
+
onContextMenu(event) {
|
|
47009
|
+
if (!this.options.contextMenu?.options?.length) {
|
|
47010
|
+
return;
|
|
47011
|
+
}
|
|
47009
47012
|
event.preventDefault();
|
|
47013
|
+
event.stopPropagation();
|
|
47010
47014
|
const offset = this.container?.$el.offset();
|
|
47011
47015
|
this.show(event.pageY - offset.top, event.pageX - offset.left);
|
|
47012
47016
|
}
|
|
47013
47017
|
show(top, left) {
|
|
47014
|
-
this.
|
|
47015
|
-
if (this.options.contextMenu &&
|
|
47016
|
-
this.options.contextMenu.preventShowContextMenu) {
|
|
47017
|
-
return;
|
|
47018
|
-
}
|
|
47018
|
+
this.open = true;
|
|
47019
47019
|
this.$el.css({ top, left });
|
|
47020
47020
|
this.$el.show();
|
|
47021
47021
|
}
|
|
47022
47022
|
hide() {
|
|
47023
|
+
this.open = false;
|
|
47023
47024
|
this.$el.hide();
|
|
47024
47025
|
}
|
|
47025
|
-
|
|
47026
|
-
|
|
47026
|
+
runAction(event) {
|
|
47027
|
+
event.preventDefault();
|
|
47028
|
+
event.stopPropagation();
|
|
47029
|
+
const itemName = event.currentTarget.dataset.name;
|
|
47030
|
+
if (!itemName) {
|
|
47031
|
+
return;
|
|
47032
|
+
}
|
|
47033
|
+
const item = this.options.contextMenu?.options.find((option) => option.name === itemName);
|
|
47034
|
+
if (item?.handler) {
|
|
47035
|
+
item.handler();
|
|
47036
|
+
}
|
|
47037
|
+
this.hide();
|
|
47027
47038
|
}
|
|
47028
47039
|
/**
|
|
47029
47040
|
* @internal
|
|
47030
47041
|
*/
|
|
47031
47042
|
render() {
|
|
47032
|
-
this.
|
|
47033
|
-
|
|
47043
|
+
if (!this.options.contextMenu?.options?.length) {
|
|
47044
|
+
return this;
|
|
47045
|
+
}
|
|
47046
|
+
const options = this.options.contextMenu.options;
|
|
47047
|
+
this.$el.html(ContextMenu.template({
|
|
47048
|
+
options,
|
|
47049
|
+
i18n: this.container.i18n,
|
|
47050
|
+
iconic: options.some((option) => option.icon),
|
|
47051
|
+
}));
|
|
47034
47052
|
this.container.$el.append(this.$el); // TODO append to the container, turn into a container plugin
|
|
47035
|
-
this.hide();
|
|
47053
|
+
this.$el.hide();
|
|
47036
47054
|
return this;
|
|
47037
47055
|
}
|
|
47038
47056
|
hideOnBodyClick = () => {
|
|
@@ -47069,7 +47087,7 @@ class DvrControls extends UICorePlugin {
|
|
|
47069
47087
|
* @internal
|
|
47070
47088
|
*/
|
|
47071
47089
|
get supportedVersion() {
|
|
47072
|
-
return { min: CLAPPR_VERSION };
|
|
47090
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47073
47091
|
}
|
|
47074
47092
|
/**
|
|
47075
47093
|
* @internal
|
|
@@ -47176,7 +47194,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
47176
47194
|
* @internal
|
|
47177
47195
|
*/
|
|
47178
47196
|
get supportedVersion() {
|
|
47179
|
-
return { min: CLAPPR_VERSION };
|
|
47197
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47180
47198
|
}
|
|
47181
47199
|
static template = tmpl(templateHtml);
|
|
47182
47200
|
/**
|
|
@@ -47301,7 +47319,7 @@ class Favicon extends CorePlugin {
|
|
|
47301
47319
|
* @internal
|
|
47302
47320
|
*/
|
|
47303
47321
|
get supportedVersion() {
|
|
47304
|
-
return { min: CLAPPR_VERSION };
|
|
47322
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47305
47323
|
}
|
|
47306
47324
|
/**
|
|
47307
47325
|
* @internal
|
|
@@ -47393,7 +47411,7 @@ class GoogleAnalytics extends ContainerPlugin {
|
|
|
47393
47411
|
return 'google_analytics';
|
|
47394
47412
|
}
|
|
47395
47413
|
get supportedVersion() {
|
|
47396
|
-
return { min: CLAPPR_VERSION };
|
|
47414
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47397
47415
|
}
|
|
47398
47416
|
constructor(container) {
|
|
47399
47417
|
super(container);
|
|
@@ -47540,7 +47558,7 @@ class Logo extends UIContainerPlugin {
|
|
|
47540
47558
|
return 'logo';
|
|
47541
47559
|
}
|
|
47542
47560
|
get supportedVersion() {
|
|
47543
|
-
return { min: CLAPPR_VERSION };
|
|
47561
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47544
47562
|
}
|
|
47545
47563
|
get template() {
|
|
47546
47564
|
return tmpl(logoHTML);
|
|
@@ -47930,7 +47948,7 @@ const FullscreenIOS = {
|
|
|
47930
47948
|
},
|
|
47931
47949
|
};
|
|
47932
47950
|
|
|
47933
|
-
const mediaControlHTML = "<div class=\"media-control-background\" data-background></div>\n\n<div class=\"media-control-layer gcore-skin-bg-color\" data-controls>\n <% var renderBar = function(name) { %>\n <div class=\"bar-container\" data-<%= name %>>\n <div class=\"bar-background\" data-<%= name %>>\n <div class=\"bar-fill-1\" data-<%= name %>></div>\n <div class=\"bar-fill-2 gcore-skin-main-color\" data-<%= name %>></div>\n <div class=\"bar-hover\" data-<%= name %>></div>\n </div>\n </div>\n <div class=\"bar-scrubber\" data-<%= name %>>\n <div class=\"bar-scrubber-icon gcore-skin-main-color\" data-<%= name %>></div>\n </div>\n <% }; %>\n <% var renderSegmentedBar = function(name, segments) {\n segments = segments || 10; %>\n <div class=\"bar-container\" data-<%= name %>>\n <div class=\"bar-background\" data-<%= name %>>\n <div class=\"bar-fill-1 gcore-skin-main-color\" data-<%= name %>></div>\n </div>\n <div class=\"bar-scrubber\" data-<%= name %>>\n <div class=\"bar-scrubber-icon gcore-skin-main-color\" data-<%= name %>></div>\n </div>\n </div>\n <% }; %>\n <% var renderDrawer = function(name, renderContent) { %>\n <div class=\"drawer-container\" data-<%= name %>>\n <div class=\"drawer-icon-container\" data-<%= name %>>\n <div class=\"drawer-icon media-control-icon gcore-skin-button-color\" data-<%= name %>></div>\n <span class=\"drawer-text\" data-<%= name %>></span>\n </div>\n <% renderContent(name); %>\n </div>\n <% }; %>\n <% var renderIndicator = function(name) { %>\n <div class=\"media-control-indicator gcore-skin-text-color\" data-<%= name %>></div>\n <% }; %>\n <% var renderQuality = function(name) { %>\n <div class=\"media-control-quality\" data-<%= name %>></div>\n <% }; %>\n <% var renderNerd = function(name) { %>\n <div class=\"media-control-nerd\" data-<%= name %>></div>\n <% }; %>\n <% var renderMultiCamera = function(name) { %>\n <div class=\"media-control-multicamera\" data-<%= name %>></div>\n <% }; %>\n <% var
|
|
47951
|
+
const mediaControlHTML = "<div class=\"media-control-background\" data-background></div>\n\n<div class=\"media-control-layer gcore-skin-bg-color\" data-controls>\n <% var renderBar = function(name) { %>\n <div class=\"bar-container\" data-<%= name %>>\n <div class=\"bar-background\" data-<%= name %>>\n <div class=\"bar-fill-1\" data-<%= name %>></div>\n <div class=\"bar-fill-2 gcore-skin-main-color\" data-<%= name %>></div>\n <div class=\"bar-hover\" data-<%= name %>></div>\n </div>\n </div>\n <div class=\"bar-scrubber\" data-<%= name %>>\n <div class=\"bar-scrubber-icon gcore-skin-main-color\" data-<%= name %>></div>\n </div>\n <% }; %>\n <% var renderSegmentedBar = function(name, segments) {\n segments = segments || 10; %>\n <div class=\"bar-container\" data-<%= name %>>\n <div class=\"bar-background\" data-<%= name %>>\n <div class=\"bar-fill-1 gcore-skin-main-color\" data-<%= name %>></div>\n </div>\n <div class=\"bar-scrubber\" data-<%= name %>>\n <div class=\"bar-scrubber-icon gcore-skin-main-color\" data-<%= name %>></div>\n </div>\n </div>\n <% }; %>\n <% var renderDrawer = function(name, renderContent) { %>\n <div class=\"drawer-container\" data-<%= name %>>\n <div class=\"drawer-icon-container\" data-<%= name %>>\n <div class=\"drawer-icon media-control-icon gcore-skin-button-color\" data-<%= name %>></div>\n <span class=\"drawer-text\" data-<%= name %>></span>\n </div>\n <% renderContent(name); %>\n </div>\n <% }; %>\n <% var renderIndicator = function(name) { %>\n <div class=\"media-control-indicator gcore-skin-text-color\" data-<%= name %>></div>\n <% }; %>\n <% var renderQuality = function(name) { %>\n <div class=\"media-control-quality\" data-<%= name %>></div>\n <% }; %>\n <% var renderNerd = function(name) { %>\n <div class=\"media-control-nerd\" data-<%= name %>></div>\n <% }; %>\n <% var renderMultiCamera = function(name) { %>\n <div class=\"media-control-multicamera\" data-<%= name %>></div>\n <% }; %>\n <% var renderVR = function(name) { %>\n <div class=\"media-control-vr\" data-<%= name %>></div>\n <% }; %>\n <% var renderButton = function(name) { %>\n <button type=\"button\" class=\"media-control-button media-control-icon gcore-skin-button-color\" data-<%= name %>\n aria-label=\"<%= name %>\"></button>\n <% }; %>\n\n <% var templates = {\n bar: renderBar,\n segmentedBar: renderSegmentedBar,\n };\n var render = function (settingsList) {\n settingsList.forEach(function (setting) {\n\n if (setting === \"seekbar\") {\n renderBar(setting);\n } else if (setting === \"volume\") {\n renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function (name) {\n return renderSegmentedBar(name);\n });\n } else if (setting === \"duration\" || setting === \"position\" || setting === \"clips\") {\n renderIndicator(setting);\n } else if (setting === \"quality\") {\n renderQuality(setting)\n } else if (setting === \"nerd\") {\n renderNerd(setting)\n } else if (setting === \"multicamera\") {\n renderMultiCamera(setting)\n } else if (setting === \"vr\") {\n renderVR(setting)\n } else if ([\"playpause\", \"playstop\", \"fullscreen\"].includes(setting)) {\n renderButton(setting);\n }\n });\n }; %>\n <% if (settings.left && settings.left.length) { %>\n <div class=\"media-control-left-panel\" data-media-control>\n <% render(settings.left); %>\n </div>\n <% } %>\n <% if (settings.default && settings.default.length) { %>\n <div class=\"media-control-center-panel\" data-media-control>\n <% render(settings.default); %>\n </div>\n <% } %>\n <% if (settings.right && settings.right.length) { %>\n <div class=\"media-control-right-panel\" data-media-control>\n <% render(settings.right); %>\n </div>\n <% } %>\n</div>\n";
|
|
47934
47952
|
|
|
47935
47953
|
const volumeMaxIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M14.187 7.71405C13.759 8.06405 13.697 8.69307 14.046 9.12107C14.662 9.87207 15 10.8941 15 11.9961C15 13.0991 14.662 14.1201 14.046 14.8711C13.697 15.2991 13.759 15.9291 14.187 16.2781C14.373 16.4311 14.597 16.5051 14.82 16.5051C15.109 16.5051 15.396 16.3801 15.594 16.1391C16.501 15.0301 17 13.5601 17 11.9961C17 10.4331 16.501 8.96207 15.594 7.85407C15.245 7.42707 14.614 7.36405 14.187 7.71405ZM19.772 5.14408C19.443 4.70008 18.816 4.60907 18.374 4.94007C17.931 5.27007 17.839 5.89605 18.169 6.33905C19.367 7.94705 20 9.90307 20 11.9961C20 14.0891 19.367 16.0451 18.169 17.6531C17.839 18.0971 17.931 18.7231 18.374 19.0531C18.553 19.1871 18.762 19.2511 18.97 19.2511C19.275 19.2511 19.576 19.1121 19.772 18.8491C21.23 16.8921 22 14.5231 22 11.9961C22 9.47007 21.23 7.10108 19.772 5.14408ZM12 3.85108V20.1421C12 20.4881 11.793 20.7971 11.473 20.9291C11.368 20.9721 11.258 20.9921 11.149 20.9921C10.926 20.9921 10.708 20.9031 10.544 20.7371L6.317 16.4431C6.038 16.1591 5.648 15.9961 5.249 15.9961H3.5C2.673 15.9961 2 15.3231 2 14.4961V9.49607C2 8.66907 2.673 7.99607 3.5 7.99607H5.249C5.648 7.99607 6.038 7.83308 6.317 7.54908L10.544 3.25507C10.787 3.00807 11.151 2.93206 11.473 3.06406C11.793 3.19506 12 3.50408 12 3.85108Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
|
|
47936
47954
|
|
|
@@ -48020,8 +48038,6 @@ class MediaControl extends UICorePlugin {
|
|
|
48020
48038
|
userDisabled = false;
|
|
48021
48039
|
userKeepVisible = false;
|
|
48022
48040
|
verticalVolume = false;
|
|
48023
|
-
$clipText = null;
|
|
48024
|
-
$clipTextContainer = null;
|
|
48025
48041
|
$duration = null;
|
|
48026
48042
|
$fullscreenToggle = null;
|
|
48027
48043
|
$multiCameraSelector = null;
|
|
@@ -48050,7 +48066,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48050
48066
|
* @internal
|
|
48051
48067
|
*/
|
|
48052
48068
|
get supportedVersion() {
|
|
48053
|
-
return { min: CLAPPR_VERSION };
|
|
48069
|
+
return { min: CLAPPR_VERSION$1 };
|
|
48054
48070
|
}
|
|
48055
48071
|
get disabled() {
|
|
48056
48072
|
const playbackIsNOOP = this.core.activeContainer &&
|
|
@@ -48213,7 +48229,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48213
48229
|
this.userDisabled = true; // TODO distinguish between user and system (e.g., unplayable) disabled?
|
|
48214
48230
|
this.hide();
|
|
48215
48231
|
this.unbindKeyEvents();
|
|
48216
|
-
this.$el.hide();
|
|
48232
|
+
this.$el.hide(); // TODO why?
|
|
48217
48233
|
}
|
|
48218
48234
|
/**
|
|
48219
48235
|
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
@@ -48672,16 +48688,16 @@ class MediaControl extends UICorePlugin {
|
|
|
48672
48688
|
right: [],
|
|
48673
48689
|
}, this.core.activeContainer.settings);
|
|
48674
48690
|
trace(`${T$a} updateSettings`, { newSettings });
|
|
48691
|
+
newSettings.left.push('clips'); // TODO
|
|
48675
48692
|
// TODO make order controlled via CSS
|
|
48676
|
-
newSettings.left = orderByOrderPattern([...newSettings.left, '
|
|
48693
|
+
newSettings.left = orderByOrderPattern([...newSettings.left, 'volume', 'clips'], LEFT_ORDER);
|
|
48677
48694
|
if (this.core.activePlayback.getPlaybackType() === Playback.LIVE &&
|
|
48678
48695
|
this.core.activePlayback.dvrEnabled) {
|
|
48679
48696
|
newSettings.left.push('dvr');
|
|
48680
48697
|
}
|
|
48681
48698
|
// actual order of the items appear rendered is controlled by CSS
|
|
48682
48699
|
newSettings.right = DEFAULT_SETTINGS.right; // TODO get from the options
|
|
48683
|
-
if ((!this.fullScreenOnVideoTagSupported &&
|
|
48684
|
-
!fullscreenEnabled()) ||
|
|
48700
|
+
if ((!this.fullScreenOnVideoTagSupported && !fullscreenEnabled()) ||
|
|
48685
48701
|
this.options.fullscreenDisable) {
|
|
48686
48702
|
trace(`${T$a} updateSettings removing fullscreen`, {
|
|
48687
48703
|
supported: this.fullScreenOnVideoTagSupported,
|
|
@@ -48728,8 +48744,6 @@ class MediaControl extends UICorePlugin {
|
|
|
48728
48744
|
this.$volumeBarFill = this.$el.find('.bar-fill-1[data-volume]');
|
|
48729
48745
|
this.$volumeBarScrubber = this.$el.find('.bar-scrubber[data-volume]');
|
|
48730
48746
|
this.$multiCameraSelector = this.$el.find('.media-control-multicamera[data-multicamera]');
|
|
48731
|
-
this.$clipText = this.$el.find('.media-clip-text[data-clipstext]'); // TODO
|
|
48732
|
-
this.$clipTextContainer = this.$el.find('.media-clip-container[data-clipstext]');
|
|
48733
48747
|
this.resetIndicators();
|
|
48734
48748
|
this.initializeIcons();
|
|
48735
48749
|
}
|
|
@@ -48744,25 +48758,14 @@ class MediaControl extends UICorePlugin {
|
|
|
48744
48758
|
* ```ts
|
|
48745
48759
|
* class MyPlugin extends UICorePlugin {
|
|
48746
48760
|
* override render() {
|
|
48747
|
-
*
|
|
48748
|
-
*
|
|
48749
|
-
* clipText?.el.text('Here we go')
|
|
48761
|
+
* this.$el.html('<div data-clips>Here we go</div>')
|
|
48762
|
+
* this.core.getPlugin('media_control').mount('clips', this.$el)
|
|
48750
48763
|
* return this
|
|
48751
48764
|
* }
|
|
48752
48765
|
* }
|
|
48753
48766
|
* ```
|
|
48754
48767
|
*/
|
|
48755
|
-
|
|
48756
|
-
switch (name) {
|
|
48757
|
-
case 'audiotracks':
|
|
48758
|
-
return null;
|
|
48759
|
-
case 'clipText':
|
|
48760
|
-
return this.$clipText;
|
|
48761
|
-
case 'seekBarContainer':
|
|
48762
|
-
return this.$seekBarContainer;
|
|
48763
|
-
}
|
|
48764
|
-
}
|
|
48765
|
-
putElement(name, element) {
|
|
48768
|
+
mount(name, element) {
|
|
48766
48769
|
const panel = this.getElementLocation(name);
|
|
48767
48770
|
trace(`${T$a} putElement`, { name, panel: !!panel });
|
|
48768
48771
|
if (panel) {
|
|
@@ -48781,6 +48784,9 @@ class MediaControl extends UICorePlugin {
|
|
|
48781
48784
|
return;
|
|
48782
48785
|
}
|
|
48783
48786
|
}
|
|
48787
|
+
putElement(name, element) {
|
|
48788
|
+
this.mount(name, element);
|
|
48789
|
+
}
|
|
48784
48790
|
/**
|
|
48785
48791
|
* Toggle the visibility of a media control element
|
|
48786
48792
|
* @param name - The name of the media control element
|
|
@@ -48830,11 +48836,11 @@ class MediaControl extends UICorePlugin {
|
|
|
48830
48836
|
if (!this.settings.seekEnabled) {
|
|
48831
48837
|
return;
|
|
48832
48838
|
}
|
|
48833
|
-
const currentTime = this.
|
|
48834
|
-
const duration = this.
|
|
48839
|
+
const currentTime = this.core.activeContainer.getCurrentTime();
|
|
48840
|
+
const duration = this.core.activeContainer.getDuration();
|
|
48835
48841
|
let position = Math.min(Math.max(currentTime + delta, 0), duration);
|
|
48836
48842
|
position = Math.min((position * 100) / duration, 100);
|
|
48837
|
-
this.
|
|
48843
|
+
this.core.activeContainer.seekPercentage(position);
|
|
48838
48844
|
}
|
|
48839
48845
|
bindKeyAndShow(key, callback) {
|
|
48840
48846
|
// TODO or boolean return type
|
|
@@ -48952,7 +48958,10 @@ class MediaControl extends UICorePlugin {
|
|
|
48952
48958
|
* @internal
|
|
48953
48959
|
*/
|
|
48954
48960
|
render() {
|
|
48955
|
-
trace(`${T$a} render`, {
|
|
48961
|
+
trace(`${T$a} render`, {
|
|
48962
|
+
needsUpdate: this.hasUpdate,
|
|
48963
|
+
metadataLoaded: this.metadataLoaded,
|
|
48964
|
+
});
|
|
48956
48965
|
if (!this.hasUpdate || !this.metadataLoaded) {
|
|
48957
48966
|
return this;
|
|
48958
48967
|
}
|
|
@@ -49108,8 +49117,7 @@ MediaControl.extend = function (properties) {
|
|
|
49108
49117
|
return extend(MediaControl, properties);
|
|
49109
49118
|
};
|
|
49110
49119
|
function serializeSettings(s) {
|
|
49111
|
-
return s.left
|
|
49112
|
-
.slice()
|
|
49120
|
+
return s.left.slice()
|
|
49113
49121
|
.sort()
|
|
49114
49122
|
.concat(s.right.slice().sort())
|
|
49115
49123
|
.concat(s.default.slice().sort())
|
|
@@ -49141,7 +49149,7 @@ class MultiCamera extends UICorePlugin {
|
|
|
49141
49149
|
return 'multicamera';
|
|
49142
49150
|
}
|
|
49143
49151
|
get supportedVersion() {
|
|
49144
|
-
return { min: CLAPPR_VERSION };
|
|
49152
|
+
return { min: CLAPPR_VERSION$1 };
|
|
49145
49153
|
}
|
|
49146
49154
|
static get version() {
|
|
49147
49155
|
return VERSION$4;
|
|
@@ -49501,7 +49509,7 @@ class PictureInPicture extends UICorePlugin {
|
|
|
49501
49509
|
* @internal
|
|
49502
49510
|
*/
|
|
49503
49511
|
get supportedVersion() {
|
|
49504
|
-
return { min: CLAPPR_VERSION };
|
|
49512
|
+
return { min: CLAPPR_VERSION$1 };
|
|
49505
49513
|
}
|
|
49506
49514
|
/**
|
|
49507
49515
|
* @internal
|
|
@@ -49648,7 +49656,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49648
49656
|
* @internal
|
|
49649
49657
|
*/
|
|
49650
49658
|
get supportedVersion() {
|
|
49651
|
-
return { min: CLAPPR_VERSION };
|
|
49659
|
+
return { min: CLAPPR_VERSION$1 };
|
|
49652
49660
|
}
|
|
49653
49661
|
static buttonTemplate = tmpl(buttonHtml$1);
|
|
49654
49662
|
static listTemplate = tmpl(listHtml$1);
|
|
@@ -49931,7 +49939,7 @@ class Poster extends UIContainerPlugin {
|
|
|
49931
49939
|
* @internal
|
|
49932
49940
|
*/
|
|
49933
49941
|
get supportedVersion() {
|
|
49934
|
-
return { min: CLAPPR_VERSION };
|
|
49942
|
+
return { min: CLAPPR_VERSION$1 };
|
|
49935
49943
|
}
|
|
49936
49944
|
static template = tmpl(posterHTML);
|
|
49937
49945
|
get shouldRender() {
|
|
@@ -50158,7 +50166,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50158
50166
|
|
|
50159
50167
|
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";
|
|
50160
50168
|
|
|
50161
|
-
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=\"#\"
|
|
50169
|
+
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";
|
|
50162
50170
|
|
|
50163
50171
|
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";
|
|
50164
50172
|
|
|
@@ -50208,7 +50216,7 @@ class QualityLevels extends UICorePlugin {
|
|
|
50208
50216
|
* @internal
|
|
50209
50217
|
*/
|
|
50210
50218
|
get supportedVersion() {
|
|
50211
|
-
return { min: CLAPPR_VERSION };
|
|
50219
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50212
50220
|
}
|
|
50213
50221
|
/**
|
|
50214
50222
|
* @internal
|
|
@@ -50445,7 +50453,7 @@ class SeekTime extends UICorePlugin {
|
|
|
50445
50453
|
return 'seek_time';
|
|
50446
50454
|
}
|
|
50447
50455
|
get supportedVersion() {
|
|
50448
|
-
return { min: CLAPPR_VERSION };
|
|
50456
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50449
50457
|
}
|
|
50450
50458
|
get template() {
|
|
50451
50459
|
return tmpl(seekTimeHTML);
|
|
@@ -50607,7 +50615,7 @@ class Share extends UICorePlugin {
|
|
|
50607
50615
|
return 'share';
|
|
50608
50616
|
}
|
|
50609
50617
|
get supportedVersion() {
|
|
50610
|
-
return { min: CLAPPR_VERSION };
|
|
50618
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50611
50619
|
}
|
|
50612
50620
|
get template() {
|
|
50613
50621
|
return tmpl(pluginHtml$2);
|
|
@@ -50726,7 +50734,7 @@ class SkipTime extends UICorePlugin {
|
|
|
50726
50734
|
return 'skip_time';
|
|
50727
50735
|
}
|
|
50728
50736
|
get supportedVersion() {
|
|
50729
|
-
return { min: CLAPPR_VERSION };
|
|
50737
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50730
50738
|
}
|
|
50731
50739
|
get container() {
|
|
50732
50740
|
return this.core && this.core.activeContainer;
|
|
@@ -50845,7 +50853,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
50845
50853
|
* @internal
|
|
50846
50854
|
*/
|
|
50847
50855
|
get supportedVersion() {
|
|
50848
|
-
return { min: CLAPPR_VERSION };
|
|
50856
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50849
50857
|
}
|
|
50850
50858
|
/**
|
|
50851
50859
|
* @internal
|
|
@@ -51079,7 +51087,7 @@ class SourceController extends CorePlugin {
|
|
|
51079
51087
|
* @internal
|
|
51080
51088
|
*/
|
|
51081
51089
|
get supportedVersion() {
|
|
51082
|
-
return { min: CLAPPR_VERSION };
|
|
51090
|
+
return { min: CLAPPR_VERSION$1 };
|
|
51083
51091
|
}
|
|
51084
51092
|
/**
|
|
51085
51093
|
* @param core - The Clappr core instance.
|
|
@@ -51264,7 +51272,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51264
51272
|
* @internal
|
|
51265
51273
|
*/
|
|
51266
51274
|
get supportedVersion() {
|
|
51267
|
-
return { min: CLAPPR_VERSION };
|
|
51275
|
+
return { min: CLAPPR_VERSION$1 };
|
|
51268
51276
|
}
|
|
51269
51277
|
/**
|
|
51270
51278
|
* @internal
|
|
@@ -51610,7 +51618,7 @@ class Telemetry extends ContainerPlugin {
|
|
|
51610
51618
|
* The supported version of the plugin.
|
|
51611
51619
|
*/
|
|
51612
51620
|
get supportedVersion() {
|
|
51613
|
-
return { min: CLAPPR_VERSION };
|
|
51621
|
+
return { min: CLAPPR_VERSION$1 };
|
|
51614
51622
|
}
|
|
51615
51623
|
started = false;
|
|
51616
51624
|
timeStart = 0;
|
|
@@ -51897,7 +51905,7 @@ class Thumbnails extends UICorePlugin {
|
|
|
51897
51905
|
* @internal
|
|
51898
51906
|
*/
|
|
51899
51907
|
get supportedVersion() {
|
|
51900
|
-
return { min: CLAPPR_VERSION };
|
|
51908
|
+
return { min: CLAPPR_VERSION$1 };
|
|
51901
51909
|
}
|
|
51902
51910
|
/**
|
|
51903
51911
|
* @internal
|
|
@@ -52396,4 +52404,4 @@ class VolumeFade extends UICorePlugin {
|
|
|
52396
52404
|
}
|
|
52397
52405
|
}
|
|
52398
52406
|
|
|
52399
|
-
export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, ClapprNerdStats, ClapprStats, ClickToPause,
|
|
52407
|
+
export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, ClapprNerdStats, ClapprStats, ClickToPause, Clips, ClosedCaptions, ContextMenu, DvrControls, ErrorScreen, Favicon, GearEvents, GoogleAnalytics, QualityLevels as LevelSelector, LogTracer, Logger, Logo, MediaControl, MultiCamera, 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 };
|