@gcorevideo/player 2.22.15 → 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/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 +1 -1
- package/dist/index.css +602 -602
- package/dist/index.js +252 -229
- package/dist/player.d.ts +211 -144
- package/dist/plugins/index.css +1198 -1198
- package/dist/plugins/index.js +185 -167
- 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/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/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/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/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__/__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
|
});
|
|
@@ -42253,7 +42253,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42253
42253
|
this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
|
|
42254
42254
|
}
|
|
42255
42255
|
_onHLSJSError(evt, data) {
|
|
42256
|
-
trace(`${T$
|
|
42256
|
+
trace(`${T$k} _onHLSJSError`, {
|
|
42257
42257
|
fatal: data.fatal,
|
|
42258
42258
|
type: data.type,
|
|
42259
42259
|
details: data.details,
|
|
@@ -42301,7 +42301,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42301
42301
|
evt,
|
|
42302
42302
|
data,
|
|
42303
42303
|
});
|
|
42304
|
-
trace(`${T$
|
|
42304
|
+
trace(`${T$k} _onHLSJSError trying to recover from network error`, {
|
|
42305
42305
|
details: data.details,
|
|
42306
42306
|
});
|
|
42307
42307
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42314,7 +42314,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42314
42314
|
evt,
|
|
42315
42315
|
data,
|
|
42316
42316
|
});
|
|
42317
|
-
trace(`${T$
|
|
42317
|
+
trace(`${T$k} _onHLSJSError trying to recover from media error`, {
|
|
42318
42318
|
details: data.details,
|
|
42319
42319
|
});
|
|
42320
42320
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42344,7 +42344,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42344
42344
|
return;
|
|
42345
42345
|
}
|
|
42346
42346
|
Log.warn('hlsjs: non-fatal error occurred', { evt, data });
|
|
42347
|
-
trace(`${T$
|
|
42347
|
+
trace(`${T$k} _onHLSJSError non-fatal error occurred`, {
|
|
42348
42348
|
type: data.type,
|
|
42349
42349
|
details: data.details,
|
|
42350
42350
|
});
|
|
@@ -42679,11 +42679,11 @@ class HlsPlayback extends BasePlayback {
|
|
|
42679
42679
|
this._hls.audioTrack = Number(id); // TODO or find index by .id == id?
|
|
42680
42680
|
}
|
|
42681
42681
|
_onAudioTracksUpdated(_, data) {
|
|
42682
|
-
trace(`${T$
|
|
42682
|
+
trace(`${T$k} onAudioTracksUpdated`);
|
|
42683
42683
|
this.trigger(Events$1.PLAYBACK_AUDIO_AVAILABLE, data.audioTracks.map(toClapprTrack));
|
|
42684
42684
|
}
|
|
42685
42685
|
_onAudioTrackSwitched(_, data) {
|
|
42686
|
-
trace(`${T$
|
|
42686
|
+
trace(`${T$k} onAudioTrackSwitched`);
|
|
42687
42687
|
// @ts-ignore
|
|
42688
42688
|
const track = this._hls.audioTracks[data.id];
|
|
42689
42689
|
this.trigger(Events$1.PLAYBACK_AUDIO_CHANGED, toClapprTrack(track));
|
|
@@ -42704,7 +42704,7 @@ function toClapprTrack(t) {
|
|
|
42704
42704
|
};
|
|
42705
42705
|
}
|
|
42706
42706
|
|
|
42707
|
-
const T$
|
|
42707
|
+
const T$j = 'playback.html5_video';
|
|
42708
42708
|
const STALL_TIMEOUT = 15000;
|
|
42709
42709
|
class HTML5Video extends BasePlayback {
|
|
42710
42710
|
stallTimerId = null;
|
|
@@ -42712,7 +42712,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42712
42712
|
* @internal
|
|
42713
42713
|
*/
|
|
42714
42714
|
createError(errorData, options) {
|
|
42715
|
-
trace(`${T$
|
|
42715
|
+
trace(`${T$j} createError`, {
|
|
42716
42716
|
errorData: { ...errorData },
|
|
42717
42717
|
});
|
|
42718
42718
|
const i18n = this.i18n ||
|
|
@@ -42728,11 +42728,11 @@ class HTML5Video extends BasePlayback {
|
|
|
42728
42728
|
return super.createError(errorData, { ...options, useCodePrefix: false });
|
|
42729
42729
|
}
|
|
42730
42730
|
_onWaiting() {
|
|
42731
|
-
trace(`${T$
|
|
42731
|
+
trace(`${T$j} _onWaiting`);
|
|
42732
42732
|
super._onWaiting();
|
|
42733
42733
|
}
|
|
42734
42734
|
_onEnded() {
|
|
42735
|
-
trace(`${T$
|
|
42735
|
+
trace(`${T$j} _onEnded`);
|
|
42736
42736
|
if (this.stallTimerId) {
|
|
42737
42737
|
clearTimeout(this.stallTimerId);
|
|
42738
42738
|
this.stallTimerId = null;
|
|
@@ -42740,12 +42740,12 @@ class HTML5Video extends BasePlayback {
|
|
|
42740
42740
|
super._onEnded();
|
|
42741
42741
|
}
|
|
42742
42742
|
_handleBufferingEvents() {
|
|
42743
|
-
trace(`${T$
|
|
42743
|
+
trace(`${T$j} _handleBufferingEvents`, {
|
|
42744
42744
|
networkState: this.el.networkState,
|
|
42745
42745
|
});
|
|
42746
42746
|
if (!this.stallTimerId) {
|
|
42747
42747
|
this.stallTimerId = setTimeout(() => {
|
|
42748
|
-
trace(`${T$
|
|
42748
|
+
trace(`${T$j} _handleBufferingEvents stall timeout`, {
|
|
42749
42749
|
buffering: this.buffering,
|
|
42750
42750
|
ended: this.ended,
|
|
42751
42751
|
});
|
|
@@ -42763,7 +42763,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42763
42763
|
super._handleBufferingEvents();
|
|
42764
42764
|
}
|
|
42765
42765
|
_onPlaying() {
|
|
42766
|
-
trace(`${T$
|
|
42766
|
+
trace(`${T$j} _onPlaying`);
|
|
42767
42767
|
if (this.stallTimerId) {
|
|
42768
42768
|
clearTimeout(this.stallTimerId);
|
|
42769
42769
|
this.stallTimerId = null;
|
|
@@ -42771,7 +42771,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42771
42771
|
super._onPlaying();
|
|
42772
42772
|
}
|
|
42773
42773
|
_onPause() {
|
|
42774
|
-
trace(`${T$
|
|
42774
|
+
trace(`${T$j} _onPause`);
|
|
42775
42775
|
super._onPause();
|
|
42776
42776
|
if (this.stallTimerId) {
|
|
42777
42777
|
clearTimeout(this.stallTimerId);
|
|
@@ -42781,7 +42781,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42781
42781
|
get audioTracks() {
|
|
42782
42782
|
const tracks = this.el.audioTracks;
|
|
42783
42783
|
const supported = !!tracks;
|
|
42784
|
-
trace(`${T$
|
|
42784
|
+
trace(`${T$j} get audioTracks`, { supported });
|
|
42785
42785
|
const retval = [];
|
|
42786
42786
|
if (supported) {
|
|
42787
42787
|
for (let i = 0; i < tracks.length; i++) {
|
|
@@ -42800,7 +42800,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42800
42800
|
get currentAudioTrack() {
|
|
42801
42801
|
const tracks = this.el.audioTracks;
|
|
42802
42802
|
const supported = !!tracks;
|
|
42803
|
-
trace(`${T$
|
|
42803
|
+
trace(`${T$j} get currentAudioTrack`, {
|
|
42804
42804
|
supported,
|
|
42805
42805
|
});
|
|
42806
42806
|
if (supported) {
|
|
@@ -42821,7 +42821,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42821
42821
|
switchAudioTrack(id) {
|
|
42822
42822
|
const tracks = this.el.audioTracks;
|
|
42823
42823
|
const supported = !!tracks;
|
|
42824
|
-
trace(`${T$
|
|
42824
|
+
trace(`${T$j} switchAudioTrack`, {
|
|
42825
42825
|
supported,
|
|
42826
42826
|
});
|
|
42827
42827
|
if (supported) {
|
|
@@ -42840,7 +42840,7 @@ function registerPlaybacks() {
|
|
|
42840
42840
|
Loader.registerPlayback(DashPlayback);
|
|
42841
42841
|
}
|
|
42842
42842
|
|
|
42843
|
-
const T$
|
|
42843
|
+
const T$i = 'GPlayer';
|
|
42844
42844
|
const DEFAULT_OPTIONS = {
|
|
42845
42845
|
autoPlay: false,
|
|
42846
42846
|
debug: 'none',
|
|
@@ -42928,7 +42928,7 @@ class Player {
|
|
|
42928
42928
|
* ```
|
|
42929
42929
|
*/
|
|
42930
42930
|
attachTo(playerElement) {
|
|
42931
|
-
trace(`${T$
|
|
42931
|
+
trace(`${T$i} attachTo`, {
|
|
42932
42932
|
player: !!this.player,
|
|
42933
42933
|
});
|
|
42934
42934
|
assert.ok(!this.player, 'Player already initialized');
|
|
@@ -42938,7 +42938,7 @@ class Player {
|
|
|
42938
42938
|
}
|
|
42939
42939
|
const coreOpts = this.buildCoreOptions(playerElement);
|
|
42940
42940
|
const { core, container } = Player.getRegisteredPlugins();
|
|
42941
|
-
trace(`${T$
|
|
42941
|
+
trace(`${T$i} init`, {
|
|
42942
42942
|
registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.prototype.name),
|
|
42943
42943
|
});
|
|
42944
42944
|
coreOpts.plugins = {
|
|
@@ -42952,7 +42952,7 @@ class Player {
|
|
|
42952
42952
|
* Destroys the player, releasing all resources and unmounting its UI from the DOM.
|
|
42953
42953
|
*/
|
|
42954
42954
|
destroy() {
|
|
42955
|
-
trace(`${T$
|
|
42955
|
+
trace(`${T$i} destroy`, {
|
|
42956
42956
|
player: !!this.player,
|
|
42957
42957
|
});
|
|
42958
42958
|
if (this.player) {
|
|
@@ -43139,7 +43139,7 @@ class Player {
|
|
|
43139
43139
|
this.config = $.extend(true, this.config, config);
|
|
43140
43140
|
}
|
|
43141
43141
|
initPlayer(coreOptions) {
|
|
43142
|
-
trace(`${T$
|
|
43142
|
+
trace(`${T$i} initPlayer`, {
|
|
43143
43143
|
autoPlay: coreOptions.autoPlay,
|
|
43144
43144
|
sources: coreOptions.sources,
|
|
43145
43145
|
player: !!this.player,
|
|
@@ -43164,7 +43164,7 @@ class Player {
|
|
|
43164
43164
|
}
|
|
43165
43165
|
}
|
|
43166
43166
|
triggerAutoPlay() {
|
|
43167
|
-
trace(`${T$
|
|
43167
|
+
trace(`${T$i} triggerAutoPlay`);
|
|
43168
43168
|
setTimeout(() => {
|
|
43169
43169
|
this.player?.play({
|
|
43170
43170
|
autoPlay: true,
|
|
@@ -43182,7 +43182,7 @@ class Player {
|
|
|
43182
43182
|
// TODO test
|
|
43183
43183
|
events = {
|
|
43184
43184
|
onReady: () => {
|
|
43185
|
-
trace(`${T$
|
|
43185
|
+
trace(`${T$i} onReady`, {
|
|
43186
43186
|
ready: this.ready,
|
|
43187
43187
|
});
|
|
43188
43188
|
if (this.ready) {
|
|
@@ -43216,7 +43216,7 @@ class Player {
|
|
|
43216
43216
|
buildCoreOptions(rootNode) {
|
|
43217
43217
|
const sources = this.buildMediaSourcesList();
|
|
43218
43218
|
const source = sources[0];
|
|
43219
|
-
trace(`${T$
|
|
43219
|
+
trace(`${T$i} buildCoreOptions`, {
|
|
43220
43220
|
source,
|
|
43221
43221
|
sources,
|
|
43222
43222
|
});
|
|
@@ -43277,7 +43277,7 @@ class Player {
|
|
|
43277
43277
|
assert.ok(this.player, 'Player is not initialized');
|
|
43278
43278
|
const core = this.player.core;
|
|
43279
43279
|
core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
|
|
43280
|
-
trace(`${T$
|
|
43280
|
+
trace(`${T$i} on CORE_SCREEN_ORIENTATION_CHANGED`, {
|
|
43281
43281
|
orientation,
|
|
43282
43282
|
rootNode: {
|
|
43283
43283
|
width: this.rootNode?.clientWidth,
|
|
@@ -43292,14 +43292,14 @@ class Player {
|
|
|
43292
43292
|
}
|
|
43293
43293
|
}, null);
|
|
43294
43294
|
core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
|
|
43295
|
-
trace(`${T$
|
|
43295
|
+
trace(`${T$i} on CORE_RESIZE`, {
|
|
43296
43296
|
width,
|
|
43297
43297
|
height,
|
|
43298
43298
|
});
|
|
43299
43299
|
this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
|
|
43300
43300
|
}, null);
|
|
43301
43301
|
core.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
|
|
43302
|
-
trace(`${T$
|
|
43302
|
+
trace(`${T$i} CORE_FULLSCREEN`, {
|
|
43303
43303
|
isFullscreen,
|
|
43304
43304
|
});
|
|
43305
43305
|
this.safeTriggerEvent(PlayerEvent.Fullscreen, isFullscreen);
|
|
@@ -43307,7 +43307,7 @@ class Player {
|
|
|
43307
43307
|
}
|
|
43308
43308
|
}
|
|
43309
43309
|
|
|
43310
|
-
var version$1 = "2.22.
|
|
43310
|
+
var version$1 = "2.22.16";
|
|
43311
43311
|
|
|
43312
43312
|
var packages = {
|
|
43313
43313
|
"node_modules/@clappr/core": {
|
|
@@ -43335,7 +43335,7 @@ const pluginHtml$7 = "<button data-audiotracks-button class='gcore-skin-button-c
|
|
|
43335
43335
|
|
|
43336
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";
|
|
43337
43337
|
|
|
43338
|
-
const VERSION$
|
|
43338
|
+
const VERSION$7 = '2.22.4';
|
|
43339
43339
|
// const T = 'plugins.audiotracks'
|
|
43340
43340
|
/**
|
|
43341
43341
|
* `PLUGIN` that makes possible to switch audio tracks via the media control UI.
|
|
@@ -43360,13 +43360,13 @@ class AudioTracks extends UICorePlugin {
|
|
|
43360
43360
|
* @internal
|
|
43361
43361
|
*/
|
|
43362
43362
|
get supportedVersion() {
|
|
43363
|
-
return { min: CLAPPR_VERSION };
|
|
43363
|
+
return { min: CLAPPR_VERSION$1 };
|
|
43364
43364
|
}
|
|
43365
43365
|
/**
|
|
43366
43366
|
* @internal
|
|
43367
43367
|
*/
|
|
43368
43368
|
static get version() {
|
|
43369
|
-
return VERSION$
|
|
43369
|
+
return VERSION$7;
|
|
43370
43370
|
}
|
|
43371
43371
|
static template = tmpl(pluginHtml$7);
|
|
43372
43372
|
/**
|
|
@@ -43499,7 +43499,7 @@ const volumeOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
|
|
|
43499
43499
|
|
|
43500
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";
|
|
43501
43501
|
|
|
43502
|
-
const T$
|
|
43502
|
+
const T$h = 'plugins.big_mute_button';
|
|
43503
43503
|
// TODO rewrite as a container plugin
|
|
43504
43504
|
/**
|
|
43505
43505
|
* `PLUGIN` that displays a big mute button over the video when it's muted.
|
|
@@ -43521,7 +43521,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43521
43521
|
* @internal
|
|
43522
43522
|
*/
|
|
43523
43523
|
get supportedVersion() {
|
|
43524
|
-
return { min: CLAPPR_VERSION };
|
|
43524
|
+
return { min: CLAPPR_VERSION$1 };
|
|
43525
43525
|
}
|
|
43526
43526
|
static template = tmpl(pluginHtml$6);
|
|
43527
43527
|
/**
|
|
@@ -43540,7 +43540,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43540
43540
|
this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
43541
43541
|
this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
|
|
43542
43542
|
this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
|
|
43543
|
-
trace(`${T$
|
|
43543
|
+
trace(`${T$h} bindEvents`, {
|
|
43544
43544
|
mediacontrol: !!this.core.mediaControl,
|
|
43545
43545
|
});
|
|
43546
43546
|
this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
|
|
@@ -43565,12 +43565,12 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43565
43565
|
}
|
|
43566
43566
|
mediaControlRendered() {
|
|
43567
43567
|
const container = this.core.activeContainer;
|
|
43568
|
-
trace(`${T$
|
|
43568
|
+
trace(`${T$h} mediaControlRendered`, {
|
|
43569
43569
|
container: !!container,
|
|
43570
43570
|
});
|
|
43571
43571
|
if (container) {
|
|
43572
43572
|
this.listenTo(container.playback, Events$1.PLAYBACK_PLAY, () => {
|
|
43573
|
-
trace(`${T$
|
|
43573
|
+
trace(`${T$h} PLAYBACK_PLAY`);
|
|
43574
43574
|
this.render();
|
|
43575
43575
|
});
|
|
43576
43576
|
}
|
|
@@ -43594,7 +43594,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43594
43594
|
}
|
|
43595
43595
|
const { autoPlay, wasMuted } = this.options;
|
|
43596
43596
|
const volume = container.volume;
|
|
43597
|
-
trace(`${T$
|
|
43597
|
+
trace(`${T$h} shouldRender`, {
|
|
43598
43598
|
autoPlay,
|
|
43599
43599
|
wasMuted,
|
|
43600
43600
|
volume,
|
|
@@ -43606,7 +43606,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43606
43606
|
*/
|
|
43607
43607
|
render() {
|
|
43608
43608
|
if (this.shouldRender()) {
|
|
43609
|
-
trace(`${T$
|
|
43609
|
+
trace(`${T$h} render`, {
|
|
43610
43610
|
el: !!this.$el,
|
|
43611
43611
|
});
|
|
43612
43612
|
this.$el.html(BigMuteButton.template());
|
|
@@ -43651,8 +43651,8 @@ const gearIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"n
|
|
|
43651
43651
|
|
|
43652
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";
|
|
43653
43653
|
|
|
43654
|
-
const VERSION$
|
|
43655
|
-
const T$
|
|
43654
|
+
const VERSION$6 = '2.19.12';
|
|
43655
|
+
const T$g = 'plugins.bottom_gear';
|
|
43656
43656
|
/**
|
|
43657
43657
|
* Events triggered by the plugin
|
|
43658
43658
|
* @beta
|
|
@@ -43745,13 +43745,13 @@ class BottomGear extends UICorePlugin {
|
|
|
43745
43745
|
* @internal
|
|
43746
43746
|
*/
|
|
43747
43747
|
get supportedVersion() {
|
|
43748
|
-
return { min: CLAPPR_VERSION };
|
|
43748
|
+
return { min: CLAPPR_VERSION$1 };
|
|
43749
43749
|
}
|
|
43750
43750
|
/**
|
|
43751
43751
|
* @internal
|
|
43752
43752
|
*/
|
|
43753
43753
|
static get version() {
|
|
43754
|
-
return VERSION$
|
|
43754
|
+
return VERSION$6;
|
|
43755
43755
|
}
|
|
43756
43756
|
static template = tmpl(pluginHtml$5);
|
|
43757
43757
|
/**
|
|
@@ -43802,20 +43802,20 @@ class BottomGear extends UICorePlugin {
|
|
|
43802
43802
|
addItem(name, $subMenu) {
|
|
43803
43803
|
const $existingItem = this.$el.find(`#gear-options li[data-${name}`);
|
|
43804
43804
|
if ($existingItem.length) {
|
|
43805
|
-
trace(`${T$
|
|
43805
|
+
trace(`${T$g} addItem already exists`, { name });
|
|
43806
43806
|
return $existingItem;
|
|
43807
43807
|
}
|
|
43808
43808
|
const $item = $('<li></li>')
|
|
43809
43809
|
.attr(`data-${name}`, '')
|
|
43810
43810
|
.appendTo(this.$el.find('#gear-options'));
|
|
43811
43811
|
if ($subMenu) {
|
|
43812
|
-
trace(`${T$
|
|
43812
|
+
trace(`${T$g} addItem adding submenu`, { name });
|
|
43813
43813
|
$subMenu
|
|
43814
43814
|
.addClass('gear-sub-menu-wrapper')
|
|
43815
43815
|
.hide()
|
|
43816
43816
|
.appendTo(this.$el.find('#gear-options-wrapper'));
|
|
43817
43817
|
$item.on('click', (e) => {
|
|
43818
|
-
trace(`${T$
|
|
43818
|
+
trace(`${T$g} addItem submenu clicked`, { name });
|
|
43819
43819
|
e.stopPropagation();
|
|
43820
43820
|
$subMenu.show();
|
|
43821
43821
|
this.$el.find('#gear-options').hide();
|
|
@@ -43824,15 +43824,15 @@ class BottomGear extends UICorePlugin {
|
|
|
43824
43824
|
return $item;
|
|
43825
43825
|
}
|
|
43826
43826
|
onActiveContainerChanged() {
|
|
43827
|
-
trace(`${T$
|
|
43827
|
+
trace(`${T$g} onActiveContainerChanged`);
|
|
43828
43828
|
this.bindContainerEvents();
|
|
43829
43829
|
}
|
|
43830
43830
|
bindContainerEvents() {
|
|
43831
|
-
trace(`${T$
|
|
43831
|
+
trace(`${T$g} bindContainerEvents`);
|
|
43832
43832
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
|
|
43833
43833
|
}
|
|
43834
43834
|
highDefinitionUpdate(isHd) {
|
|
43835
|
-
trace(`${T$
|
|
43835
|
+
trace(`${T$g} highDefinitionUpdate`, { isHd });
|
|
43836
43836
|
this.isHd = isHd;
|
|
43837
43837
|
this.$el.find('.gear-icon').html(isHd ? gearHdIcon : gearIcon);
|
|
43838
43838
|
}
|
|
@@ -43840,7 +43840,7 @@ class BottomGear extends UICorePlugin {
|
|
|
43840
43840
|
* @internal
|
|
43841
43841
|
*/
|
|
43842
43842
|
render() {
|
|
43843
|
-
trace(`${T$
|
|
43843
|
+
trace(`${T$g} render`);
|
|
43844
43844
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43845
43845
|
if (!mediaControl) {
|
|
43846
43846
|
return this; // TODO test
|
|
@@ -43872,14 +43872,14 @@ class BottomGear extends UICorePlugin {
|
|
|
43872
43872
|
this.$el.find('#gear-options-wrapper').hide();
|
|
43873
43873
|
}
|
|
43874
43874
|
onCoreReady() {
|
|
43875
|
-
trace(`${T$
|
|
43875
|
+
trace(`${T$g} onCoreReady`);
|
|
43876
43876
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43877
43877
|
assert(mediaControl, 'media_control plugin is required');
|
|
43878
43878
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMediaControlRendered);
|
|
43879
43879
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.hide);
|
|
43880
43880
|
}
|
|
43881
43881
|
onMediaControlRendered() {
|
|
43882
|
-
trace(`${T$
|
|
43882
|
+
trace(`${T$g} onMediaControlRendered`);
|
|
43883
43883
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43884
43884
|
mediaControl.putElement('gear', this.$el);
|
|
43885
43885
|
}
|
|
@@ -46026,7 +46026,7 @@ const drawSummary = (customMetrics, vodContainer, liveContainer) => {
|
|
|
46026
46026
|
vodContainer.html(vodHtml);
|
|
46027
46027
|
liveContainer.html(liveHtml);
|
|
46028
46028
|
};
|
|
46029
|
-
const T$
|
|
46029
|
+
const T$f = 'plugins.clappr_nerd_stats';
|
|
46030
46030
|
/**
|
|
46031
46031
|
* `PLUGIN` that displays useful network-related statistics.
|
|
46032
46032
|
* @beta
|
|
@@ -46065,7 +46065,7 @@ class ClapprNerdStats extends UICorePlugin {
|
|
|
46065
46065
|
* @internal
|
|
46066
46066
|
*/
|
|
46067
46067
|
get supportedVersion() {
|
|
46068
|
-
return { min: CLAPPR_VERSION };
|
|
46068
|
+
return { min: CLAPPR_VERSION$1 };
|
|
46069
46069
|
}
|
|
46070
46070
|
static template = tmpl(pluginHtml$4);
|
|
46071
46071
|
/**
|
|
@@ -46235,14 +46235,14 @@ class ClapprNerdStats extends UICorePlugin {
|
|
|
46235
46235
|
* @internal
|
|
46236
46236
|
*/
|
|
46237
46237
|
render() {
|
|
46238
|
-
trace(`${T$
|
|
46238
|
+
trace(`${T$f} render`);
|
|
46239
46239
|
// TODO append to the container
|
|
46240
46240
|
this.core.$el.append(this.$el[0]);
|
|
46241
46241
|
this.hide();
|
|
46242
46242
|
return this;
|
|
46243
46243
|
}
|
|
46244
46244
|
addToBottomGear() {
|
|
46245
|
-
trace(`${T$
|
|
46245
|
+
trace(`${T$f} addToBottomGear`);
|
|
46246
46246
|
const gear = this.core.getPlugin('bottom_gear');
|
|
46247
46247
|
gear
|
|
46248
46248
|
.addItem('nerd')
|
|
@@ -46326,7 +46326,7 @@ class ClapprStats extends ContainerPlugin {
|
|
|
46326
46326
|
* @internal
|
|
46327
46327
|
*/
|
|
46328
46328
|
get supportedVersion() {
|
|
46329
|
-
return { min: CLAPPR_VERSION };
|
|
46329
|
+
return { min: CLAPPR_VERSION$1 };
|
|
46330
46330
|
}
|
|
46331
46331
|
get _playbackName() {
|
|
46332
46332
|
return String(this.container.playback.name || '');
|
|
@@ -46648,7 +46648,7 @@ class ClapprStats extends ContainerPlugin {
|
|
|
46648
46648
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
46649
46649
|
// Use of this source code is governed by a BSD-style
|
|
46650
46650
|
// license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
|
|
46651
|
-
const T$
|
|
46651
|
+
const T$e = 'plugins.click_to_pause';
|
|
46652
46652
|
/**
|
|
46653
46653
|
* A small `PLUGIN` that toggles the playback state on click over the video container
|
|
46654
46654
|
* @beta
|
|
@@ -46666,7 +46666,7 @@ class ClickToPause extends ContainerPlugin {
|
|
|
46666
46666
|
* @internal
|
|
46667
46667
|
*/
|
|
46668
46668
|
get supportedVersion() {
|
|
46669
|
-
return { min: CLAPPR_VERSION };
|
|
46669
|
+
return { min: CLAPPR_VERSION$1 };
|
|
46670
46670
|
}
|
|
46671
46671
|
/**
|
|
46672
46672
|
* @internal
|
|
@@ -46678,7 +46678,7 @@ class ClickToPause extends ContainerPlugin {
|
|
|
46678
46678
|
click() {
|
|
46679
46679
|
const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
|
|
46680
46680
|
const isDvrEnabled = this.container.isDvrEnabled();
|
|
46681
|
-
trace(`${T$
|
|
46681
|
+
trace(`${T$e} click`, {
|
|
46682
46682
|
isLivePlayback,
|
|
46683
46683
|
isDvrEnabled,
|
|
46684
46684
|
});
|
|
@@ -46720,7 +46720,15 @@ class ClickToPause extends ContainerPlugin {
|
|
|
46720
46720
|
}
|
|
46721
46721
|
}
|
|
46722
46722
|
|
|
46723
|
-
|
|
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) {
|
|
46724
46732
|
if (!str) {
|
|
46725
46733
|
return 0;
|
|
46726
46734
|
}
|
|
@@ -46729,21 +46737,12 @@ function strtimeToMiliseconds(str) {
|
|
|
46729
46737
|
if (arr.length >= 3) {
|
|
46730
46738
|
h = parseInt(arr[arr.length - 3]) * 60 * 60;
|
|
46731
46739
|
}
|
|
46732
|
-
else {
|
|
46733
|
-
h = 0;
|
|
46734
|
-
}
|
|
46735
46740
|
if (arr.length >= 2) {
|
|
46736
46741
|
m = parseInt(arr[arr.length - 2]) * 60;
|
|
46737
46742
|
}
|
|
46738
|
-
else {
|
|
46739
|
-
m = 0;
|
|
46740
|
-
}
|
|
46741
46743
|
if (arr.length >= 1) {
|
|
46742
46744
|
s = parseInt(arr[arr.length - 1]);
|
|
46743
46745
|
}
|
|
46744
|
-
else {
|
|
46745
|
-
s = 0;
|
|
46746
|
-
}
|
|
46747
46746
|
return (h + m + s);
|
|
46748
46747
|
}
|
|
46749
46748
|
function getPageX(event) {
|
|
@@ -46756,22 +46755,65 @@ function getPageX(event) {
|
|
|
46756
46755
|
return 0;
|
|
46757
46756
|
}
|
|
46758
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';
|
|
46759
46799
|
/**
|
|
46760
|
-
* `PLUGIN` that
|
|
46800
|
+
* `PLUGIN` that allows marking up the timeline of the video
|
|
46761
46801
|
* @beta
|
|
46762
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
|
+
*
|
|
46763
46805
|
* Depends on:
|
|
46764
46806
|
*
|
|
46765
46807
|
* - {@link MediaControl}
|
|
46766
46808
|
*
|
|
46767
46809
|
* Configuration options - {@link ClipsPluginSettings}
|
|
46768
46810
|
*/
|
|
46769
|
-
class
|
|
46770
|
-
|
|
46771
|
-
|
|
46772
|
-
|
|
46773
|
-
_oldContainer;
|
|
46811
|
+
class Clips extends UICorePlugin {
|
|
46812
|
+
barStyle = null;
|
|
46813
|
+
clips = [];
|
|
46814
|
+
oldContainer;
|
|
46774
46815
|
svgMask = null;
|
|
46816
|
+
static template = tmpl(clipsHTML);
|
|
46775
46817
|
/**
|
|
46776
46818
|
* @internal
|
|
46777
46819
|
*/
|
|
@@ -46783,130 +46825,121 @@ class ClipsPlugin extends UICorePlugin {
|
|
|
46783
46825
|
*/
|
|
46784
46826
|
get attributes() {
|
|
46785
46827
|
return {
|
|
46786
|
-
class:
|
|
46828
|
+
class: 'media-control-clips',
|
|
46787
46829
|
};
|
|
46788
46830
|
}
|
|
46831
|
+
get version() {
|
|
46832
|
+
return VERSION$5;
|
|
46833
|
+
}
|
|
46834
|
+
get supportedVersion() {
|
|
46835
|
+
return { min: CLAPPR_VERSION };
|
|
46836
|
+
}
|
|
46789
46837
|
/**
|
|
46790
46838
|
* @internal
|
|
46791
46839
|
*/
|
|
46792
46840
|
bindEvents() {
|
|
46793
|
-
|
|
46794
|
-
assert(mediaControl, 'media_control plugin is required');
|
|
46795
|
-
this.listenToOnce(this.core, Events$1.CORE_READY, this._onCoreReady);
|
|
46796
|
-
// TODO listen to CORE_ACTIVE_CONTAINER_CHANGED
|
|
46797
|
-
this.listenTo(mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this._onMediaControlContainerChanged);
|
|
46841
|
+
this.listenToOnce(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
46798
46842
|
this.listenTo(this.core, Events$1.CORE_RESIZE, this.playerResize);
|
|
46843
|
+
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
|
|
46799
46844
|
}
|
|
46800
|
-
|
|
46845
|
+
render() {
|
|
46846
|
+
trace(`${T$d} render`);
|
|
46801
46847
|
if (!this.options.clips) {
|
|
46802
|
-
this
|
|
46803
|
-
return;
|
|
46848
|
+
return this;
|
|
46804
46849
|
}
|
|
46805
|
-
this.
|
|
46806
|
-
|
|
46807
|
-
|
|
46808
|
-
this._bindContainerEvents();
|
|
46850
|
+
this.$el.html(Clips.template());
|
|
46851
|
+
this.$el.hide();
|
|
46852
|
+
return this;
|
|
46809
46853
|
}
|
|
46810
|
-
|
|
46811
|
-
this.
|
|
46812
|
-
|
|
46813
|
-
this.
|
|
46854
|
+
destroy() {
|
|
46855
|
+
if (this.barStyle) {
|
|
46856
|
+
this.barStyle.remove();
|
|
46857
|
+
this.barStyle = null;
|
|
46814
46858
|
}
|
|
46859
|
+
return super.destroy();
|
|
46815
46860
|
}
|
|
46816
|
-
|
|
46817
|
-
if (this.
|
|
46818
|
-
this.
|
|
46861
|
+
disable() {
|
|
46862
|
+
if (this.barStyle) {
|
|
46863
|
+
this.barStyle.remove();
|
|
46864
|
+
this.barStyle = null;
|
|
46819
46865
|
}
|
|
46866
|
+
return super.disable();
|
|
46867
|
+
}
|
|
46868
|
+
enable() {
|
|
46869
|
+
this.render();
|
|
46870
|
+
return super.enable();
|
|
46871
|
+
}
|
|
46872
|
+
onCoreReady() {
|
|
46873
|
+
trace(`${T$d} onCoreReady`);
|
|
46874
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
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`);
|
|
46820
46881
|
const mediaControl = this.core.getPlugin('media_control');
|
|
46821
|
-
|
|
46822
|
-
|
|
46823
|
-
|
|
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
|
+
}
|
|
46824
46902
|
}
|
|
46825
46903
|
onTimeUpdate(event) {
|
|
46826
|
-
if (!this.
|
|
46827
|
-
this.duration = event.total;
|
|
46904
|
+
if (!this.svgMask) {
|
|
46828
46905
|
this.makeSvg(event.total);
|
|
46829
|
-
this.durationGetting = true;
|
|
46830
46906
|
}
|
|
46831
|
-
for (const value of this.clips
|
|
46832
|
-
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) {
|
|
46833
46910
|
this.setClipText(value.text);
|
|
46834
46911
|
break;
|
|
46835
46912
|
}
|
|
46836
46913
|
}
|
|
46837
46914
|
}
|
|
46838
|
-
parseClips() {
|
|
46839
|
-
|
|
46840
|
-
const clipsArr = textArr
|
|
46841
|
-
.map((val) => {
|
|
46842
|
-
const matchRes = val.match(/(\d+:\d+|:\d+) (.+)/i);
|
|
46843
|
-
return matchRes
|
|
46844
|
-
? {
|
|
46845
|
-
start: strtimeToMiliseconds(matchRes[1]),
|
|
46846
|
-
text: matchRes[2],
|
|
46847
|
-
}
|
|
46848
|
-
: null;
|
|
46849
|
-
})
|
|
46850
|
-
.filter((clip) => clip !== null);
|
|
46851
|
-
clipsArr.sort((a, b) => a.start - b.start);
|
|
46852
|
-
clipsArr.forEach((clip, index) => {
|
|
46853
|
-
this.clips.set(clip.start, {
|
|
46854
|
-
index,
|
|
46855
|
-
start: clip.start,
|
|
46856
|
-
text: clip.text,
|
|
46857
|
-
end: clipsArr[index + 1] ? clipsArr[index + 1].start : null,
|
|
46858
|
-
});
|
|
46859
|
-
});
|
|
46860
|
-
}
|
|
46861
|
-
/**
|
|
46862
|
-
* Returns the text of the current clip.
|
|
46863
|
-
* @param time - The current time of the player.
|
|
46864
|
-
* @returns The text of the current clip.
|
|
46865
|
-
*/
|
|
46866
|
-
getText(time) {
|
|
46867
|
-
for (const [key, value] of this.clips.entries()) {
|
|
46868
|
-
if (time >= value.start && time < value.end) {
|
|
46869
|
-
return value.text;
|
|
46870
|
-
}
|
|
46871
|
-
}
|
|
46872
|
-
return '';
|
|
46915
|
+
parseClips(text) {
|
|
46916
|
+
this.clips = parseClips(text);
|
|
46873
46917
|
}
|
|
46874
46918
|
makeSvg(duration) {
|
|
46875
|
-
|
|
46876
|
-
const widthOfSeek = this.core.activeContainer.$el.width();
|
|
46877
|
-
let finishValue = 0;
|
|
46878
|
-
this.clips.forEach((val) => {
|
|
46879
|
-
let end = val.end;
|
|
46880
|
-
if (!end) {
|
|
46881
|
-
end = val.end = duration;
|
|
46882
|
-
}
|
|
46883
|
-
const widthChunk = ((end - val.start) * widthOfSeek) / duration;
|
|
46884
|
-
svg += `<rect x="${finishValue}" y="0" width="${widthChunk - 2}" height="30"/>\n`;
|
|
46885
|
-
finishValue += widthChunk;
|
|
46886
|
-
});
|
|
46887
|
-
svg += `<rect x="${finishValue}" y="0" width="${widthOfSeek - finishValue}" height="30"/>\n`;
|
|
46888
|
-
svg += '</clipPath>' + '</defs>' + '</svg>';
|
|
46919
|
+
const svg = buildSvg(this.clips, duration, this.core.activeContainer.$el.width());
|
|
46889
46920
|
this.setSVGMask(svg);
|
|
46890
46921
|
}
|
|
46891
46922
|
setSVGMask(svg) {
|
|
46892
|
-
// this.core.mediaControl.setSVGMask(svg);
|
|
46893
46923
|
if (this.svgMask) {
|
|
46894
46924
|
this.svgMask.remove();
|
|
46895
46925
|
}
|
|
46896
|
-
const mediaControl = this.core.getPlugin('media_control');
|
|
46897
|
-
const $seekBarContainer = mediaControl.getElement('seekBarContainer');
|
|
46898
|
-
if ($seekBarContainer?.get(0)) {
|
|
46899
|
-
$seekBarContainer.addClass('clips');
|
|
46900
|
-
}
|
|
46901
46926
|
this.svgMask = $(svg);
|
|
46902
|
-
|
|
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
|
+
}
|
|
46903
46936
|
}
|
|
46904
46937
|
setClipText(text) {
|
|
46905
|
-
|
|
46906
|
-
|
|
46907
|
-
|
|
46908
|
-
|
|
46909
|
-
|
|
46938
|
+
if (text) {
|
|
46939
|
+
this.$el.show().find('#clips-text').text(text);
|
|
46940
|
+
}
|
|
46941
|
+
else {
|
|
46942
|
+
this.$el.hide();
|
|
46910
46943
|
}
|
|
46911
46944
|
}
|
|
46912
46945
|
}
|
|
@@ -46933,7 +46966,7 @@ class ContextMenu extends UIContainerPlugin {
|
|
|
46933
46966
|
* @internal
|
|
46934
46967
|
*/
|
|
46935
46968
|
get supportedVersion() {
|
|
46936
|
-
return { min: CLAPPR_VERSION };
|
|
46969
|
+
return { min: CLAPPR_VERSION$1 };
|
|
46937
46970
|
}
|
|
46938
46971
|
/**
|
|
46939
46972
|
* @internal
|
|
@@ -47054,7 +47087,7 @@ class DvrControls extends UICorePlugin {
|
|
|
47054
47087
|
* @internal
|
|
47055
47088
|
*/
|
|
47056
47089
|
get supportedVersion() {
|
|
47057
|
-
return { min: CLAPPR_VERSION };
|
|
47090
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47058
47091
|
}
|
|
47059
47092
|
/**
|
|
47060
47093
|
* @internal
|
|
@@ -47161,7 +47194,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
47161
47194
|
* @internal
|
|
47162
47195
|
*/
|
|
47163
47196
|
get supportedVersion() {
|
|
47164
|
-
return { min: CLAPPR_VERSION };
|
|
47197
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47165
47198
|
}
|
|
47166
47199
|
static template = tmpl(templateHtml);
|
|
47167
47200
|
/**
|
|
@@ -47286,7 +47319,7 @@ class Favicon extends CorePlugin {
|
|
|
47286
47319
|
* @internal
|
|
47287
47320
|
*/
|
|
47288
47321
|
get supportedVersion() {
|
|
47289
|
-
return { min: CLAPPR_VERSION };
|
|
47322
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47290
47323
|
}
|
|
47291
47324
|
/**
|
|
47292
47325
|
* @internal
|
|
@@ -47378,7 +47411,7 @@ class GoogleAnalytics extends ContainerPlugin {
|
|
|
47378
47411
|
return 'google_analytics';
|
|
47379
47412
|
}
|
|
47380
47413
|
get supportedVersion() {
|
|
47381
|
-
return { min: CLAPPR_VERSION };
|
|
47414
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47382
47415
|
}
|
|
47383
47416
|
constructor(container) {
|
|
47384
47417
|
super(container);
|
|
@@ -47525,7 +47558,7 @@ class Logo extends UIContainerPlugin {
|
|
|
47525
47558
|
return 'logo';
|
|
47526
47559
|
}
|
|
47527
47560
|
get supportedVersion() {
|
|
47528
|
-
return { min: CLAPPR_VERSION };
|
|
47561
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47529
47562
|
}
|
|
47530
47563
|
get template() {
|
|
47531
47564
|
return tmpl(logoHTML);
|
|
@@ -47915,7 +47948,7 @@ const FullscreenIOS = {
|
|
|
47915
47948
|
},
|
|
47916
47949
|
};
|
|
47917
47950
|
|
|
47918
|
-
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";
|
|
47919
47952
|
|
|
47920
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";
|
|
47921
47954
|
|
|
@@ -48005,8 +48038,6 @@ class MediaControl extends UICorePlugin {
|
|
|
48005
48038
|
userDisabled = false;
|
|
48006
48039
|
userKeepVisible = false;
|
|
48007
48040
|
verticalVolume = false;
|
|
48008
|
-
$clipText = null;
|
|
48009
|
-
$clipTextContainer = null;
|
|
48010
48041
|
$duration = null;
|
|
48011
48042
|
$fullscreenToggle = null;
|
|
48012
48043
|
$multiCameraSelector = null;
|
|
@@ -48035,7 +48066,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48035
48066
|
* @internal
|
|
48036
48067
|
*/
|
|
48037
48068
|
get supportedVersion() {
|
|
48038
|
-
return { min: CLAPPR_VERSION };
|
|
48069
|
+
return { min: CLAPPR_VERSION$1 };
|
|
48039
48070
|
}
|
|
48040
48071
|
get disabled() {
|
|
48041
48072
|
const playbackIsNOOP = this.core.activeContainer &&
|
|
@@ -48198,7 +48229,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48198
48229
|
this.userDisabled = true; // TODO distinguish between user and system (e.g., unplayable) disabled?
|
|
48199
48230
|
this.hide();
|
|
48200
48231
|
this.unbindKeyEvents();
|
|
48201
|
-
this.$el.hide();
|
|
48232
|
+
this.$el.hide(); // TODO why?
|
|
48202
48233
|
}
|
|
48203
48234
|
/**
|
|
48204
48235
|
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
@@ -48657,16 +48688,16 @@ class MediaControl extends UICorePlugin {
|
|
|
48657
48688
|
right: [],
|
|
48658
48689
|
}, this.core.activeContainer.settings);
|
|
48659
48690
|
trace(`${T$a} updateSettings`, { newSettings });
|
|
48691
|
+
newSettings.left.push('clips'); // TODO
|
|
48660
48692
|
// TODO make order controlled via CSS
|
|
48661
|
-
newSettings.left = orderByOrderPattern([...newSettings.left, '
|
|
48693
|
+
newSettings.left = orderByOrderPattern([...newSettings.left, 'volume', 'clips'], LEFT_ORDER);
|
|
48662
48694
|
if (this.core.activePlayback.getPlaybackType() === Playback.LIVE &&
|
|
48663
48695
|
this.core.activePlayback.dvrEnabled) {
|
|
48664
48696
|
newSettings.left.push('dvr');
|
|
48665
48697
|
}
|
|
48666
48698
|
// actual order of the items appear rendered is controlled by CSS
|
|
48667
48699
|
newSettings.right = DEFAULT_SETTINGS.right; // TODO get from the options
|
|
48668
|
-
if ((!this.fullScreenOnVideoTagSupported &&
|
|
48669
|
-
!fullscreenEnabled()) ||
|
|
48700
|
+
if ((!this.fullScreenOnVideoTagSupported && !fullscreenEnabled()) ||
|
|
48670
48701
|
this.options.fullscreenDisable) {
|
|
48671
48702
|
trace(`${T$a} updateSettings removing fullscreen`, {
|
|
48672
48703
|
supported: this.fullScreenOnVideoTagSupported,
|
|
@@ -48713,8 +48744,6 @@ class MediaControl extends UICorePlugin {
|
|
|
48713
48744
|
this.$volumeBarFill = this.$el.find('.bar-fill-1[data-volume]');
|
|
48714
48745
|
this.$volumeBarScrubber = this.$el.find('.bar-scrubber[data-volume]');
|
|
48715
48746
|
this.$multiCameraSelector = this.$el.find('.media-control-multicamera[data-multicamera]');
|
|
48716
|
-
this.$clipText = this.$el.find('.media-clip-text[data-clipstext]'); // TODO
|
|
48717
|
-
this.$clipTextContainer = this.$el.find('.media-clip-container[data-clipstext]');
|
|
48718
48747
|
this.resetIndicators();
|
|
48719
48748
|
this.initializeIcons();
|
|
48720
48749
|
}
|
|
@@ -48729,25 +48758,14 @@ class MediaControl extends UICorePlugin {
|
|
|
48729
48758
|
* ```ts
|
|
48730
48759
|
* class MyPlugin extends UICorePlugin {
|
|
48731
48760
|
* override render() {
|
|
48732
|
-
*
|
|
48733
|
-
*
|
|
48734
|
-
* 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)
|
|
48735
48763
|
* return this
|
|
48736
48764
|
* }
|
|
48737
48765
|
* }
|
|
48738
48766
|
* ```
|
|
48739
48767
|
*/
|
|
48740
|
-
|
|
48741
|
-
switch (name) {
|
|
48742
|
-
case 'audiotracks':
|
|
48743
|
-
return null;
|
|
48744
|
-
case 'clipText':
|
|
48745
|
-
return this.$clipText;
|
|
48746
|
-
case 'seekBarContainer':
|
|
48747
|
-
return this.$seekBarContainer;
|
|
48748
|
-
}
|
|
48749
|
-
}
|
|
48750
|
-
putElement(name, element) {
|
|
48768
|
+
mount(name, element) {
|
|
48751
48769
|
const panel = this.getElementLocation(name);
|
|
48752
48770
|
trace(`${T$a} putElement`, { name, panel: !!panel });
|
|
48753
48771
|
if (panel) {
|
|
@@ -48766,6 +48784,9 @@ class MediaControl extends UICorePlugin {
|
|
|
48766
48784
|
return;
|
|
48767
48785
|
}
|
|
48768
48786
|
}
|
|
48787
|
+
putElement(name, element) {
|
|
48788
|
+
this.mount(name, element);
|
|
48789
|
+
}
|
|
48769
48790
|
/**
|
|
48770
48791
|
* Toggle the visibility of a media control element
|
|
48771
48792
|
* @param name - The name of the media control element
|
|
@@ -48815,11 +48836,11 @@ class MediaControl extends UICorePlugin {
|
|
|
48815
48836
|
if (!this.settings.seekEnabled) {
|
|
48816
48837
|
return;
|
|
48817
48838
|
}
|
|
48818
|
-
const currentTime = this.
|
|
48819
|
-
const duration = this.
|
|
48839
|
+
const currentTime = this.core.activeContainer.getCurrentTime();
|
|
48840
|
+
const duration = this.core.activeContainer.getDuration();
|
|
48820
48841
|
let position = Math.min(Math.max(currentTime + delta, 0), duration);
|
|
48821
48842
|
position = Math.min((position * 100) / duration, 100);
|
|
48822
|
-
this.
|
|
48843
|
+
this.core.activeContainer.seekPercentage(position);
|
|
48823
48844
|
}
|
|
48824
48845
|
bindKeyAndShow(key, callback) {
|
|
48825
48846
|
// TODO or boolean return type
|
|
@@ -48937,7 +48958,10 @@ class MediaControl extends UICorePlugin {
|
|
|
48937
48958
|
* @internal
|
|
48938
48959
|
*/
|
|
48939
48960
|
render() {
|
|
48940
|
-
trace(`${T$a} render`, {
|
|
48961
|
+
trace(`${T$a} render`, {
|
|
48962
|
+
needsUpdate: this.hasUpdate,
|
|
48963
|
+
metadataLoaded: this.metadataLoaded,
|
|
48964
|
+
});
|
|
48941
48965
|
if (!this.hasUpdate || !this.metadataLoaded) {
|
|
48942
48966
|
return this;
|
|
48943
48967
|
}
|
|
@@ -49093,8 +49117,7 @@ MediaControl.extend = function (properties) {
|
|
|
49093
49117
|
return extend(MediaControl, properties);
|
|
49094
49118
|
};
|
|
49095
49119
|
function serializeSettings(s) {
|
|
49096
|
-
return s.left
|
|
49097
|
-
.slice()
|
|
49120
|
+
return s.left.slice()
|
|
49098
49121
|
.sort()
|
|
49099
49122
|
.concat(s.right.slice().sort())
|
|
49100
49123
|
.concat(s.default.slice().sort())
|
|
@@ -49126,7 +49149,7 @@ class MultiCamera extends UICorePlugin {
|
|
|
49126
49149
|
return 'multicamera';
|
|
49127
49150
|
}
|
|
49128
49151
|
get supportedVersion() {
|
|
49129
|
-
return { min: CLAPPR_VERSION };
|
|
49152
|
+
return { min: CLAPPR_VERSION$1 };
|
|
49130
49153
|
}
|
|
49131
49154
|
static get version() {
|
|
49132
49155
|
return VERSION$4;
|
|
@@ -49486,7 +49509,7 @@ class PictureInPicture extends UICorePlugin {
|
|
|
49486
49509
|
* @internal
|
|
49487
49510
|
*/
|
|
49488
49511
|
get supportedVersion() {
|
|
49489
|
-
return { min: CLAPPR_VERSION };
|
|
49512
|
+
return { min: CLAPPR_VERSION$1 };
|
|
49490
49513
|
}
|
|
49491
49514
|
/**
|
|
49492
49515
|
* @internal
|
|
@@ -49633,7 +49656,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49633
49656
|
* @internal
|
|
49634
49657
|
*/
|
|
49635
49658
|
get supportedVersion() {
|
|
49636
|
-
return { min: CLAPPR_VERSION };
|
|
49659
|
+
return { min: CLAPPR_VERSION$1 };
|
|
49637
49660
|
}
|
|
49638
49661
|
static buttonTemplate = tmpl(buttonHtml$1);
|
|
49639
49662
|
static listTemplate = tmpl(listHtml$1);
|
|
@@ -49916,7 +49939,7 @@ class Poster extends UIContainerPlugin {
|
|
|
49916
49939
|
* @internal
|
|
49917
49940
|
*/
|
|
49918
49941
|
get supportedVersion() {
|
|
49919
|
-
return { min: CLAPPR_VERSION };
|
|
49942
|
+
return { min: CLAPPR_VERSION$1 };
|
|
49920
49943
|
}
|
|
49921
49944
|
static template = tmpl(posterHTML);
|
|
49922
49945
|
get shouldRender() {
|
|
@@ -50143,7 +50166,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50143
50166
|
|
|
50144
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";
|
|
50145
50168
|
|
|
50146
|
-
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";
|
|
50147
50170
|
|
|
50148
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";
|
|
50149
50172
|
|
|
@@ -50193,7 +50216,7 @@ class QualityLevels extends UICorePlugin {
|
|
|
50193
50216
|
* @internal
|
|
50194
50217
|
*/
|
|
50195
50218
|
get supportedVersion() {
|
|
50196
|
-
return { min: CLAPPR_VERSION };
|
|
50219
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50197
50220
|
}
|
|
50198
50221
|
/**
|
|
50199
50222
|
* @internal
|
|
@@ -50430,7 +50453,7 @@ class SeekTime extends UICorePlugin {
|
|
|
50430
50453
|
return 'seek_time';
|
|
50431
50454
|
}
|
|
50432
50455
|
get supportedVersion() {
|
|
50433
|
-
return { min: CLAPPR_VERSION };
|
|
50456
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50434
50457
|
}
|
|
50435
50458
|
get template() {
|
|
50436
50459
|
return tmpl(seekTimeHTML);
|
|
@@ -50592,7 +50615,7 @@ class Share extends UICorePlugin {
|
|
|
50592
50615
|
return 'share';
|
|
50593
50616
|
}
|
|
50594
50617
|
get supportedVersion() {
|
|
50595
|
-
return { min: CLAPPR_VERSION };
|
|
50618
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50596
50619
|
}
|
|
50597
50620
|
get template() {
|
|
50598
50621
|
return tmpl(pluginHtml$2);
|
|
@@ -50711,7 +50734,7 @@ class SkipTime extends UICorePlugin {
|
|
|
50711
50734
|
return 'skip_time';
|
|
50712
50735
|
}
|
|
50713
50736
|
get supportedVersion() {
|
|
50714
|
-
return { min: CLAPPR_VERSION };
|
|
50737
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50715
50738
|
}
|
|
50716
50739
|
get container() {
|
|
50717
50740
|
return this.core && this.core.activeContainer;
|
|
@@ -50830,7 +50853,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
50830
50853
|
* @internal
|
|
50831
50854
|
*/
|
|
50832
50855
|
get supportedVersion() {
|
|
50833
|
-
return { min: CLAPPR_VERSION };
|
|
50856
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50834
50857
|
}
|
|
50835
50858
|
/**
|
|
50836
50859
|
* @internal
|
|
@@ -51064,7 +51087,7 @@ class SourceController extends CorePlugin {
|
|
|
51064
51087
|
* @internal
|
|
51065
51088
|
*/
|
|
51066
51089
|
get supportedVersion() {
|
|
51067
|
-
return { min: CLAPPR_VERSION };
|
|
51090
|
+
return { min: CLAPPR_VERSION$1 };
|
|
51068
51091
|
}
|
|
51069
51092
|
/**
|
|
51070
51093
|
* @param core - The Clappr core instance.
|
|
@@ -51249,7 +51272,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51249
51272
|
* @internal
|
|
51250
51273
|
*/
|
|
51251
51274
|
get supportedVersion() {
|
|
51252
|
-
return { min: CLAPPR_VERSION };
|
|
51275
|
+
return { min: CLAPPR_VERSION$1 };
|
|
51253
51276
|
}
|
|
51254
51277
|
/**
|
|
51255
51278
|
* @internal
|
|
@@ -51595,7 +51618,7 @@ class Telemetry extends ContainerPlugin {
|
|
|
51595
51618
|
* The supported version of the plugin.
|
|
51596
51619
|
*/
|
|
51597
51620
|
get supportedVersion() {
|
|
51598
|
-
return { min: CLAPPR_VERSION };
|
|
51621
|
+
return { min: CLAPPR_VERSION$1 };
|
|
51599
51622
|
}
|
|
51600
51623
|
started = false;
|
|
51601
51624
|
timeStart = 0;
|
|
@@ -51882,7 +51905,7 @@ class Thumbnails extends UICorePlugin {
|
|
|
51882
51905
|
* @internal
|
|
51883
51906
|
*/
|
|
51884
51907
|
get supportedVersion() {
|
|
51885
|
-
return { min: CLAPPR_VERSION };
|
|
51908
|
+
return { min: CLAPPR_VERSION$1 };
|
|
51886
51909
|
}
|
|
51887
51910
|
/**
|
|
51888
51911
|
* @internal
|
|
@@ -52381,4 +52404,4 @@ class VolumeFade extends UICorePlugin {
|
|
|
52381
52404
|
}
|
|
52382
52405
|
}
|
|
52383
52406
|
|
|
52384
|
-
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 };
|