@gcorevideo/player 2.22.15 → 2.22.17
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 +6 -8
- package/dist/index.css +855 -855
- package/dist/index.js +609 -664
- package/dist/player.d.ts +426 -302
- package/dist/plugins/index.css +551 -551
- package/dist/plugins/index.js +648 -703
- package/docs/api/{player.audioselector.md → player.audiotracks.md} +3 -3
- package/docs/api/player.clapprstats.exportmetrics.md +1 -1
- package/docs/api/player.clapprstats.md +5 -15
- package/docs/api/player.clapprstatssettings.md +13 -0
- package/docs/api/{player.contextmenupluginsettings.preventshowcontextmenu.md → player.clips.destroy.md} +7 -3
- package/docs/api/{player.contextmenupluginsettings.label.md → player.clips.disable.md} +7 -3
- package/docs/api/player.clips.enable.md +18 -0
- package/docs/api/player.clips.md +170 -0
- package/docs/api/player.clips.render.md +18 -0
- package/docs/api/player.clips.supportedversion.md +16 -0
- package/docs/api/player.clips.version.md +14 -0
- package/docs/api/player.clipspluginsettings.md +2 -2
- package/docs/api/player.clipspluginsettings.text.md +1 -1
- package/docs/api/player.contextmenu.md +2 -0
- package/docs/api/player.contextmenupluginsettings.md +2 -40
- package/docs/api/{player.contextmenupluginsettings.url.md → player.contextmenupluginsettings.options.md} +3 -3
- package/docs/api/player.md +101 -37
- package/docs/api/player.mediacontrol.md +9 -15
- package/docs/api/{player.mediacontrol.getelement.md → player.mediacontrol.mount.md} +20 -7
- package/docs/api/player.mediacontrolelement.md +4 -2
- package/docs/api/player.mediacontrollayerelement.md +16 -0
- 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.menuoption.md +21 -0
- package/docs/api/{player.clapprnerdstats._constructor_.md → player.nerdstats._constructor_.md} +3 -3
- package/docs/api/{player.clapprnerdstats.md → player.nerdstats.md} +5 -5
- 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.qualitylevel.height.md +1 -1
- package/docs/api/player.qualitylevel.level.md +1 -1
- package/docs/api/player.qualitylevel.md +4 -4
- package/docs/api/player.qualitylevel.width.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/docs/api/player.timeposition.current.md +1 -1
- package/docs/api/player.timeposition.md +2 -2
- package/docs/api/player.timeposition.total.md +1 -1
- package/docs/api/player.timeprogress.md +6 -4
- package/docs/api/player.timevalue.md +1 -1
- package/lib/index.plugins.d.ts +2 -1
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +2 -1
- package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
- package/lib/playback/dash-playback/DashPlayback.js +5 -7
- package/lib/playback.types.d.ts +22 -9
- package/lib/playback.types.d.ts.map +1 -1
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +4 -0
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts.map +1 -1
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +20 -23
- package/lib/plugins/clappr-nerd-stats/NerdStats.d.ts +83 -0
- package/lib/plugins/clappr-nerd-stats/NerdStats.d.ts.map +1 -0
- package/lib/plugins/clappr-nerd-stats/NerdStats.js +339 -0
- package/lib/plugins/clappr-stats/ClapprStats.d.ts +27 -32
- package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
- package/lib/plugins/clappr-stats/ClapprStats.js +94 -202
- package/lib/plugins/clappr-stats/types.d.ts +65 -24
- package/lib/plugins/clappr-stats/types.d.ts.map +1 -1
- package/lib/plugins/clappr-stats/types.js +37 -2
- package/lib/plugins/clappr-stats/utils.d.ts.map +1 -1
- package/lib/plugins/clappr-stats/utils.js +1 -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 +2 -1
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +5 -7
- package/package.json +1 -1
- package/src/index.plugins.ts +2 -1
- package/src/playback/dash-playback/DashPlayback.ts +5 -8
- package/src/playback.types.ts +23 -8
- package/src/plugins/clappr-nerd-stats/{ClapprNerdStats.ts → NerdStats.ts} +25 -30
- package/src/plugins/clappr-stats/ClapprStats.ts +242 -306
- package/src/plugins/clappr-stats/__tests__/ClapprStats.test.ts +133 -0
- package/src/plugins/clappr-stats/types.ts +72 -25
- package/src/plugins/clappr-stats/utils.ts +1 -2
- 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/error-screen/__tests__/ErrorScreen.test.ts +3 -4
- 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/subtitles/__tests__/ClosedCaptions.test.ts +1 -0
- package/src/plugins/utils.ts +9 -7
- package/src/plugins/vast-ads/loaderxml.ts +2 -2
- package/src/testUtils.ts +5 -7
- package/temp/player.api.json +693 -471
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.clapprstats.setupdatemetrics.md +0 -56
- package/docs/api/player.clipsplugin.gettext.md +0 -58
- package/docs/api/player.clipsplugin.md +0 -59
- 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(),
|
|
@@ -13045,13 +13045,11 @@ class DashPlayback extends BasePlayback {
|
|
|
13045
13045
|
this.getPlaybackType() === Playback.LIVE);
|
|
13046
13046
|
}
|
|
13047
13047
|
_onProgress() {
|
|
13048
|
-
|
|
13049
|
-
|
|
13050
|
-
|
|
13051
|
-
|
|
13052
|
-
|
|
13053
|
-
buffer = this._dash.getDashMetrics().getCurrentBufferLevel('audio');
|
|
13054
|
-
}
|
|
13048
|
+
const buffer =
|
|
13049
|
+
// @ts-expect-error
|
|
13050
|
+
this._dash.getDashMetrics().getCurrentBufferLevel('video') ||
|
|
13051
|
+
// @ts-expect-error
|
|
13052
|
+
this._dash.getDashMetrics().getCurrentBufferLevel('audio');
|
|
13055
13053
|
const progress = {
|
|
13056
13054
|
start: this.getCurrentTime(),
|
|
13057
13055
|
current: this.getCurrentTime() + buffer,
|
|
@@ -13060,7 +13058,7 @@ class DashPlayback extends BasePlayback {
|
|
|
13060
13058
|
this.trigger(Events$1.PLAYBACK_PROGRESS, progress, {});
|
|
13061
13059
|
}
|
|
13062
13060
|
play() {
|
|
13063
|
-
trace(`${T$
|
|
13061
|
+
trace(`${T$l} play`, { dash: !!this._dash });
|
|
13064
13062
|
if (!this._dash) {
|
|
13065
13063
|
this._setup();
|
|
13066
13064
|
}
|
|
@@ -13146,7 +13144,7 @@ class DashPlayback extends BasePlayback {
|
|
|
13146
13144
|
}
|
|
13147
13145
|
// @ts-expect-error
|
|
13148
13146
|
get currentAudioTrack() {
|
|
13149
|
-
trace(`${T$
|
|
13147
|
+
trace(`${T$l} get currentAudioTrack`);
|
|
13150
13148
|
assert.ok(this._dash, 'DASH.js MediaPlayer is not initialized');
|
|
13151
13149
|
const t = this._dash.getCurrentTrackFor('audio');
|
|
13152
13150
|
if (!t) {
|
|
@@ -41837,7 +41835,7 @@ Hls.defaultConfig = undefined;
|
|
|
41837
41835
|
|
|
41838
41836
|
// assert(process.env.CLAPPR_VERSION, 'CLAPPR_VERSION is required');
|
|
41839
41837
|
// export const CLAPPR_VERSION: string = process.env.CLAPPR_VERSION || '0.11.3';
|
|
41840
|
-
const CLAPPR_VERSION = '0.11.3';
|
|
41838
|
+
const CLAPPR_VERSION$1 = '0.11.3';
|
|
41841
41839
|
|
|
41842
41840
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
41843
41841
|
// Use of this source code is governed by a BSD-style
|
|
@@ -41847,7 +41845,7 @@ const AUTO = -1;
|
|
|
41847
41845
|
const DEFAULT_RECOVER_ATTEMPTS = 16;
|
|
41848
41846
|
Events$1.register('PLAYBACK_FRAGMENT_CHANGED');
|
|
41849
41847
|
Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
|
|
41850
|
-
const T$
|
|
41848
|
+
const T$k = 'playback.hls';
|
|
41851
41849
|
class HlsPlayback extends BasePlayback {
|
|
41852
41850
|
_ccIsSetup = false;
|
|
41853
41851
|
_ccTracksUpdated = false;
|
|
@@ -41878,7 +41876,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
41878
41876
|
return 'hls';
|
|
41879
41877
|
}
|
|
41880
41878
|
get supportedVersion() {
|
|
41881
|
-
return { min: CLAPPR_VERSION };
|
|
41879
|
+
return { min: CLAPPR_VERSION$1 };
|
|
41882
41880
|
}
|
|
41883
41881
|
get levels() {
|
|
41884
41882
|
return this._levels || [];
|
|
@@ -42076,7 +42074,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42076
42074
|
maxBufferLength: 2,
|
|
42077
42075
|
maxMaxBufferLength: 4,
|
|
42078
42076
|
}, this.options.playback.hlsjsConfig);
|
|
42079
|
-
trace(`${T$
|
|
42077
|
+
trace(`${T$k} _createHLSInstance`, { config });
|
|
42080
42078
|
this._hls = new Hls(config);
|
|
42081
42079
|
}
|
|
42082
42080
|
_attachHLSMedia() {
|
|
@@ -42167,7 +42165,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42167
42165
|
}
|
|
42168
42166
|
else {
|
|
42169
42167
|
Log.error('hlsjs: failed to recover', { evt, data });
|
|
42170
|
-
trace(`${T$
|
|
42168
|
+
trace(`${T$k} _recover failed to recover`, {
|
|
42171
42169
|
type: data.type,
|
|
42172
42170
|
details: data.details,
|
|
42173
42171
|
});
|
|
@@ -42253,7 +42251,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42253
42251
|
this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
|
|
42254
42252
|
}
|
|
42255
42253
|
_onHLSJSError(evt, data) {
|
|
42256
|
-
trace(`${T$
|
|
42254
|
+
trace(`${T$k} _onHLSJSError`, {
|
|
42257
42255
|
fatal: data.fatal,
|
|
42258
42256
|
type: data.type,
|
|
42259
42257
|
details: data.details,
|
|
@@ -42301,7 +42299,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42301
42299
|
evt,
|
|
42302
42300
|
data,
|
|
42303
42301
|
});
|
|
42304
|
-
trace(`${T$
|
|
42302
|
+
trace(`${T$k} _onHLSJSError trying to recover from network error`, {
|
|
42305
42303
|
details: data.details,
|
|
42306
42304
|
});
|
|
42307
42305
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42314,7 +42312,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42314
42312
|
evt,
|
|
42315
42313
|
data,
|
|
42316
42314
|
});
|
|
42317
|
-
trace(`${T$
|
|
42315
|
+
trace(`${T$k} _onHLSJSError trying to recover from media error`, {
|
|
42318
42316
|
details: data.details,
|
|
42319
42317
|
});
|
|
42320
42318
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42344,7 +42342,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42344
42342
|
return;
|
|
42345
42343
|
}
|
|
42346
42344
|
Log.warn('hlsjs: non-fatal error occurred', { evt, data });
|
|
42347
|
-
trace(`${T$
|
|
42345
|
+
trace(`${T$k} _onHLSJSError non-fatal error occurred`, {
|
|
42348
42346
|
type: data.type,
|
|
42349
42347
|
details: data.details,
|
|
42350
42348
|
});
|
|
@@ -42679,11 +42677,11 @@ class HlsPlayback extends BasePlayback {
|
|
|
42679
42677
|
this._hls.audioTrack = Number(id); // TODO or find index by .id == id?
|
|
42680
42678
|
}
|
|
42681
42679
|
_onAudioTracksUpdated(_, data) {
|
|
42682
|
-
trace(`${T$
|
|
42680
|
+
trace(`${T$k} onAudioTracksUpdated`);
|
|
42683
42681
|
this.trigger(Events$1.PLAYBACK_AUDIO_AVAILABLE, data.audioTracks.map(toClapprTrack));
|
|
42684
42682
|
}
|
|
42685
42683
|
_onAudioTrackSwitched(_, data) {
|
|
42686
|
-
trace(`${T$
|
|
42684
|
+
trace(`${T$k} onAudioTrackSwitched`);
|
|
42687
42685
|
// @ts-ignore
|
|
42688
42686
|
const track = this._hls.audioTracks[data.id];
|
|
42689
42687
|
this.trigger(Events$1.PLAYBACK_AUDIO_CHANGED, toClapprTrack(track));
|
|
@@ -42704,7 +42702,7 @@ function toClapprTrack(t) {
|
|
|
42704
42702
|
};
|
|
42705
42703
|
}
|
|
42706
42704
|
|
|
42707
|
-
const T$
|
|
42705
|
+
const T$j = 'playback.html5_video';
|
|
42708
42706
|
const STALL_TIMEOUT = 15000;
|
|
42709
42707
|
class HTML5Video extends BasePlayback {
|
|
42710
42708
|
stallTimerId = null;
|
|
@@ -42712,7 +42710,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42712
42710
|
* @internal
|
|
42713
42711
|
*/
|
|
42714
42712
|
createError(errorData, options) {
|
|
42715
|
-
trace(`${T$
|
|
42713
|
+
trace(`${T$j} createError`, {
|
|
42716
42714
|
errorData: { ...errorData },
|
|
42717
42715
|
});
|
|
42718
42716
|
const i18n = this.i18n ||
|
|
@@ -42728,11 +42726,11 @@ class HTML5Video extends BasePlayback {
|
|
|
42728
42726
|
return super.createError(errorData, { ...options, useCodePrefix: false });
|
|
42729
42727
|
}
|
|
42730
42728
|
_onWaiting() {
|
|
42731
|
-
trace(`${T$
|
|
42729
|
+
trace(`${T$j} _onWaiting`);
|
|
42732
42730
|
super._onWaiting();
|
|
42733
42731
|
}
|
|
42734
42732
|
_onEnded() {
|
|
42735
|
-
trace(`${T$
|
|
42733
|
+
trace(`${T$j} _onEnded`);
|
|
42736
42734
|
if (this.stallTimerId) {
|
|
42737
42735
|
clearTimeout(this.stallTimerId);
|
|
42738
42736
|
this.stallTimerId = null;
|
|
@@ -42740,12 +42738,12 @@ class HTML5Video extends BasePlayback {
|
|
|
42740
42738
|
super._onEnded();
|
|
42741
42739
|
}
|
|
42742
42740
|
_handleBufferingEvents() {
|
|
42743
|
-
trace(`${T$
|
|
42741
|
+
trace(`${T$j} _handleBufferingEvents`, {
|
|
42744
42742
|
networkState: this.el.networkState,
|
|
42745
42743
|
});
|
|
42746
42744
|
if (!this.stallTimerId) {
|
|
42747
42745
|
this.stallTimerId = setTimeout(() => {
|
|
42748
|
-
trace(`${T$
|
|
42746
|
+
trace(`${T$j} _handleBufferingEvents stall timeout`, {
|
|
42749
42747
|
buffering: this.buffering,
|
|
42750
42748
|
ended: this.ended,
|
|
42751
42749
|
});
|
|
@@ -42763,7 +42761,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42763
42761
|
super._handleBufferingEvents();
|
|
42764
42762
|
}
|
|
42765
42763
|
_onPlaying() {
|
|
42766
|
-
trace(`${T$
|
|
42764
|
+
trace(`${T$j} _onPlaying`);
|
|
42767
42765
|
if (this.stallTimerId) {
|
|
42768
42766
|
clearTimeout(this.stallTimerId);
|
|
42769
42767
|
this.stallTimerId = null;
|
|
@@ -42771,7 +42769,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42771
42769
|
super._onPlaying();
|
|
42772
42770
|
}
|
|
42773
42771
|
_onPause() {
|
|
42774
|
-
trace(`${T$
|
|
42772
|
+
trace(`${T$j} _onPause`);
|
|
42775
42773
|
super._onPause();
|
|
42776
42774
|
if (this.stallTimerId) {
|
|
42777
42775
|
clearTimeout(this.stallTimerId);
|
|
@@ -42781,7 +42779,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42781
42779
|
get audioTracks() {
|
|
42782
42780
|
const tracks = this.el.audioTracks;
|
|
42783
42781
|
const supported = !!tracks;
|
|
42784
|
-
trace(`${T$
|
|
42782
|
+
trace(`${T$j} get audioTracks`, { supported });
|
|
42785
42783
|
const retval = [];
|
|
42786
42784
|
if (supported) {
|
|
42787
42785
|
for (let i = 0; i < tracks.length; i++) {
|
|
@@ -42800,7 +42798,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42800
42798
|
get currentAudioTrack() {
|
|
42801
42799
|
const tracks = this.el.audioTracks;
|
|
42802
42800
|
const supported = !!tracks;
|
|
42803
|
-
trace(`${T$
|
|
42801
|
+
trace(`${T$j} get currentAudioTrack`, {
|
|
42804
42802
|
supported,
|
|
42805
42803
|
});
|
|
42806
42804
|
if (supported) {
|
|
@@ -42821,7 +42819,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42821
42819
|
switchAudioTrack(id) {
|
|
42822
42820
|
const tracks = this.el.audioTracks;
|
|
42823
42821
|
const supported = !!tracks;
|
|
42824
|
-
trace(`${T$
|
|
42822
|
+
trace(`${T$j} switchAudioTrack`, {
|
|
42825
42823
|
supported,
|
|
42826
42824
|
});
|
|
42827
42825
|
if (supported) {
|
|
@@ -42840,7 +42838,7 @@ function registerPlaybacks() {
|
|
|
42840
42838
|
Loader.registerPlayback(DashPlayback);
|
|
42841
42839
|
}
|
|
42842
42840
|
|
|
42843
|
-
const T$
|
|
42841
|
+
const T$i = 'GPlayer';
|
|
42844
42842
|
const DEFAULT_OPTIONS = {
|
|
42845
42843
|
autoPlay: false,
|
|
42846
42844
|
debug: 'none',
|
|
@@ -42928,7 +42926,7 @@ class Player {
|
|
|
42928
42926
|
* ```
|
|
42929
42927
|
*/
|
|
42930
42928
|
attachTo(playerElement) {
|
|
42931
|
-
trace(`${T$
|
|
42929
|
+
trace(`${T$i} attachTo`, {
|
|
42932
42930
|
player: !!this.player,
|
|
42933
42931
|
});
|
|
42934
42932
|
assert.ok(!this.player, 'Player already initialized');
|
|
@@ -42938,7 +42936,7 @@ class Player {
|
|
|
42938
42936
|
}
|
|
42939
42937
|
const coreOpts = this.buildCoreOptions(playerElement);
|
|
42940
42938
|
const { core, container } = Player.getRegisteredPlugins();
|
|
42941
|
-
trace(`${T$
|
|
42939
|
+
trace(`${T$i} init`, {
|
|
42942
42940
|
registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.prototype.name),
|
|
42943
42941
|
});
|
|
42944
42942
|
coreOpts.plugins = {
|
|
@@ -42952,7 +42950,7 @@ class Player {
|
|
|
42952
42950
|
* Destroys the player, releasing all resources and unmounting its UI from the DOM.
|
|
42953
42951
|
*/
|
|
42954
42952
|
destroy() {
|
|
42955
|
-
trace(`${T$
|
|
42953
|
+
trace(`${T$i} destroy`, {
|
|
42956
42954
|
player: !!this.player,
|
|
42957
42955
|
});
|
|
42958
42956
|
if (this.player) {
|
|
@@ -43139,7 +43137,7 @@ class Player {
|
|
|
43139
43137
|
this.config = $.extend(true, this.config, config);
|
|
43140
43138
|
}
|
|
43141
43139
|
initPlayer(coreOptions) {
|
|
43142
|
-
trace(`${T$
|
|
43140
|
+
trace(`${T$i} initPlayer`, {
|
|
43143
43141
|
autoPlay: coreOptions.autoPlay,
|
|
43144
43142
|
sources: coreOptions.sources,
|
|
43145
43143
|
player: !!this.player,
|
|
@@ -43164,7 +43162,7 @@ class Player {
|
|
|
43164
43162
|
}
|
|
43165
43163
|
}
|
|
43166
43164
|
triggerAutoPlay() {
|
|
43167
|
-
trace(`${T$
|
|
43165
|
+
trace(`${T$i} triggerAutoPlay`);
|
|
43168
43166
|
setTimeout(() => {
|
|
43169
43167
|
this.player?.play({
|
|
43170
43168
|
autoPlay: true,
|
|
@@ -43182,7 +43180,7 @@ class Player {
|
|
|
43182
43180
|
// TODO test
|
|
43183
43181
|
events = {
|
|
43184
43182
|
onReady: () => {
|
|
43185
|
-
trace(`${T$
|
|
43183
|
+
trace(`${T$i} onReady`, {
|
|
43186
43184
|
ready: this.ready,
|
|
43187
43185
|
});
|
|
43188
43186
|
if (this.ready) {
|
|
@@ -43216,7 +43214,7 @@ class Player {
|
|
|
43216
43214
|
buildCoreOptions(rootNode) {
|
|
43217
43215
|
const sources = this.buildMediaSourcesList();
|
|
43218
43216
|
const source = sources[0];
|
|
43219
|
-
trace(`${T$
|
|
43217
|
+
trace(`${T$i} buildCoreOptions`, {
|
|
43220
43218
|
source,
|
|
43221
43219
|
sources,
|
|
43222
43220
|
});
|
|
@@ -43277,7 +43275,7 @@ class Player {
|
|
|
43277
43275
|
assert.ok(this.player, 'Player is not initialized');
|
|
43278
43276
|
const core = this.player.core;
|
|
43279
43277
|
core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
|
|
43280
|
-
trace(`${T$
|
|
43278
|
+
trace(`${T$i} on CORE_SCREEN_ORIENTATION_CHANGED`, {
|
|
43281
43279
|
orientation,
|
|
43282
43280
|
rootNode: {
|
|
43283
43281
|
width: this.rootNode?.clientWidth,
|
|
@@ -43292,14 +43290,14 @@ class Player {
|
|
|
43292
43290
|
}
|
|
43293
43291
|
}, null);
|
|
43294
43292
|
core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
|
|
43295
|
-
trace(`${T$
|
|
43293
|
+
trace(`${T$i} on CORE_RESIZE`, {
|
|
43296
43294
|
width,
|
|
43297
43295
|
height,
|
|
43298
43296
|
});
|
|
43299
43297
|
this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
|
|
43300
43298
|
}, null);
|
|
43301
43299
|
core.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
|
|
43302
|
-
trace(`${T$
|
|
43300
|
+
trace(`${T$i} CORE_FULLSCREEN`, {
|
|
43303
43301
|
isFullscreen,
|
|
43304
43302
|
});
|
|
43305
43303
|
this.safeTriggerEvent(PlayerEvent.Fullscreen, isFullscreen);
|
|
@@ -43307,7 +43305,7 @@ class Player {
|
|
|
43307
43305
|
}
|
|
43308
43306
|
}
|
|
43309
43307
|
|
|
43310
|
-
var version$1 = "2.22.
|
|
43308
|
+
var version$1 = "2.22.17";
|
|
43311
43309
|
|
|
43312
43310
|
var packages = {
|
|
43313
43311
|
"node_modules/@clappr/core": {
|
|
@@ -43335,7 +43333,7 @@ const pluginHtml$7 = "<button data-audiotracks-button class='gcore-skin-button-c
|
|
|
43335
43333
|
|
|
43336
43334
|
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
43335
|
|
|
43338
|
-
const VERSION$
|
|
43336
|
+
const VERSION$7 = '2.22.4';
|
|
43339
43337
|
// const T = 'plugins.audiotracks'
|
|
43340
43338
|
/**
|
|
43341
43339
|
* `PLUGIN` that makes possible to switch audio tracks via the media control UI.
|
|
@@ -43360,13 +43358,13 @@ class AudioTracks extends UICorePlugin {
|
|
|
43360
43358
|
* @internal
|
|
43361
43359
|
*/
|
|
43362
43360
|
get supportedVersion() {
|
|
43363
|
-
return { min: CLAPPR_VERSION };
|
|
43361
|
+
return { min: CLAPPR_VERSION$1 };
|
|
43364
43362
|
}
|
|
43365
43363
|
/**
|
|
43366
43364
|
* @internal
|
|
43367
43365
|
*/
|
|
43368
43366
|
static get version() {
|
|
43369
|
-
return VERSION$
|
|
43367
|
+
return VERSION$7;
|
|
43370
43368
|
}
|
|
43371
43369
|
static template = tmpl(pluginHtml$7);
|
|
43372
43370
|
/**
|
|
@@ -43499,7 +43497,7 @@ const volumeOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
|
|
|
43499
43497
|
|
|
43500
43498
|
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
43499
|
|
|
43502
|
-
const T$
|
|
43500
|
+
const T$h = 'plugins.big_mute_button';
|
|
43503
43501
|
// TODO rewrite as a container plugin
|
|
43504
43502
|
/**
|
|
43505
43503
|
* `PLUGIN` that displays a big mute button over the video when it's muted.
|
|
@@ -43521,7 +43519,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43521
43519
|
* @internal
|
|
43522
43520
|
*/
|
|
43523
43521
|
get supportedVersion() {
|
|
43524
|
-
return { min: CLAPPR_VERSION };
|
|
43522
|
+
return { min: CLAPPR_VERSION$1 };
|
|
43525
43523
|
}
|
|
43526
43524
|
static template = tmpl(pluginHtml$6);
|
|
43527
43525
|
/**
|
|
@@ -43540,7 +43538,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43540
43538
|
this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
43541
43539
|
this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
|
|
43542
43540
|
this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
|
|
43543
|
-
trace(`${T$
|
|
43541
|
+
trace(`${T$h} bindEvents`, {
|
|
43544
43542
|
mediacontrol: !!this.core.mediaControl,
|
|
43545
43543
|
});
|
|
43546
43544
|
this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
|
|
@@ -43565,12 +43563,12 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43565
43563
|
}
|
|
43566
43564
|
mediaControlRendered() {
|
|
43567
43565
|
const container = this.core.activeContainer;
|
|
43568
|
-
trace(`${T$
|
|
43566
|
+
trace(`${T$h} mediaControlRendered`, {
|
|
43569
43567
|
container: !!container,
|
|
43570
43568
|
});
|
|
43571
43569
|
if (container) {
|
|
43572
43570
|
this.listenTo(container.playback, Events$1.PLAYBACK_PLAY, () => {
|
|
43573
|
-
trace(`${T$
|
|
43571
|
+
trace(`${T$h} PLAYBACK_PLAY`);
|
|
43574
43572
|
this.render();
|
|
43575
43573
|
});
|
|
43576
43574
|
}
|
|
@@ -43594,7 +43592,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43594
43592
|
}
|
|
43595
43593
|
const { autoPlay, wasMuted } = this.options;
|
|
43596
43594
|
const volume = container.volume;
|
|
43597
|
-
trace(`${T$
|
|
43595
|
+
trace(`${T$h} shouldRender`, {
|
|
43598
43596
|
autoPlay,
|
|
43599
43597
|
wasMuted,
|
|
43600
43598
|
volume,
|
|
@@ -43606,7 +43604,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43606
43604
|
*/
|
|
43607
43605
|
render() {
|
|
43608
43606
|
if (this.shouldRender()) {
|
|
43609
|
-
trace(`${T$
|
|
43607
|
+
trace(`${T$h} render`, {
|
|
43610
43608
|
el: !!this.$el,
|
|
43611
43609
|
});
|
|
43612
43610
|
this.$el.html(BigMuteButton.template());
|
|
@@ -43651,8 +43649,8 @@ const gearIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"n
|
|
|
43651
43649
|
|
|
43652
43650
|
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
43651
|
|
|
43654
|
-
const VERSION$
|
|
43655
|
-
const T$
|
|
43652
|
+
const VERSION$6 = '2.19.12';
|
|
43653
|
+
const T$g = 'plugins.bottom_gear';
|
|
43656
43654
|
/**
|
|
43657
43655
|
* Events triggered by the plugin
|
|
43658
43656
|
* @beta
|
|
@@ -43745,13 +43743,13 @@ class BottomGear extends UICorePlugin {
|
|
|
43745
43743
|
* @internal
|
|
43746
43744
|
*/
|
|
43747
43745
|
get supportedVersion() {
|
|
43748
|
-
return { min: CLAPPR_VERSION };
|
|
43746
|
+
return { min: CLAPPR_VERSION$1 };
|
|
43749
43747
|
}
|
|
43750
43748
|
/**
|
|
43751
43749
|
* @internal
|
|
43752
43750
|
*/
|
|
43753
43751
|
static get version() {
|
|
43754
|
-
return VERSION$
|
|
43752
|
+
return VERSION$6;
|
|
43755
43753
|
}
|
|
43756
43754
|
static template = tmpl(pluginHtml$5);
|
|
43757
43755
|
/**
|
|
@@ -43802,20 +43800,20 @@ class BottomGear extends UICorePlugin {
|
|
|
43802
43800
|
addItem(name, $subMenu) {
|
|
43803
43801
|
const $existingItem = this.$el.find(`#gear-options li[data-${name}`);
|
|
43804
43802
|
if ($existingItem.length) {
|
|
43805
|
-
trace(`${T$
|
|
43803
|
+
trace(`${T$g} addItem already exists`, { name });
|
|
43806
43804
|
return $existingItem;
|
|
43807
43805
|
}
|
|
43808
43806
|
const $item = $('<li></li>')
|
|
43809
43807
|
.attr(`data-${name}`, '')
|
|
43810
43808
|
.appendTo(this.$el.find('#gear-options'));
|
|
43811
43809
|
if ($subMenu) {
|
|
43812
|
-
trace(`${T$
|
|
43810
|
+
trace(`${T$g} addItem adding submenu`, { name });
|
|
43813
43811
|
$subMenu
|
|
43814
43812
|
.addClass('gear-sub-menu-wrapper')
|
|
43815
43813
|
.hide()
|
|
43816
43814
|
.appendTo(this.$el.find('#gear-options-wrapper'));
|
|
43817
43815
|
$item.on('click', (e) => {
|
|
43818
|
-
trace(`${T$
|
|
43816
|
+
trace(`${T$g} addItem submenu clicked`, { name });
|
|
43819
43817
|
e.stopPropagation();
|
|
43820
43818
|
$subMenu.show();
|
|
43821
43819
|
this.$el.find('#gear-options').hide();
|
|
@@ -43824,15 +43822,15 @@ class BottomGear extends UICorePlugin {
|
|
|
43824
43822
|
return $item;
|
|
43825
43823
|
}
|
|
43826
43824
|
onActiveContainerChanged() {
|
|
43827
|
-
trace(`${T$
|
|
43825
|
+
trace(`${T$g} onActiveContainerChanged`);
|
|
43828
43826
|
this.bindContainerEvents();
|
|
43829
43827
|
}
|
|
43830
43828
|
bindContainerEvents() {
|
|
43831
|
-
trace(`${T$
|
|
43829
|
+
trace(`${T$g} bindContainerEvents`);
|
|
43832
43830
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
|
|
43833
43831
|
}
|
|
43834
43832
|
highDefinitionUpdate(isHd) {
|
|
43835
|
-
trace(`${T$
|
|
43833
|
+
trace(`${T$g} highDefinitionUpdate`, { isHd });
|
|
43836
43834
|
this.isHd = isHd;
|
|
43837
43835
|
this.$el.find('.gear-icon').html(isHd ? gearHdIcon : gearIcon);
|
|
43838
43836
|
}
|
|
@@ -43840,7 +43838,7 @@ class BottomGear extends UICorePlugin {
|
|
|
43840
43838
|
* @internal
|
|
43841
43839
|
*/
|
|
43842
43840
|
render() {
|
|
43843
|
-
trace(`${T$
|
|
43841
|
+
trace(`${T$g} render`);
|
|
43844
43842
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43845
43843
|
if (!mediaControl) {
|
|
43846
43844
|
return this; // TODO test
|
|
@@ -43872,19 +43870,352 @@ class BottomGear extends UICorePlugin {
|
|
|
43872
43870
|
this.$el.find('#gear-options-wrapper').hide();
|
|
43873
43871
|
}
|
|
43874
43872
|
onCoreReady() {
|
|
43875
|
-
trace(`${T$
|
|
43873
|
+
trace(`${T$g} onCoreReady`);
|
|
43876
43874
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43877
43875
|
assert(mediaControl, 'media_control plugin is required');
|
|
43878
43876
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMediaControlRendered);
|
|
43879
43877
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.hide);
|
|
43880
43878
|
}
|
|
43881
43879
|
onMediaControlRendered() {
|
|
43882
|
-
trace(`${T$
|
|
43880
|
+
trace(`${T$g} onMediaControlRendered`);
|
|
43883
43881
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43884
43882
|
mediaControl.putElement('gear', this.$el);
|
|
43885
43883
|
}
|
|
43886
43884
|
}
|
|
43887
43885
|
|
|
43886
|
+
/**
|
|
43887
|
+
* @beta
|
|
43888
|
+
*/
|
|
43889
|
+
var Chronograph;
|
|
43890
|
+
(function (Chronograph) {
|
|
43891
|
+
Chronograph["Startup"] = "startup";
|
|
43892
|
+
Chronograph["Watch"] = "watch";
|
|
43893
|
+
Chronograph["Pause"] = "pause";
|
|
43894
|
+
Chronograph["Buffering"] = "buffering";
|
|
43895
|
+
Chronograph["Session"] = "session";
|
|
43896
|
+
// Latency = 'latency',
|
|
43897
|
+
})(Chronograph || (Chronograph = {}));
|
|
43898
|
+
/**
|
|
43899
|
+
* @beta
|
|
43900
|
+
*/
|
|
43901
|
+
var Counter;
|
|
43902
|
+
(function (Counter) {
|
|
43903
|
+
Counter["Play"] = "play";
|
|
43904
|
+
Counter["Pause"] = "pause";
|
|
43905
|
+
Counter["Error"] = "error";
|
|
43906
|
+
Counter["Buffering"] = "buffering";
|
|
43907
|
+
Counter["DecodedFrames"] = "decodedFrames";
|
|
43908
|
+
Counter["DroppedFrames"] = "droppedFrames";
|
|
43909
|
+
Counter["Fps"] = "fps";
|
|
43910
|
+
Counter["ChangeLevel"] = "changeLevel";
|
|
43911
|
+
Counter["Seek"] = "seek";
|
|
43912
|
+
Counter["Fullscreen"] = "fullscreen";
|
|
43913
|
+
Counter["DvrUsage"] = "dvrUsage";
|
|
43914
|
+
})(Counter || (Counter = {}));
|
|
43915
|
+
/**
|
|
43916
|
+
* @beta
|
|
43917
|
+
*/
|
|
43918
|
+
var ClapprStatsEvents;
|
|
43919
|
+
(function (ClapprStatsEvents) {
|
|
43920
|
+
/**
|
|
43921
|
+
* Emitted periodically with current measurements.
|
|
43922
|
+
*/
|
|
43923
|
+
ClapprStatsEvents["REPORT"] = "clappr:stats:report";
|
|
43924
|
+
/**
|
|
43925
|
+
* Emitted when the playback reaches a certain percentage of the total duration.
|
|
43926
|
+
*/
|
|
43927
|
+
// PERCENTAGE = 'clappr:stats:percentage',
|
|
43928
|
+
})(ClapprStatsEvents || (ClapprStatsEvents = {}));
|
|
43929
|
+
|
|
43930
|
+
function newMetrics$1() {
|
|
43931
|
+
return {
|
|
43932
|
+
counters: {
|
|
43933
|
+
play: 0,
|
|
43934
|
+
pause: 0,
|
|
43935
|
+
error: 0,
|
|
43936
|
+
buffering: 0,
|
|
43937
|
+
decodedFrames: 0,
|
|
43938
|
+
droppedFrames: 0,
|
|
43939
|
+
fps: 0,
|
|
43940
|
+
changeLevel: 0,
|
|
43941
|
+
seek: 0,
|
|
43942
|
+
fullscreen: 0,
|
|
43943
|
+
dvrUsage: 0,
|
|
43944
|
+
},
|
|
43945
|
+
chrono: {
|
|
43946
|
+
startup: 0,
|
|
43947
|
+
watch: 0,
|
|
43948
|
+
pause: 0,
|
|
43949
|
+
buffering: 0,
|
|
43950
|
+
session: 0,
|
|
43951
|
+
},
|
|
43952
|
+
extra: {
|
|
43953
|
+
playbackName: '',
|
|
43954
|
+
playbackType: '',
|
|
43955
|
+
bitratesHistory: [],
|
|
43956
|
+
bitrateWeightedMean: 0,
|
|
43957
|
+
bitrateMostUsed: 0,
|
|
43958
|
+
buffersize: 0,
|
|
43959
|
+
watchHistory: [],
|
|
43960
|
+
watchedPercentage: 0,
|
|
43961
|
+
bufferingPercentage: 0,
|
|
43962
|
+
bandwidth: 0,
|
|
43963
|
+
duration: 0,
|
|
43964
|
+
currentTime: 0,
|
|
43965
|
+
},
|
|
43966
|
+
custom: {},
|
|
43967
|
+
};
|
|
43968
|
+
}
|
|
43969
|
+
|
|
43970
|
+
/**
|
|
43971
|
+
* `PLUGIN` that measures data about playback, which can be useful for analyzing performance and UX.
|
|
43972
|
+
* @beta
|
|
43973
|
+
* @remarks
|
|
43974
|
+
* This plugin does not render anything and is supposed to be extended or used together with other plugins that actually render something.
|
|
43975
|
+
*
|
|
43976
|
+
* Configuration options - {@link ClapprStatsSettings}
|
|
43977
|
+
*
|
|
43978
|
+
* Events - {@link ClapprStatsEvents}
|
|
43979
|
+
*/
|
|
43980
|
+
class ClapprStats extends ContainerPlugin {
|
|
43981
|
+
timerId = null;
|
|
43982
|
+
lastDecodedFramesCount = 0;
|
|
43983
|
+
metrics = newMetrics$1();
|
|
43984
|
+
timers = {
|
|
43985
|
+
[Chronograph.Startup]: 0,
|
|
43986
|
+
[Chronograph.Watch]: 0,
|
|
43987
|
+
[Chronograph.Pause]: 0,
|
|
43988
|
+
[Chronograph.Buffering]: 0,
|
|
43989
|
+
[Chronograph.Session]: 0,
|
|
43990
|
+
};
|
|
43991
|
+
runEach;
|
|
43992
|
+
/**
|
|
43993
|
+
* @internal
|
|
43994
|
+
*/
|
|
43995
|
+
get name() {
|
|
43996
|
+
return 'clappr_stats';
|
|
43997
|
+
}
|
|
43998
|
+
/**
|
|
43999
|
+
* @internal
|
|
44000
|
+
*/
|
|
44001
|
+
get supportedVersion() {
|
|
44002
|
+
return { min: CLAPPR_VERSION$1 };
|
|
44003
|
+
}
|
|
44004
|
+
get playbackName() {
|
|
44005
|
+
return String(this.container.playback.name || '');
|
|
44006
|
+
}
|
|
44007
|
+
get playbackType() {
|
|
44008
|
+
return this.container.getPlaybackType();
|
|
44009
|
+
}
|
|
44010
|
+
now() {
|
|
44011
|
+
const hasPerformanceSupport = window.performance && typeof window.performance.now === 'function';
|
|
44012
|
+
return hasPerformanceSupport
|
|
44013
|
+
? window.performance.now()
|
|
44014
|
+
: new Date().getTime();
|
|
44015
|
+
}
|
|
44016
|
+
inc(counter) {
|
|
44017
|
+
this.metrics.counters[counter] += 1;
|
|
44018
|
+
}
|
|
44019
|
+
// _timerHasStarted(timer) {
|
|
44020
|
+
// return this[`_start${timer}`] !== undefined;
|
|
44021
|
+
// }
|
|
44022
|
+
start(timer) {
|
|
44023
|
+
// this[`_start${timer}`] = this._now();
|
|
44024
|
+
this.timers[timer] = this.now();
|
|
44025
|
+
}
|
|
44026
|
+
stop(timer) {
|
|
44027
|
+
// this._metrics.timers[timer] += this._now() - this[`_start${timer}`];
|
|
44028
|
+
this.metrics.chrono[timer] += this.now() - this.timers[timer];
|
|
44029
|
+
}
|
|
44030
|
+
constructor(container) {
|
|
44031
|
+
super(container);
|
|
44032
|
+
this.runEach = container.options.clapprStats?.runEach ?? 5000;
|
|
44033
|
+
}
|
|
44034
|
+
/**
|
|
44035
|
+
* @internal
|
|
44036
|
+
*/
|
|
44037
|
+
bindEvents() {
|
|
44038
|
+
this.listenTo(this.container, Events$1.CONTAINER_BITRATE, this.onBitrate);
|
|
44039
|
+
this.listenTo(this.container, Events$1.CONTAINER_STOP, this.stopReporting);
|
|
44040
|
+
this.listenTo(this.container, Events$1.CONTAINER_ENDED, this.stopReporting);
|
|
44041
|
+
this.listenToOnce(this.container.playback, Events$1.PLAYBACK_PLAY_INTENT, this.startTimers);
|
|
44042
|
+
this.listenToOnce(this.container, Events$1.CONTAINER_PLAY, this.onFirstPlaying);
|
|
44043
|
+
this.listenTo(this.container, Events$1.CONTAINER_PLAY, this.onPlay);
|
|
44044
|
+
this.listenTo(this.container, Events$1.CONTAINER_PAUSE, this.onPause);
|
|
44045
|
+
this.listenToOnce(this.container, Events$1.CONTAINER_STATE_BUFFERING, this.onBuffering);
|
|
44046
|
+
this.listenTo(this.container, Events$1.CONTAINER_SEEK, this.onSeek);
|
|
44047
|
+
this.listenTo(this.container, Events$1.CONTAINER_ERROR, () => this.inc(Counter.Error));
|
|
44048
|
+
this.listenTo(this.container, Events$1.CONTAINER_FULLSCREEN, () => this.inc(Counter.Fullscreen));
|
|
44049
|
+
this.listenTo(this.container, Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, (dvrInUse) => {
|
|
44050
|
+
dvrInUse && this.inc(Counter.DvrUsage);
|
|
44051
|
+
});
|
|
44052
|
+
this.listenTo(this.container.playback, Events$1.PLAYBACK_PROGRESS, this.onProgress);
|
|
44053
|
+
this.listenTo(this.container.playback, Events$1.PLAYBACK_TIMEUPDATE, this.onTimeUpdate);
|
|
44054
|
+
}
|
|
44055
|
+
/**
|
|
44056
|
+
* @internal
|
|
44057
|
+
*/
|
|
44058
|
+
destroy() {
|
|
44059
|
+
this.stopReporting();
|
|
44060
|
+
super.destroy();
|
|
44061
|
+
}
|
|
44062
|
+
/**
|
|
44063
|
+
* Returns the collected metrics.
|
|
44064
|
+
* @returns Measurements collected so far
|
|
44065
|
+
*/
|
|
44066
|
+
exportMetrics() {
|
|
44067
|
+
return structuredClone(this.metrics);
|
|
44068
|
+
}
|
|
44069
|
+
onBitrate(newBitrate) {
|
|
44070
|
+
const bitrate = newBitrate.bitrate;
|
|
44071
|
+
const now = this.now();
|
|
44072
|
+
if (this.metrics.extra.bitratesHistory.length > 0) {
|
|
44073
|
+
const last = this.metrics.extra.bitratesHistory[this.metrics.extra.bitratesHistory.length - 1];
|
|
44074
|
+
last.end = now;
|
|
44075
|
+
last.time = now - last.start;
|
|
44076
|
+
}
|
|
44077
|
+
this.metrics.extra.bitratesHistory.push({ start: this.now(), bitrate });
|
|
44078
|
+
this.inc(Counter.ChangeLevel);
|
|
44079
|
+
}
|
|
44080
|
+
stopReporting() {
|
|
44081
|
+
this.buildReport();
|
|
44082
|
+
if (this.timerId !== null) {
|
|
44083
|
+
clearInterval(this.timerId);
|
|
44084
|
+
this.timerId = null;
|
|
44085
|
+
}
|
|
44086
|
+
}
|
|
44087
|
+
startTimers() {
|
|
44088
|
+
this.timerId = setInterval(this.buildReport.bind(this), this.runEach);
|
|
44089
|
+
this.start(Chronograph.Session);
|
|
44090
|
+
this.start(Chronograph.Startup);
|
|
44091
|
+
}
|
|
44092
|
+
onFirstPlaying() {
|
|
44093
|
+
this.listenTo(this.container, Events$1.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
44094
|
+
this.start(Chronograph.Watch);
|
|
44095
|
+
this.stop(Chronograph.Startup);
|
|
44096
|
+
}
|
|
44097
|
+
playAfterPause() {
|
|
44098
|
+
this.listenTo(this.container, Events$1.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
44099
|
+
this.stop(Chronograph.Pause);
|
|
44100
|
+
this.start(Chronograph.Watch);
|
|
44101
|
+
}
|
|
44102
|
+
onPlay() {
|
|
44103
|
+
this.inc(Counter.Play);
|
|
44104
|
+
}
|
|
44105
|
+
onPause() {
|
|
44106
|
+
this.stop(Chronograph.Watch);
|
|
44107
|
+
this.start(Chronograph.Pause);
|
|
44108
|
+
this.inc(Counter.Pause);
|
|
44109
|
+
this.listenToOnce(this.container, Events$1.CONTAINER_PLAY, this.playAfterPause);
|
|
44110
|
+
this.stopListening(this.container, Events$1.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
44111
|
+
}
|
|
44112
|
+
onSeek(e) {
|
|
44113
|
+
this.inc(Counter.Seek);
|
|
44114
|
+
this.metrics.extra.watchHistory.push([e * 1000, e * 1000]);
|
|
44115
|
+
}
|
|
44116
|
+
onTimeUpdate(e) {
|
|
44117
|
+
const current = e.current * 1000, total = e.total * 1000, l = this.metrics.extra.watchHistory.length;
|
|
44118
|
+
this.metrics.extra.duration = total;
|
|
44119
|
+
this.metrics.extra.currentTime = current;
|
|
44120
|
+
// TODO what if it's a live stream?
|
|
44121
|
+
this.metrics.extra.watchedPercentage = (current / total) * 100;
|
|
44122
|
+
if (l === 0) {
|
|
44123
|
+
this.metrics.extra.watchHistory.push([current, current]);
|
|
44124
|
+
}
|
|
44125
|
+
else {
|
|
44126
|
+
this.metrics.extra.watchHistory[l - 1][1] = current;
|
|
44127
|
+
}
|
|
44128
|
+
if (this.metrics.extra.bitratesHistory.length > 0) {
|
|
44129
|
+
const lastBitrate = this.metrics.extra.bitratesHistory[this.metrics.extra.bitratesHistory.length - 1];
|
|
44130
|
+
if (!lastBitrate.end) {
|
|
44131
|
+
lastBitrate.time = this.now() - lastBitrate.start;
|
|
44132
|
+
}
|
|
44133
|
+
}
|
|
44134
|
+
this.onCompletion();
|
|
44135
|
+
}
|
|
44136
|
+
onContainerUpdateWhilePlaying() {
|
|
44137
|
+
if (this.container.playback.isPlaying()) {
|
|
44138
|
+
this.stop(Chronograph.Watch);
|
|
44139
|
+
this.start(Chronograph.Watch);
|
|
44140
|
+
}
|
|
44141
|
+
}
|
|
44142
|
+
onBuffering() {
|
|
44143
|
+
this.inc(Counter.Buffering);
|
|
44144
|
+
this.start(Chronograph.Buffering);
|
|
44145
|
+
this.listenToOnce(this.container, Events$1.CONTAINER_STATE_BUFFERFULL, this.onBufferfull);
|
|
44146
|
+
}
|
|
44147
|
+
onBufferfull() {
|
|
44148
|
+
this.stop(Chronograph.Buffering);
|
|
44149
|
+
this.listenToOnce(this.container, Events$1.CONTAINER_STATE_BUFFERING, this.onBuffering);
|
|
44150
|
+
}
|
|
44151
|
+
onProgress(progress) {
|
|
44152
|
+
this.metrics.extra.buffersize = progress.current * 1000;
|
|
44153
|
+
}
|
|
44154
|
+
onCompletion() {
|
|
44155
|
+
// Decide if this is needed
|
|
44156
|
+
// const currentPercentage = this.metrics.extra.watchedPercentage;
|
|
44157
|
+
// this.trigger(ClapprStatsEvents.PERCENTAGE, currentPercentage);
|
|
44158
|
+
}
|
|
44159
|
+
buildReport() {
|
|
44160
|
+
this.stop(Chronograph.Session);
|
|
44161
|
+
this.start(Chronograph.Session);
|
|
44162
|
+
this.metrics.extra.playbackName = this.playbackName;
|
|
44163
|
+
this.metrics.extra.playbackType = this.playbackType;
|
|
44164
|
+
this.calcBitrates();
|
|
44165
|
+
this.calcBufferingPercentage();
|
|
44166
|
+
// TODO calc FPS properly, e.g., on TIMEUPDATE event
|
|
44167
|
+
this.fetchFPS();
|
|
44168
|
+
this.trigger(ClapprStatsEvents.REPORT, structuredClone(this.metrics));
|
|
44169
|
+
}
|
|
44170
|
+
fetchFPS() {
|
|
44171
|
+
// TODO check if the playback and media sources support video, then use the common method
|
|
44172
|
+
// flashls ??? - hls.droppedFramesl hls.stream.bufferLength (seconds)
|
|
44173
|
+
// hls ??? (use the same?)
|
|
44174
|
+
const fetchFPS = {
|
|
44175
|
+
html5_video: this.html5FetchFPS,
|
|
44176
|
+
hls: this.html5FetchFPS,
|
|
44177
|
+
dash: this.html5FetchFPS,
|
|
44178
|
+
};
|
|
44179
|
+
if (this.playbackName in fetchFPS) {
|
|
44180
|
+
fetchFPS[this.playbackName].call(this);
|
|
44181
|
+
}
|
|
44182
|
+
}
|
|
44183
|
+
// TODO sort out
|
|
44184
|
+
calcBitrates() {
|
|
44185
|
+
const { bitratesHistory } = this.metrics.extra;
|
|
44186
|
+
if (bitratesHistory.length === 0) {
|
|
44187
|
+
return;
|
|
44188
|
+
}
|
|
44189
|
+
let totalTime = 0;
|
|
44190
|
+
let weightedTotal = 0;
|
|
44191
|
+
for (const { bitrate, time = 0 } of bitratesHistory) {
|
|
44192
|
+
totalTime += time;
|
|
44193
|
+
weightedTotal += bitrate * time;
|
|
44194
|
+
}
|
|
44195
|
+
this.metrics.extra.bitrateWeightedMean = weightedTotal / totalTime;
|
|
44196
|
+
this.metrics.extra.bitrateMostUsed = bitratesHistory.reduce((mostUsed, current) => (current.time || 0) > (mostUsed.time || 0) ? current : mostUsed, { time: 0, bitrate: 0, start: 0, end: 0 }).bitrate;
|
|
44197
|
+
}
|
|
44198
|
+
calcBufferingPercentage() {
|
|
44199
|
+
if (this.metrics.extra.duration > 0) {
|
|
44200
|
+
this.metrics.extra.bufferingPercentage =
|
|
44201
|
+
(this.metrics.chrono.buffering / this.metrics.extra.duration) * 100;
|
|
44202
|
+
}
|
|
44203
|
+
}
|
|
44204
|
+
html5FetchFPS() {
|
|
44205
|
+
const videoTag = this.container.playback.el;
|
|
44206
|
+
const getFirstValidValue = (...args) => args.find((val) => val !== undefined);
|
|
44207
|
+
const decodedFrames = getFirstValidValue(videoTag.webkitDecodedFrameCount, videoTag.mozDecodedFrames, 0);
|
|
44208
|
+
const droppedFrames = getFirstValidValue(videoTag.webkitDroppedFrameCount, videoTag.mozParsedFrames && videoTag.mozDecodedFrames
|
|
44209
|
+
? videoTag.mozParsedFrames - videoTag.mozDecodedFrames
|
|
44210
|
+
: 0, 0);
|
|
44211
|
+
const delta = decodedFrames - (this.lastDecodedFramesCount || 0);
|
|
44212
|
+
this.metrics.counters.decodedFrames = decodedFrames;
|
|
44213
|
+
this.metrics.counters.droppedFrames = droppedFrames;
|
|
44214
|
+
this.metrics.counters.fps = delta / (this.runEach / 1000); // TODO use time delta instead of runEach
|
|
44215
|
+
this.lastDecodedFramesCount = decodedFrames;
|
|
44216
|
+
}
|
|
44217
|
+
}
|
|
44218
|
+
|
|
43888
44219
|
var mousetrap = {exports: {}};
|
|
43889
44220
|
|
|
43890
44221
|
/*global define:false */
|
|
@@ -44952,56 +45283,6 @@ function requireMousetrap () {
|
|
|
44952
45283
|
var mousetrapExports = requireMousetrap();
|
|
44953
45284
|
const Mousetrap = /*@__PURE__*/getDefaultExportFromCjs$1(mousetrapExports);
|
|
44954
45285
|
|
|
44955
|
-
/**
|
|
44956
|
-
* @beta
|
|
44957
|
-
*/
|
|
44958
|
-
var ClapprStatsEvents;
|
|
44959
|
-
(function (ClapprStatsEvents) {
|
|
44960
|
-
ClapprStatsEvents["REPORT_EVENT"] = "clappr:stats:report";
|
|
44961
|
-
ClapprStatsEvents["PERCENTAGE_EVENT"] = "clappr:stats:percentage";
|
|
44962
|
-
})(ClapprStatsEvents || (ClapprStatsEvents = {}));
|
|
44963
|
-
|
|
44964
|
-
function newMetrics$1() {
|
|
44965
|
-
return {
|
|
44966
|
-
counters: {
|
|
44967
|
-
play: 0,
|
|
44968
|
-
pause: 0,
|
|
44969
|
-
error: 0,
|
|
44970
|
-
buffering: 0,
|
|
44971
|
-
decodedFrames: 0,
|
|
44972
|
-
droppedFrames: 0,
|
|
44973
|
-
fps: 0,
|
|
44974
|
-
changeLevel: 0,
|
|
44975
|
-
seek: 0,
|
|
44976
|
-
fullscreen: 0,
|
|
44977
|
-
dvrUsage: 0,
|
|
44978
|
-
},
|
|
44979
|
-
timers: {
|
|
44980
|
-
startup: 0,
|
|
44981
|
-
watch: 0,
|
|
44982
|
-
pause: 0,
|
|
44983
|
-
buffering: 0,
|
|
44984
|
-
session: 0,
|
|
44985
|
-
latency: 0,
|
|
44986
|
-
},
|
|
44987
|
-
extra: {
|
|
44988
|
-
playbackName: '',
|
|
44989
|
-
playbackType: '',
|
|
44990
|
-
bitratesHistory: [],
|
|
44991
|
-
bitrateWeightedMean: 0,
|
|
44992
|
-
bitrateMostUsed: 0,
|
|
44993
|
-
buffersize: 0,
|
|
44994
|
-
watchHistory: [],
|
|
44995
|
-
watchedPercentage: 0,
|
|
44996
|
-
bufferingPercentage: 0,
|
|
44997
|
-
bandwidth: 0,
|
|
44998
|
-
duration: 0,
|
|
44999
|
-
currentTime: 0,
|
|
45000
|
-
},
|
|
45001
|
-
custom: {},
|
|
45002
|
-
};
|
|
45003
|
-
}
|
|
45004
|
-
|
|
45005
45286
|
var humanFormat$2 = {exports: {}};
|
|
45006
45287
|
|
|
45007
45288
|
var humanFormat$1 = humanFormat$2.exports;
|
|
@@ -46026,7 +46307,7 @@ const drawSummary = (customMetrics, vodContainer, liveContainer) => {
|
|
|
46026
46307
|
vodContainer.html(vodHtml);
|
|
46027
46308
|
liveContainer.html(liveHtml);
|
|
46028
46309
|
};
|
|
46029
|
-
const T$
|
|
46310
|
+
const T$f = 'plugins.nerd_stats';
|
|
46030
46311
|
/**
|
|
46031
46312
|
* `PLUGIN` that displays useful network-related statistics.
|
|
46032
46313
|
* @beta
|
|
@@ -46043,7 +46324,7 @@ const T$e = 'plugins.clappr_nerd_stats';
|
|
|
46043
46324
|
* When clicked, it shows an overlay window with the information about the network speed, latency, etc,
|
|
46044
46325
|
* and recommended quality level.
|
|
46045
46326
|
*/
|
|
46046
|
-
class
|
|
46327
|
+
class NerdStats extends UICorePlugin {
|
|
46047
46328
|
container = null;
|
|
46048
46329
|
customMetrics = {
|
|
46049
46330
|
connectionSpeed: 0,
|
|
@@ -46065,7 +46346,7 @@ class ClapprNerdStats extends UICorePlugin {
|
|
|
46065
46346
|
* @internal
|
|
46066
46347
|
*/
|
|
46067
46348
|
get supportedVersion() {
|
|
46068
|
-
return { min: CLAPPR_VERSION };
|
|
46349
|
+
return { min: CLAPPR_VERSION$1 };
|
|
46069
46350
|
}
|
|
46070
46351
|
static template = tmpl(pluginHtml$4);
|
|
46071
46352
|
/**
|
|
@@ -46126,32 +46407,29 @@ class ClapprNerdStats extends UICorePlugin {
|
|
|
46126
46407
|
this.listenTo(bottomGear, GearEvents.RENDERED, this.addToBottomGear);
|
|
46127
46408
|
this.container = this.core.activeContainer;
|
|
46128
46409
|
const clapprStats = this.container?.getPlugin('clappr_stats');
|
|
46129
|
-
|
|
46130
|
-
|
|
46131
|
-
|
|
46132
|
-
|
|
46133
|
-
|
|
46134
|
-
|
|
46135
|
-
|
|
46136
|
-
|
|
46137
|
-
|
|
46138
|
-
|
|
46139
|
-
|
|
46140
|
-
|
|
46141
|
-
|
|
46142
|
-
|
|
46143
|
-
this.updateMetrics(clapprStats.exportMetrics());
|
|
46144
|
-
this.render();
|
|
46145
|
-
}
|
|
46410
|
+
assert(clapprStats, 'clappr-stats not available. Please, include it as a plugin of your Clappr instance.\n' +
|
|
46411
|
+
'For more info, visit: https://github.com/clappr/clappr-stats.');
|
|
46412
|
+
Mousetrap.bind(this.shortcut, this.toggle);
|
|
46413
|
+
this.listenTo(this.core, Events$1.CORE_RESIZE, this.onPlayerResize);
|
|
46414
|
+
this.listenTo(clapprStats, ClapprStatsEvents.REPORT, this.updateMetrics);
|
|
46415
|
+
this.updateMetrics(clapprStats.exportMetrics());
|
|
46416
|
+
this.render();
|
|
46417
|
+
}
|
|
46418
|
+
/**
|
|
46419
|
+
* @internal
|
|
46420
|
+
*/
|
|
46421
|
+
destroy() {
|
|
46422
|
+
Mousetrap.unbind(this.shortcut);
|
|
46423
|
+
return super.destroy();
|
|
46146
46424
|
}
|
|
46147
|
-
toggle() {
|
|
46425
|
+
toggle = () => {
|
|
46148
46426
|
if (this.showing) {
|
|
46149
46427
|
this.hide();
|
|
46150
46428
|
}
|
|
46151
46429
|
else {
|
|
46152
46430
|
this.show();
|
|
46153
46431
|
}
|
|
46154
|
-
}
|
|
46432
|
+
};
|
|
46155
46433
|
show() {
|
|
46156
46434
|
this.core.$el.find(this.statsBoxElem).show();
|
|
46157
46435
|
this.showing = true;
|
|
@@ -46209,7 +46487,7 @@ class ClapprNerdStats extends UICorePlugin {
|
|
|
46209
46487
|
this.addGeneralMetrics();
|
|
46210
46488
|
this.addCustomMetrics();
|
|
46211
46489
|
const scrollTop = this.core.$el.find(this.statsBoxElem).scrollTop();
|
|
46212
|
-
this.$el.html(
|
|
46490
|
+
this.$el.html(NerdStats.template({
|
|
46213
46491
|
metrics: Formatter.format(this.metrics),
|
|
46214
46492
|
iconPosition: this.iconPosition,
|
|
46215
46493
|
}));
|
|
@@ -46235,18 +46513,18 @@ class ClapprNerdStats extends UICorePlugin {
|
|
|
46235
46513
|
* @internal
|
|
46236
46514
|
*/
|
|
46237
46515
|
render() {
|
|
46238
|
-
trace(`${T$
|
|
46516
|
+
trace(`${T$f} render`);
|
|
46239
46517
|
// TODO append to the container
|
|
46240
46518
|
this.core.$el.append(this.$el[0]);
|
|
46241
46519
|
this.hide();
|
|
46242
46520
|
return this;
|
|
46243
46521
|
}
|
|
46244
46522
|
addToBottomGear() {
|
|
46245
|
-
trace(`${T$
|
|
46523
|
+
trace(`${T$f} addToBottomGear`);
|
|
46246
46524
|
const gear = this.core.getPlugin('bottom_gear');
|
|
46247
46525
|
gear
|
|
46248
|
-
.addItem('
|
|
46249
|
-
.html(
|
|
46526
|
+
.addItem('nerd_stats')
|
|
46527
|
+
.html(NerdStats.buttonTemplate({
|
|
46250
46528
|
icon: statsIcon,
|
|
46251
46529
|
i18n: this.core.i18n,
|
|
46252
46530
|
}))
|
|
@@ -46288,367 +46566,11 @@ function newMetrics() {
|
|
|
46288
46566
|
};
|
|
46289
46567
|
}
|
|
46290
46568
|
|
|
46291
|
-
// TODO: fix
|
|
46292
|
-
const updateMetrics = () => { };
|
|
46293
|
-
/**
|
|
46294
|
-
* `PLUGIN` that collects useful statistics about playback performance.
|
|
46295
|
-
* @beta
|
|
46296
|
-
* @remarks
|
|
46297
|
-
* This plugin does not render anything and is supposed to be extended or used together with other plugins that actually render something.
|
|
46298
|
-
*/
|
|
46299
|
-
class ClapprStats extends ContainerPlugin {
|
|
46300
|
-
bwMeasureCount = 0;
|
|
46301
|
-
intervalId = null;
|
|
46302
|
-
lastDecodedFramesCount = 0;
|
|
46303
|
-
metrics = newMetrics$1();
|
|
46304
|
-
completion;
|
|
46305
|
-
_onReport;
|
|
46306
|
-
runBandwidthTestEvery;
|
|
46307
|
-
runEach;
|
|
46308
|
-
timers = {
|
|
46309
|
-
startup: 0,
|
|
46310
|
-
watch: 0,
|
|
46311
|
-
pause: 0,
|
|
46312
|
-
buffering: 0,
|
|
46313
|
-
session: 0,
|
|
46314
|
-
latency: 0,
|
|
46315
|
-
};
|
|
46316
|
-
updateFn = updateMetrics;
|
|
46317
|
-
urisToMeasureBandwidth;
|
|
46318
|
-
uriToMeasureLatency;
|
|
46319
|
-
/**
|
|
46320
|
-
* @internal
|
|
46321
|
-
*/
|
|
46322
|
-
get name() {
|
|
46323
|
-
return 'clappr_stats';
|
|
46324
|
-
}
|
|
46325
|
-
/**
|
|
46326
|
-
* @internal
|
|
46327
|
-
*/
|
|
46328
|
-
get supportedVersion() {
|
|
46329
|
-
return { min: CLAPPR_VERSION };
|
|
46330
|
-
}
|
|
46331
|
-
get _playbackName() {
|
|
46332
|
-
return String(this.container.playback.name || '');
|
|
46333
|
-
}
|
|
46334
|
-
get _playbackType() {
|
|
46335
|
-
return this.container.getPlaybackType();
|
|
46336
|
-
}
|
|
46337
|
-
_now() {
|
|
46338
|
-
const hasPerformanceSupport = window.performance && typeof (window.performance.now) === 'function';
|
|
46339
|
-
return (hasPerformanceSupport) ? window.performance.now() : new Date().getTime();
|
|
46340
|
-
}
|
|
46341
|
-
_inc(counter) {
|
|
46342
|
-
this.metrics.counters[counter] += 1;
|
|
46343
|
-
}
|
|
46344
|
-
// _timerHasStarted(timer) {
|
|
46345
|
-
// return this[`_start${timer}`] !== undefined;
|
|
46346
|
-
// }
|
|
46347
|
-
start(timer) {
|
|
46348
|
-
// this[`_start${timer}`] = this._now();
|
|
46349
|
-
this.timers[timer] = this._now();
|
|
46350
|
-
}
|
|
46351
|
-
_stop(timer) {
|
|
46352
|
-
// this._metrics.timers[timer] += this._now() - this[`_start${timer}`];
|
|
46353
|
-
this.metrics.timers[timer] += this._now() - this.timers[timer];
|
|
46354
|
-
}
|
|
46355
|
-
/**
|
|
46356
|
-
* Registers a callback to receive the metrics.
|
|
46357
|
-
* @param updateMetricsFn - The callback to receive the metrics
|
|
46358
|
-
*/
|
|
46359
|
-
setUpdateMetrics(updateMetricsFn) {
|
|
46360
|
-
// TODO use events instead
|
|
46361
|
-
this.updateFn = updateMetricsFn;
|
|
46362
|
-
}
|
|
46363
|
-
_defaultReport(metrics) {
|
|
46364
|
-
this.updateFn(metrics);
|
|
46365
|
-
}
|
|
46366
|
-
constructor(container) {
|
|
46367
|
-
super(container);
|
|
46368
|
-
this.runEach = container.options.clapprStats?.runEach ?? 5000;
|
|
46369
|
-
this._onReport = container.options.clapprStats?.onReport ?? this._defaultReport;
|
|
46370
|
-
this.uriToMeasureLatency = container.options.clapprStats?.uriToMeasureLatency;
|
|
46371
|
-
this.urisToMeasureBandwidth = container.options.clapprStats?.urisToMeasureBandwidth;
|
|
46372
|
-
this.runBandwidthTestEvery = container.options.clapprStats?.runBandwidthTestEvery ?? 10;
|
|
46373
|
-
this.completion = {
|
|
46374
|
-
watch: container.options.clapprStats?.onCompletion ?? [],
|
|
46375
|
-
calls: []
|
|
46376
|
-
};
|
|
46377
|
-
}
|
|
46378
|
-
/**
|
|
46379
|
-
* @internal
|
|
46380
|
-
*/
|
|
46381
|
-
bindEvents() {
|
|
46382
|
-
this.listenTo(this.container, Events$1.CONTAINER_BITRATE, this.onBitrate);
|
|
46383
|
-
this.listenTo(this.container, Events$1.CONTAINER_STOP, this.stopReporting);
|
|
46384
|
-
this.listenTo(this.container, Events$1.CONTAINER_ENDED, this.stopReporting);
|
|
46385
|
-
this.listenToOnce(this.container.playback, Events$1.PLAYBACK_PLAY_INTENT, this.startTimers);
|
|
46386
|
-
this.listenToOnce(this.container, Events$1.CONTAINER_PLAY, this.onFirstPlaying);
|
|
46387
|
-
this.listenTo(this.container, Events$1.CONTAINER_PLAY, this.onPlay);
|
|
46388
|
-
this.listenTo(this.container, Events$1.CONTAINER_PAUSE, this.onPause);
|
|
46389
|
-
this.listenToOnce(this.container, Events$1.CONTAINER_STATE_BUFFERING, this.onBuffering);
|
|
46390
|
-
this.listenTo(this.container, Events$1.CONTAINER_SEEK, this.onSeek);
|
|
46391
|
-
this.listenTo(this.container, Events$1.CONTAINER_ERROR, () => this._inc('error'));
|
|
46392
|
-
this.listenTo(this.container, Events$1.CONTAINER_FULLSCREEN, () => this._inc('fullscreen'));
|
|
46393
|
-
this.listenTo(this.container, Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, (dvrInUse) => {
|
|
46394
|
-
dvrInUse && this._inc('dvrUsage');
|
|
46395
|
-
});
|
|
46396
|
-
this.listenTo(this.container.playback, Events$1.PLAYBACK_PROGRESS, this.onProgress);
|
|
46397
|
-
this.listenTo(this.container.playback, Events$1.PLAYBACK_TIMEUPDATE, this.onTimeUpdate);
|
|
46398
|
-
}
|
|
46399
|
-
/**
|
|
46400
|
-
* @internal
|
|
46401
|
-
*/
|
|
46402
|
-
destroy() {
|
|
46403
|
-
this.stopReporting();
|
|
46404
|
-
super.destroy();
|
|
46405
|
-
}
|
|
46406
|
-
/**
|
|
46407
|
-
* Returns the collected metrics.
|
|
46408
|
-
* @returns Currently collected metrics
|
|
46409
|
-
*/
|
|
46410
|
-
exportMetrics() {
|
|
46411
|
-
return structuredClone(this.metrics);
|
|
46412
|
-
}
|
|
46413
|
-
onBitrate(newBitrate) {
|
|
46414
|
-
const bitrate = newBitrate.bitrate;
|
|
46415
|
-
const now = this._now();
|
|
46416
|
-
if (this.metrics.extra.bitratesHistory.length > 0) {
|
|
46417
|
-
const beforeLast = this.metrics.extra.bitratesHistory[this.metrics.extra.bitratesHistory.length - 1];
|
|
46418
|
-
beforeLast.end = now;
|
|
46419
|
-
beforeLast.time = now - beforeLast.start;
|
|
46420
|
-
}
|
|
46421
|
-
this.metrics.extra.bitratesHistory.push({ start: this._now(), bitrate: bitrate });
|
|
46422
|
-
this._inc('changeLevel');
|
|
46423
|
-
}
|
|
46424
|
-
stopReporting() {
|
|
46425
|
-
this._buildReport();
|
|
46426
|
-
if (this.intervalId !== null) {
|
|
46427
|
-
clearInterval(this.intervalId);
|
|
46428
|
-
this.intervalId = null;
|
|
46429
|
-
}
|
|
46430
|
-
this._newMetrics();
|
|
46431
|
-
// TODO
|
|
46432
|
-
// @ts-ignore
|
|
46433
|
-
this.stopListening();
|
|
46434
|
-
this.bindEvents();
|
|
46435
|
-
}
|
|
46436
|
-
startTimers() {
|
|
46437
|
-
this.intervalId = setInterval(this._buildReport.bind(this), this.runEach);
|
|
46438
|
-
this.start('session');
|
|
46439
|
-
this.start('startup');
|
|
46440
|
-
}
|
|
46441
|
-
onFirstPlaying() {
|
|
46442
|
-
this.listenTo(this.container, Events$1.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
46443
|
-
this.start('watch');
|
|
46444
|
-
this._stop('startup');
|
|
46445
|
-
}
|
|
46446
|
-
playAfterPause() {
|
|
46447
|
-
this.listenTo(this.container, Events$1.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
46448
|
-
this._stop('pause');
|
|
46449
|
-
this.start('watch');
|
|
46450
|
-
}
|
|
46451
|
-
onPlay() {
|
|
46452
|
-
this._inc('play');
|
|
46453
|
-
}
|
|
46454
|
-
onPause() {
|
|
46455
|
-
this._stop('watch');
|
|
46456
|
-
this.start('pause');
|
|
46457
|
-
this._inc('pause');
|
|
46458
|
-
this.listenToOnce(this.container, Events$1.CONTAINER_PLAY, this.playAfterPause);
|
|
46459
|
-
this.stopListening(this.container, Events$1.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
46460
|
-
}
|
|
46461
|
-
onSeek(e) {
|
|
46462
|
-
this._inc('seek');
|
|
46463
|
-
this.metrics.extra.watchHistory.push([e * 1000, e * 1000]);
|
|
46464
|
-
}
|
|
46465
|
-
onTimeUpdate(e) {
|
|
46466
|
-
const current = e.current * 1000, total = e.total * 1000, l = this.metrics.extra.watchHistory.length;
|
|
46467
|
-
this.metrics.extra.duration = total;
|
|
46468
|
-
this.metrics.extra.currentTime = current;
|
|
46469
|
-
this.metrics.extra.watchedPercentage = (current / total) * 100;
|
|
46470
|
-
if (l === 0) {
|
|
46471
|
-
this.metrics.extra.watchHistory.push([current, current]);
|
|
46472
|
-
}
|
|
46473
|
-
else {
|
|
46474
|
-
this.metrics.extra.watchHistory[l - 1][1] = current;
|
|
46475
|
-
}
|
|
46476
|
-
if (this.metrics.extra.bitratesHistory.length > 0) {
|
|
46477
|
-
const lastBitrate = this.metrics.extra.bitratesHistory[this.metrics.extra.bitratesHistory.length - 1];
|
|
46478
|
-
if (!lastBitrate.end) {
|
|
46479
|
-
lastBitrate.time = this._now() - lastBitrate.start;
|
|
46480
|
-
}
|
|
46481
|
-
}
|
|
46482
|
-
this._onCompletion();
|
|
46483
|
-
}
|
|
46484
|
-
onContainerUpdateWhilePlaying() {
|
|
46485
|
-
if (this.container.playback.isPlaying()) {
|
|
46486
|
-
this._stop('watch');
|
|
46487
|
-
this.start('watch');
|
|
46488
|
-
}
|
|
46489
|
-
}
|
|
46490
|
-
onBuffering() {
|
|
46491
|
-
this._inc('buffering');
|
|
46492
|
-
this.start('buffering');
|
|
46493
|
-
this.listenToOnce(this.container, Events$1.CONTAINER_STATE_BUFFERFULL, this.onBufferfull);
|
|
46494
|
-
}
|
|
46495
|
-
onBufferfull() {
|
|
46496
|
-
this._stop('buffering');
|
|
46497
|
-
this.listenToOnce(this.container, Events$1.CONTAINER_STATE_BUFFERING, this.onBuffering);
|
|
46498
|
-
}
|
|
46499
|
-
onProgress(progress) {
|
|
46500
|
-
this.metrics.extra.buffersize = progress.current * 1000;
|
|
46501
|
-
}
|
|
46502
|
-
_newMetrics() {
|
|
46503
|
-
this.metrics = newMetrics$1();
|
|
46504
|
-
}
|
|
46505
|
-
_onCompletion() {
|
|
46506
|
-
const currentPercentage = this.metrics.extra.watchedPercentage;
|
|
46507
|
-
const allPercentages = this.completion.watch;
|
|
46508
|
-
const isCalled = this.completion.calls.indexOf(currentPercentage) !== -1;
|
|
46509
|
-
if (allPercentages.indexOf(currentPercentage) !== -1 && !isCalled) {
|
|
46510
|
-
Log.info(this.name + ' PERCENTAGE_EVENT: ' + currentPercentage);
|
|
46511
|
-
this.completion.calls.push(currentPercentage);
|
|
46512
|
-
this.trigger(ClapprStatsEvents.PERCENTAGE_EVENT, currentPercentage);
|
|
46513
|
-
}
|
|
46514
|
-
}
|
|
46515
|
-
_buildReport() {
|
|
46516
|
-
this._stop('session');
|
|
46517
|
-
this.start('session');
|
|
46518
|
-
this.metrics.extra.playbackName = this._playbackName;
|
|
46519
|
-
this.metrics.extra.playbackType = this._playbackType;
|
|
46520
|
-
this._calculateBitrates();
|
|
46521
|
-
this._calculatePercentages();
|
|
46522
|
-
this._fetchFPS();
|
|
46523
|
-
this._measureLatency();
|
|
46524
|
-
this._measureBandwidth();
|
|
46525
|
-
this._onReport(this.metrics);
|
|
46526
|
-
this.trigger(ClapprStatsEvents.REPORT_EVENT, structuredClone(this.metrics));
|
|
46527
|
-
}
|
|
46528
|
-
_fetchFPS() {
|
|
46529
|
-
// flashls ??? - hls.droppedFramesl hls.stream.bufferLength (seconds)
|
|
46530
|
-
// hls ??? (use the same?)
|
|
46531
|
-
const fetchFPS = {
|
|
46532
|
-
'html5_video': this._html5FetchFPS,
|
|
46533
|
-
'hls': this._html5FetchFPS,
|
|
46534
|
-
'dash_shaka_playback': this._html5FetchFPS
|
|
46535
|
-
};
|
|
46536
|
-
if (this._playbackName in fetchFPS) {
|
|
46537
|
-
fetchFPS[this._playbackName].call(this);
|
|
46538
|
-
}
|
|
46539
|
-
}
|
|
46540
|
-
_calculateBitrates() {
|
|
46541
|
-
const { bitratesHistory } = this.metrics.extra;
|
|
46542
|
-
if (bitratesHistory.length === 0) {
|
|
46543
|
-
return;
|
|
46544
|
-
}
|
|
46545
|
-
let totalTime = 0;
|
|
46546
|
-
let weightedTotal = 0;
|
|
46547
|
-
for (const { bitrate, time = 0 } of bitratesHistory) {
|
|
46548
|
-
totalTime += time;
|
|
46549
|
-
weightedTotal += bitrate * time;
|
|
46550
|
-
}
|
|
46551
|
-
this.metrics.extra.bitrateWeightedMean = weightedTotal / totalTime;
|
|
46552
|
-
this.metrics.extra.bitrateMostUsed = bitratesHistory.reduce((mostUsed, current) => (current.time || 0) > (mostUsed.time || 0) ? current : mostUsed, { time: 0, bitrate: 0, start: 0, end: 0 }).bitrate;
|
|
46553
|
-
}
|
|
46554
|
-
_calculatePercentages() {
|
|
46555
|
-
if (this.metrics.extra.duration > 0) {
|
|
46556
|
-
this.metrics.extra.bufferingPercentage = (this.metrics.timers.buffering / this.metrics.extra.duration) * 100;
|
|
46557
|
-
}
|
|
46558
|
-
}
|
|
46559
|
-
_html5FetchFPS() {
|
|
46560
|
-
const videoTag = this.container.playback.el;
|
|
46561
|
-
const getFirstValidValue = (...args) => args.find(val => val !== undefined);
|
|
46562
|
-
const decodedFrames = getFirstValidValue(videoTag.webkitDecodedFrameCount, videoTag.mozDecodedFrames, 0);
|
|
46563
|
-
const droppedFrames = getFirstValidValue(videoTag.webkitDroppedFrameCount, videoTag.mozParsedFrames && videoTag.mozDecodedFrames ? videoTag.mozParsedFrames - videoTag.mozDecodedFrames : 0, 0);
|
|
46564
|
-
const decodedFramesLastTime = decodedFrames - (this.lastDecodedFramesCount || 0);
|
|
46565
|
-
this.metrics.counters.decodedFrames = decodedFrames;
|
|
46566
|
-
this.metrics.counters.droppedFrames = droppedFrames;
|
|
46567
|
-
this.metrics.counters.fps = decodedFramesLastTime / (this.runEach / 1000);
|
|
46568
|
-
this.lastDecodedFramesCount = decodedFrames;
|
|
46569
|
-
}
|
|
46570
|
-
// originally from https://www.smashingmagazine.com/2011/11/analyzing-network-characteristics-using-javascript-and-the-dom-part-1/
|
|
46571
|
-
_measureLatency() {
|
|
46572
|
-
if (this.uriToMeasureLatency) {
|
|
46573
|
-
const t = [];
|
|
46574
|
-
const n = 2;
|
|
46575
|
-
let rtt;
|
|
46576
|
-
const ld = () => {
|
|
46577
|
-
t.push(this._now());
|
|
46578
|
-
if (t.length > n) {
|
|
46579
|
-
done();
|
|
46580
|
-
}
|
|
46581
|
-
else {
|
|
46582
|
-
const img = new Image;
|
|
46583
|
-
img.onload = ld;
|
|
46584
|
-
img.src = this.uriToMeasureLatency + '?' + Math.random()
|
|
46585
|
-
+ '=' + this._now();
|
|
46586
|
-
}
|
|
46587
|
-
};
|
|
46588
|
-
const done = () => {
|
|
46589
|
-
rtt = t[2] - t[1];
|
|
46590
|
-
this.metrics.timers.latency = rtt;
|
|
46591
|
-
};
|
|
46592
|
-
ld();
|
|
46593
|
-
}
|
|
46594
|
-
}
|
|
46595
|
-
// originally from https://www.smashingmagazine.com/2011/11/analyzing-network-characteristics-using-javascript-and-the-dom-part-1/
|
|
46596
|
-
_measureBandwidth() {
|
|
46597
|
-
if (this.urisToMeasureBandwidth && (this.bwMeasureCount % this.runBandwidthTestEvery === 0)) {
|
|
46598
|
-
let i = 0;
|
|
46599
|
-
const ld = (e) => {
|
|
46600
|
-
if (i > 0) {
|
|
46601
|
-
const prev = this.urisToMeasureBandwidth[i - 1];
|
|
46602
|
-
prev.end = this._now();
|
|
46603
|
-
if (prev.timer !== null) {
|
|
46604
|
-
clearTimeout(prev.timer);
|
|
46605
|
-
}
|
|
46606
|
-
}
|
|
46607
|
-
if (i >= this.urisToMeasureBandwidth.length || (i > 0 && this.urisToMeasureBandwidth[i - 1].expired)) {
|
|
46608
|
-
assert(e, 'incorrect invocation in _measureBandwidth');
|
|
46609
|
-
done(e);
|
|
46610
|
-
}
|
|
46611
|
-
else {
|
|
46612
|
-
const xhr = new XMLHttpRequest();
|
|
46613
|
-
xhr.open('GET', this.urisToMeasureBandwidth[i].url, true);
|
|
46614
|
-
xhr.responseType = 'arraybuffer';
|
|
46615
|
-
xhr.onload = xhr.onabort = ld;
|
|
46616
|
-
this.urisToMeasureBandwidth[i].start = this._now();
|
|
46617
|
-
this.urisToMeasureBandwidth[i].timer = setTimeout((j) => {
|
|
46618
|
-
this.urisToMeasureBandwidth[j].expired = true;
|
|
46619
|
-
xhr.abort();
|
|
46620
|
-
}, this.urisToMeasureBandwidth[i].timeout, i);
|
|
46621
|
-
xhr.send();
|
|
46622
|
-
}
|
|
46623
|
-
i++;
|
|
46624
|
-
};
|
|
46625
|
-
const done = (e) => {
|
|
46626
|
-
const timeSpent = (this.urisToMeasureBandwidth[i - 1].end - this.urisToMeasureBandwidth[i - 1].start) / 1000;
|
|
46627
|
-
const bandwidthBps = (e.loaded * 8) / timeSpent;
|
|
46628
|
-
this.metrics.extra.bandwidth = bandwidthBps;
|
|
46629
|
-
this.urisToMeasureBandwidth.forEach((x) => {
|
|
46630
|
-
x.start = 0;
|
|
46631
|
-
x.end = 0;
|
|
46632
|
-
x.expired = false;
|
|
46633
|
-
if (x.timer !== null) {
|
|
46634
|
-
clearTimeout(x.timer);
|
|
46635
|
-
x.timer = null;
|
|
46636
|
-
}
|
|
46637
|
-
});
|
|
46638
|
-
};
|
|
46639
|
-
ld();
|
|
46640
|
-
}
|
|
46641
|
-
this.bwMeasureCount++;
|
|
46642
|
-
}
|
|
46643
|
-
}
|
|
46644
|
-
// ClapprStats.REPORT_EVENT = 'clappr:stats:report';
|
|
46645
|
-
// ClapprStats.PERCENTAGE_EVENT = 'clappr:stats:percentage';
|
|
46646
|
-
|
|
46647
46569
|
// This work is based on the original work of the following authors:
|
|
46648
46570
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
46649
46571
|
// Use of this source code is governed by a BSD-style
|
|
46650
46572
|
// license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
|
|
46651
|
-
const T$
|
|
46573
|
+
const T$e = 'plugins.click_to_pause';
|
|
46652
46574
|
/**
|
|
46653
46575
|
* A small `PLUGIN` that toggles the playback state on click over the video container
|
|
46654
46576
|
* @beta
|
|
@@ -46666,7 +46588,7 @@ class ClickToPause extends ContainerPlugin {
|
|
|
46666
46588
|
* @internal
|
|
46667
46589
|
*/
|
|
46668
46590
|
get supportedVersion() {
|
|
46669
|
-
return { min: CLAPPR_VERSION };
|
|
46591
|
+
return { min: CLAPPR_VERSION$1 };
|
|
46670
46592
|
}
|
|
46671
46593
|
/**
|
|
46672
46594
|
* @internal
|
|
@@ -46678,7 +46600,7 @@ class ClickToPause extends ContainerPlugin {
|
|
|
46678
46600
|
click() {
|
|
46679
46601
|
const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
|
|
46680
46602
|
const isDvrEnabled = this.container.isDvrEnabled();
|
|
46681
|
-
trace(`${T$
|
|
46603
|
+
trace(`${T$e} click`, {
|
|
46682
46604
|
isLivePlayback,
|
|
46683
46605
|
isDvrEnabled,
|
|
46684
46606
|
});
|
|
@@ -46720,7 +46642,15 @@ class ClickToPause extends ContainerPlugin {
|
|
|
46720
46642
|
}
|
|
46721
46643
|
}
|
|
46722
46644
|
|
|
46723
|
-
|
|
46645
|
+
/**
|
|
46646
|
+
* Parse a time string in the format "hh:mm:ss" or "mm:ss" or "ss" to seconds.
|
|
46647
|
+
* @param str - The time string to parse.
|
|
46648
|
+
* @returns The time in seconds.
|
|
46649
|
+
* @example "01:01:00" -> 3660
|
|
46650
|
+
* @example "01:00" -> 60
|
|
46651
|
+
* @example "33" -> 33
|
|
46652
|
+
*/
|
|
46653
|
+
function parseClipTime(str) {
|
|
46724
46654
|
if (!str) {
|
|
46725
46655
|
return 0;
|
|
46726
46656
|
}
|
|
@@ -46729,21 +46659,12 @@ function strtimeToMiliseconds(str) {
|
|
|
46729
46659
|
if (arr.length >= 3) {
|
|
46730
46660
|
h = parseInt(arr[arr.length - 3]) * 60 * 60;
|
|
46731
46661
|
}
|
|
46732
|
-
else {
|
|
46733
|
-
h = 0;
|
|
46734
|
-
}
|
|
46735
46662
|
if (arr.length >= 2) {
|
|
46736
46663
|
m = parseInt(arr[arr.length - 2]) * 60;
|
|
46737
46664
|
}
|
|
46738
|
-
else {
|
|
46739
|
-
m = 0;
|
|
46740
|
-
}
|
|
46741
46665
|
if (arr.length >= 1) {
|
|
46742
46666
|
s = parseInt(arr[arr.length - 1]);
|
|
46743
46667
|
}
|
|
46744
|
-
else {
|
|
46745
|
-
s = 0;
|
|
46746
|
-
}
|
|
46747
46668
|
return (h + m + s);
|
|
46748
46669
|
}
|
|
46749
46670
|
function getPageX(event) {
|
|
@@ -46756,22 +46677,65 @@ function getPageX(event) {
|
|
|
46756
46677
|
return 0;
|
|
46757
46678
|
}
|
|
46758
46679
|
|
|
46680
|
+
function parseClips(text) {
|
|
46681
|
+
const clipsArr = text
|
|
46682
|
+
.split('\n')
|
|
46683
|
+
.map((val) => {
|
|
46684
|
+
const matchRes = val.match(/(((\d+:)?\d+:)?\d+) (.+)/i);
|
|
46685
|
+
return matchRes
|
|
46686
|
+
? {
|
|
46687
|
+
start: parseClipTime(matchRes[1]),
|
|
46688
|
+
text: matchRes[4],
|
|
46689
|
+
}
|
|
46690
|
+
: null;
|
|
46691
|
+
})
|
|
46692
|
+
.filter((clip) => clip !== null)
|
|
46693
|
+
.sort((a, b) => a.start - b.start);
|
|
46694
|
+
return clipsArr.map((clip, index) => ({
|
|
46695
|
+
start: clip.start,
|
|
46696
|
+
text: clip.text,
|
|
46697
|
+
end: index < clipsArr.length - 1 ? clipsArr[index + 1].start : 0,
|
|
46698
|
+
}));
|
|
46699
|
+
}
|
|
46700
|
+
function buildSvg(clips, duration, barWidth) {
|
|
46701
|
+
let svg = '<svg width="0" height="0">\n' + '<defs>\n' + '<clipPath id="myClip">\n';
|
|
46702
|
+
let rightEdge = 0;
|
|
46703
|
+
clips.forEach((val) => {
|
|
46704
|
+
const end = val.end || duration;
|
|
46705
|
+
const chunkWidth = Math.round(((end - val.start) * barWidth) / duration);
|
|
46706
|
+
svg += `<rect x="${rightEdge}" y="0" width="${chunkWidth - 2}" height="30"/>\n`;
|
|
46707
|
+
rightEdge += chunkWidth;
|
|
46708
|
+
});
|
|
46709
|
+
if (rightEdge < barWidth) {
|
|
46710
|
+
svg += `<rect x="${rightEdge}" y="0" width="${barWidth - rightEdge}" height="30"/>\n`;
|
|
46711
|
+
}
|
|
46712
|
+
svg += '</clipPath>' + '</defs>' + '</svg>';
|
|
46713
|
+
return svg;
|
|
46714
|
+
}
|
|
46715
|
+
|
|
46716
|
+
const clipsHTML = "<div class=\"media-clip-text\" id=\"clips-text\"></div>";
|
|
46717
|
+
|
|
46718
|
+
const T$d = 'plugins.clips';
|
|
46719
|
+
const VERSION$5 = '2.22.16';
|
|
46720
|
+
const CLAPPR_VERSION = '0.11.4';
|
|
46759
46721
|
/**
|
|
46760
|
-
* `PLUGIN` that
|
|
46722
|
+
* `PLUGIN` that allows marking up the timeline of the video
|
|
46761
46723
|
* @beta
|
|
46762
46724
|
* @remarks
|
|
46725
|
+
* The plugin decorates the seekbar with notches to indicate the clips of the video and displays current clip text in the left panel
|
|
46726
|
+
*
|
|
46763
46727
|
* Depends on:
|
|
46764
46728
|
*
|
|
46765
46729
|
* - {@link MediaControl}
|
|
46766
46730
|
*
|
|
46767
46731
|
* Configuration options - {@link ClipsPluginSettings}
|
|
46768
46732
|
*/
|
|
46769
|
-
class
|
|
46770
|
-
|
|
46771
|
-
|
|
46772
|
-
|
|
46773
|
-
_oldContainer;
|
|
46733
|
+
class Clips extends UICorePlugin {
|
|
46734
|
+
barStyle = null;
|
|
46735
|
+
clips = [];
|
|
46736
|
+
oldContainer;
|
|
46774
46737
|
svgMask = null;
|
|
46738
|
+
static template = tmpl(clipsHTML);
|
|
46775
46739
|
/**
|
|
46776
46740
|
* @internal
|
|
46777
46741
|
*/
|
|
@@ -46783,130 +46747,121 @@ class ClipsPlugin extends UICorePlugin {
|
|
|
46783
46747
|
*/
|
|
46784
46748
|
get attributes() {
|
|
46785
46749
|
return {
|
|
46786
|
-
class:
|
|
46750
|
+
class: 'media-control-clips',
|
|
46787
46751
|
};
|
|
46788
46752
|
}
|
|
46753
|
+
get version() {
|
|
46754
|
+
return VERSION$5;
|
|
46755
|
+
}
|
|
46756
|
+
get supportedVersion() {
|
|
46757
|
+
return { min: CLAPPR_VERSION };
|
|
46758
|
+
}
|
|
46789
46759
|
/**
|
|
46790
46760
|
* @internal
|
|
46791
46761
|
*/
|
|
46792
46762
|
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);
|
|
46763
|
+
this.listenToOnce(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
46798
46764
|
this.listenTo(this.core, Events$1.CORE_RESIZE, this.playerResize);
|
|
46765
|
+
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
|
|
46799
46766
|
}
|
|
46800
|
-
|
|
46767
|
+
render() {
|
|
46768
|
+
trace(`${T$d} render`);
|
|
46801
46769
|
if (!this.options.clips) {
|
|
46802
|
-
this
|
|
46803
|
-
return;
|
|
46770
|
+
return this;
|
|
46804
46771
|
}
|
|
46805
|
-
this.
|
|
46806
|
-
|
|
46807
|
-
|
|
46808
|
-
this._bindContainerEvents();
|
|
46772
|
+
this.$el.html(Clips.template());
|
|
46773
|
+
this.$el.hide();
|
|
46774
|
+
return this;
|
|
46809
46775
|
}
|
|
46810
|
-
|
|
46811
|
-
this.
|
|
46812
|
-
|
|
46813
|
-
this.
|
|
46776
|
+
destroy() {
|
|
46777
|
+
if (this.barStyle) {
|
|
46778
|
+
this.barStyle.remove();
|
|
46779
|
+
this.barStyle = null;
|
|
46814
46780
|
}
|
|
46781
|
+
return super.destroy();
|
|
46815
46782
|
}
|
|
46816
|
-
|
|
46817
|
-
if (this.
|
|
46818
|
-
this.
|
|
46783
|
+
disable() {
|
|
46784
|
+
if (this.barStyle) {
|
|
46785
|
+
this.barStyle.remove();
|
|
46786
|
+
this.barStyle = null;
|
|
46819
46787
|
}
|
|
46788
|
+
return super.disable();
|
|
46789
|
+
}
|
|
46790
|
+
enable() {
|
|
46791
|
+
this.render();
|
|
46792
|
+
return super.enable();
|
|
46793
|
+
}
|
|
46794
|
+
onCoreReady() {
|
|
46795
|
+
trace(`${T$d} onCoreReady`);
|
|
46820
46796
|
const mediaControl = this.core.getPlugin('media_control');
|
|
46821
|
-
|
|
46822
|
-
this.
|
|
46823
|
-
this.listenTo(mediaControl
|
|
46797
|
+
assert(mediaControl, 'media_control plugin is required');
|
|
46798
|
+
this.parseClips(this.options.clips.text);
|
|
46799
|
+
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMcRender);
|
|
46800
|
+
}
|
|
46801
|
+
onMcRender() {
|
|
46802
|
+
trace(`${T$d} onMcRender`);
|
|
46803
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
46804
|
+
mediaControl.mount('clips', this.$el);
|
|
46805
|
+
}
|
|
46806
|
+
onContainerChanged() {
|
|
46807
|
+
trace(`${T$d} onContainerChanged`);
|
|
46808
|
+
// TODO figure out the conditions of changing the container (without destroying the previous one)
|
|
46809
|
+
if (this.oldContainer) {
|
|
46810
|
+
this.stopListening(this.oldContainer, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
46811
|
+
}
|
|
46812
|
+
this.oldContainer = this.core.activeContainer;
|
|
46813
|
+
if (this.svgMask) {
|
|
46814
|
+
this.svgMask.remove();
|
|
46815
|
+
this.svgMask = null;
|
|
46816
|
+
}
|
|
46817
|
+
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
46818
|
+
}
|
|
46819
|
+
playerResize() {
|
|
46820
|
+
const duration = this.core.activeContainer.getDuration();
|
|
46821
|
+
if (duration) {
|
|
46822
|
+
this.makeSvg(duration);
|
|
46823
|
+
}
|
|
46824
46824
|
}
|
|
46825
46825
|
onTimeUpdate(event) {
|
|
46826
|
-
if (!this.
|
|
46827
|
-
this.duration = event.total;
|
|
46826
|
+
if (!this.svgMask) {
|
|
46828
46827
|
this.makeSvg(event.total);
|
|
46829
|
-
this.durationGetting = true;
|
|
46830
46828
|
}
|
|
46831
|
-
for (const value of this.clips
|
|
46832
|
-
if (event.current >= value.start &&
|
|
46829
|
+
for (const value of this.clips) {
|
|
46830
|
+
if ((event.current >= value.start && !value.end) ||
|
|
46831
|
+
event.current < value.end) {
|
|
46833
46832
|
this.setClipText(value.text);
|
|
46834
46833
|
break;
|
|
46835
46834
|
}
|
|
46836
46835
|
}
|
|
46837
46836
|
}
|
|
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 '';
|
|
46837
|
+
parseClips(text) {
|
|
46838
|
+
this.clips = parseClips(text);
|
|
46873
46839
|
}
|
|
46874
46840
|
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>';
|
|
46841
|
+
const svg = buildSvg(this.clips, duration, this.core.activeContainer.$el.width());
|
|
46889
46842
|
this.setSVGMask(svg);
|
|
46890
46843
|
}
|
|
46891
46844
|
setSVGMask(svg) {
|
|
46892
|
-
// this.core.mediaControl.setSVGMask(svg);
|
|
46893
46845
|
if (this.svgMask) {
|
|
46894
46846
|
this.svgMask.remove();
|
|
46895
46847
|
}
|
|
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
46848
|
this.svgMask = $(svg);
|
|
46902
|
-
|
|
46849
|
+
this.$el.append(this.svgMask);
|
|
46850
|
+
if (!this.barStyle) {
|
|
46851
|
+
this.barStyle = document.createElement('style');
|
|
46852
|
+
this.barStyle.textContent = `
|
|
46853
|
+
.bar-container[data-seekbar] {
|
|
46854
|
+
clip-path: url("#myClip");
|
|
46855
|
+
}`;
|
|
46856
|
+
this.$el.append(this.barStyle);
|
|
46857
|
+
}
|
|
46903
46858
|
}
|
|
46904
46859
|
setClipText(text) {
|
|
46905
|
-
|
|
46906
|
-
|
|
46907
|
-
|
|
46908
|
-
|
|
46909
|
-
|
|
46860
|
+
if (text) {
|
|
46861
|
+
this.$el.show().find('#clips-text').text(text);
|
|
46862
|
+
}
|
|
46863
|
+
else {
|
|
46864
|
+
this.$el.hide();
|
|
46910
46865
|
}
|
|
46911
46866
|
}
|
|
46912
46867
|
}
|
|
@@ -46933,7 +46888,7 @@ class ContextMenu extends UIContainerPlugin {
|
|
|
46933
46888
|
* @internal
|
|
46934
46889
|
*/
|
|
46935
46890
|
get supportedVersion() {
|
|
46936
|
-
return { min: CLAPPR_VERSION };
|
|
46891
|
+
return { min: CLAPPR_VERSION$1 };
|
|
46937
46892
|
}
|
|
46938
46893
|
/**
|
|
46939
46894
|
* @internal
|
|
@@ -47054,7 +47009,7 @@ class DvrControls extends UICorePlugin {
|
|
|
47054
47009
|
* @internal
|
|
47055
47010
|
*/
|
|
47056
47011
|
get supportedVersion() {
|
|
47057
|
-
return { min: CLAPPR_VERSION };
|
|
47012
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47058
47013
|
}
|
|
47059
47014
|
/**
|
|
47060
47015
|
* @internal
|
|
@@ -47161,7 +47116,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
47161
47116
|
* @internal
|
|
47162
47117
|
*/
|
|
47163
47118
|
get supportedVersion() {
|
|
47164
|
-
return { min: CLAPPR_VERSION };
|
|
47119
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47165
47120
|
}
|
|
47166
47121
|
static template = tmpl(templateHtml);
|
|
47167
47122
|
/**
|
|
@@ -47286,7 +47241,7 @@ class Favicon extends CorePlugin {
|
|
|
47286
47241
|
* @internal
|
|
47287
47242
|
*/
|
|
47288
47243
|
get supportedVersion() {
|
|
47289
|
-
return { min: CLAPPR_VERSION };
|
|
47244
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47290
47245
|
}
|
|
47291
47246
|
/**
|
|
47292
47247
|
* @internal
|
|
@@ -47378,7 +47333,7 @@ class GoogleAnalytics extends ContainerPlugin {
|
|
|
47378
47333
|
return 'google_analytics';
|
|
47379
47334
|
}
|
|
47380
47335
|
get supportedVersion() {
|
|
47381
|
-
return { min: CLAPPR_VERSION };
|
|
47336
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47382
47337
|
}
|
|
47383
47338
|
constructor(container) {
|
|
47384
47339
|
super(container);
|
|
@@ -47525,7 +47480,7 @@ class Logo extends UIContainerPlugin {
|
|
|
47525
47480
|
return 'logo';
|
|
47526
47481
|
}
|
|
47527
47482
|
get supportedVersion() {
|
|
47528
|
-
return { min: CLAPPR_VERSION };
|
|
47483
|
+
return { min: CLAPPR_VERSION$1 };
|
|
47529
47484
|
}
|
|
47530
47485
|
get template() {
|
|
47531
47486
|
return tmpl(logoHTML);
|
|
@@ -47915,7 +47870,7 @@ const FullscreenIOS = {
|
|
|
47915
47870
|
},
|
|
47916
47871
|
};
|
|
47917
47872
|
|
|
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
|
|
47873
|
+
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
47874
|
|
|
47920
47875
|
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
47876
|
|
|
@@ -48005,8 +47960,6 @@ class MediaControl extends UICorePlugin {
|
|
|
48005
47960
|
userDisabled = false;
|
|
48006
47961
|
userKeepVisible = false;
|
|
48007
47962
|
verticalVolume = false;
|
|
48008
|
-
$clipText = null;
|
|
48009
|
-
$clipTextContainer = null;
|
|
48010
47963
|
$duration = null;
|
|
48011
47964
|
$fullscreenToggle = null;
|
|
48012
47965
|
$multiCameraSelector = null;
|
|
@@ -48035,7 +47988,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48035
47988
|
* @internal
|
|
48036
47989
|
*/
|
|
48037
47990
|
get supportedVersion() {
|
|
48038
|
-
return { min: CLAPPR_VERSION };
|
|
47991
|
+
return { min: CLAPPR_VERSION$1 };
|
|
48039
47992
|
}
|
|
48040
47993
|
get disabled() {
|
|
48041
47994
|
const playbackIsNOOP = this.core.activeContainer &&
|
|
@@ -48198,7 +48151,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48198
48151
|
this.userDisabled = true; // TODO distinguish between user and system (e.g., unplayable) disabled?
|
|
48199
48152
|
this.hide();
|
|
48200
48153
|
this.unbindKeyEvents();
|
|
48201
|
-
this.$el.hide();
|
|
48154
|
+
this.$el.hide(); // TODO why?
|
|
48202
48155
|
}
|
|
48203
48156
|
/**
|
|
48204
48157
|
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
@@ -48657,16 +48610,16 @@ class MediaControl extends UICorePlugin {
|
|
|
48657
48610
|
right: [],
|
|
48658
48611
|
}, this.core.activeContainer.settings);
|
|
48659
48612
|
trace(`${T$a} updateSettings`, { newSettings });
|
|
48613
|
+
newSettings.left.push('clips'); // TODO
|
|
48660
48614
|
// TODO make order controlled via CSS
|
|
48661
|
-
newSettings.left = orderByOrderPattern([...newSettings.left, '
|
|
48615
|
+
newSettings.left = orderByOrderPattern([...newSettings.left, 'volume', 'clips'], LEFT_ORDER);
|
|
48662
48616
|
if (this.core.activePlayback.getPlaybackType() === Playback.LIVE &&
|
|
48663
48617
|
this.core.activePlayback.dvrEnabled) {
|
|
48664
48618
|
newSettings.left.push('dvr');
|
|
48665
48619
|
}
|
|
48666
48620
|
// actual order of the items appear rendered is controlled by CSS
|
|
48667
48621
|
newSettings.right = DEFAULT_SETTINGS.right; // TODO get from the options
|
|
48668
|
-
if ((!this.fullScreenOnVideoTagSupported &&
|
|
48669
|
-
!fullscreenEnabled()) ||
|
|
48622
|
+
if ((!this.fullScreenOnVideoTagSupported && !fullscreenEnabled()) ||
|
|
48670
48623
|
this.options.fullscreenDisable) {
|
|
48671
48624
|
trace(`${T$a} updateSettings removing fullscreen`, {
|
|
48672
48625
|
supported: this.fullScreenOnVideoTagSupported,
|
|
@@ -48713,8 +48666,6 @@ class MediaControl extends UICorePlugin {
|
|
|
48713
48666
|
this.$volumeBarFill = this.$el.find('.bar-fill-1[data-volume]');
|
|
48714
48667
|
this.$volumeBarScrubber = this.$el.find('.bar-scrubber[data-volume]');
|
|
48715
48668
|
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
48669
|
this.resetIndicators();
|
|
48719
48670
|
this.initializeIcons();
|
|
48720
48671
|
}
|
|
@@ -48729,25 +48680,14 @@ class MediaControl extends UICorePlugin {
|
|
|
48729
48680
|
* ```ts
|
|
48730
48681
|
* class MyPlugin extends UICorePlugin {
|
|
48731
48682
|
* override render() {
|
|
48732
|
-
*
|
|
48733
|
-
*
|
|
48734
|
-
* clipText?.el.text('Here we go')
|
|
48683
|
+
* this.$el.html('<div data-clips>Here we go</div>')
|
|
48684
|
+
* this.core.getPlugin('media_control').mount('clips', this.$el)
|
|
48735
48685
|
* return this
|
|
48736
48686
|
* }
|
|
48737
48687
|
* }
|
|
48738
48688
|
* ```
|
|
48739
48689
|
*/
|
|
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) {
|
|
48690
|
+
mount(name, element) {
|
|
48751
48691
|
const panel = this.getElementLocation(name);
|
|
48752
48692
|
trace(`${T$a} putElement`, { name, panel: !!panel });
|
|
48753
48693
|
if (panel) {
|
|
@@ -48766,6 +48706,9 @@ class MediaControl extends UICorePlugin {
|
|
|
48766
48706
|
return;
|
|
48767
48707
|
}
|
|
48768
48708
|
}
|
|
48709
|
+
putElement(name, element) {
|
|
48710
|
+
this.mount(name, element);
|
|
48711
|
+
}
|
|
48769
48712
|
/**
|
|
48770
48713
|
* Toggle the visibility of a media control element
|
|
48771
48714
|
* @param name - The name of the media control element
|
|
@@ -48815,11 +48758,11 @@ class MediaControl extends UICorePlugin {
|
|
|
48815
48758
|
if (!this.settings.seekEnabled) {
|
|
48816
48759
|
return;
|
|
48817
48760
|
}
|
|
48818
|
-
const currentTime = this.
|
|
48819
|
-
const duration = this.
|
|
48761
|
+
const currentTime = this.core.activeContainer.getCurrentTime();
|
|
48762
|
+
const duration = this.core.activeContainer.getDuration();
|
|
48820
48763
|
let position = Math.min(Math.max(currentTime + delta, 0), duration);
|
|
48821
48764
|
position = Math.min((position * 100) / duration, 100);
|
|
48822
|
-
this.
|
|
48765
|
+
this.core.activeContainer.seekPercentage(position);
|
|
48823
48766
|
}
|
|
48824
48767
|
bindKeyAndShow(key, callback) {
|
|
48825
48768
|
// TODO or boolean return type
|
|
@@ -48937,7 +48880,10 @@ class MediaControl extends UICorePlugin {
|
|
|
48937
48880
|
* @internal
|
|
48938
48881
|
*/
|
|
48939
48882
|
render() {
|
|
48940
|
-
trace(`${T$a} render`, {
|
|
48883
|
+
trace(`${T$a} render`, {
|
|
48884
|
+
needsUpdate: this.hasUpdate,
|
|
48885
|
+
metadataLoaded: this.metadataLoaded,
|
|
48886
|
+
});
|
|
48941
48887
|
if (!this.hasUpdate || !this.metadataLoaded) {
|
|
48942
48888
|
return this;
|
|
48943
48889
|
}
|
|
@@ -49093,8 +49039,7 @@ MediaControl.extend = function (properties) {
|
|
|
49093
49039
|
return extend(MediaControl, properties);
|
|
49094
49040
|
};
|
|
49095
49041
|
function serializeSettings(s) {
|
|
49096
|
-
return s.left
|
|
49097
|
-
.slice()
|
|
49042
|
+
return s.left.slice()
|
|
49098
49043
|
.sort()
|
|
49099
49044
|
.concat(s.right.slice().sort())
|
|
49100
49045
|
.concat(s.default.slice().sort())
|
|
@@ -49126,7 +49071,7 @@ class MultiCamera extends UICorePlugin {
|
|
|
49126
49071
|
return 'multicamera';
|
|
49127
49072
|
}
|
|
49128
49073
|
get supportedVersion() {
|
|
49129
|
-
return { min: CLAPPR_VERSION };
|
|
49074
|
+
return { min: CLAPPR_VERSION$1 };
|
|
49130
49075
|
}
|
|
49131
49076
|
static get version() {
|
|
49132
49077
|
return VERSION$4;
|
|
@@ -49486,7 +49431,7 @@ class PictureInPicture extends UICorePlugin {
|
|
|
49486
49431
|
* @internal
|
|
49487
49432
|
*/
|
|
49488
49433
|
get supportedVersion() {
|
|
49489
|
-
return { min: CLAPPR_VERSION };
|
|
49434
|
+
return { min: CLAPPR_VERSION$1 };
|
|
49490
49435
|
}
|
|
49491
49436
|
/**
|
|
49492
49437
|
* @internal
|
|
@@ -49633,7 +49578,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49633
49578
|
* @internal
|
|
49634
49579
|
*/
|
|
49635
49580
|
get supportedVersion() {
|
|
49636
|
-
return { min: CLAPPR_VERSION };
|
|
49581
|
+
return { min: CLAPPR_VERSION$1 };
|
|
49637
49582
|
}
|
|
49638
49583
|
static buttonTemplate = tmpl(buttonHtml$1);
|
|
49639
49584
|
static listTemplate = tmpl(listHtml$1);
|
|
@@ -49916,7 +49861,7 @@ class Poster extends UIContainerPlugin {
|
|
|
49916
49861
|
* @internal
|
|
49917
49862
|
*/
|
|
49918
49863
|
get supportedVersion() {
|
|
49919
|
-
return { min: CLAPPR_VERSION };
|
|
49864
|
+
return { min: CLAPPR_VERSION$1 };
|
|
49920
49865
|
}
|
|
49921
49866
|
static template = tmpl(posterHTML);
|
|
49922
49867
|
get shouldRender() {
|
|
@@ -50143,7 +50088,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50143
50088
|
|
|
50144
50089
|
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
50090
|
|
|
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=\"#\"
|
|
50091
|
+
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
50092
|
|
|
50148
50093
|
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
50094
|
|
|
@@ -50193,7 +50138,7 @@ class QualityLevels extends UICorePlugin {
|
|
|
50193
50138
|
* @internal
|
|
50194
50139
|
*/
|
|
50195
50140
|
get supportedVersion() {
|
|
50196
|
-
return { min: CLAPPR_VERSION };
|
|
50141
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50197
50142
|
}
|
|
50198
50143
|
/**
|
|
50199
50144
|
* @internal
|
|
@@ -50430,7 +50375,7 @@ class SeekTime extends UICorePlugin {
|
|
|
50430
50375
|
return 'seek_time';
|
|
50431
50376
|
}
|
|
50432
50377
|
get supportedVersion() {
|
|
50433
|
-
return { min: CLAPPR_VERSION };
|
|
50378
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50434
50379
|
}
|
|
50435
50380
|
get template() {
|
|
50436
50381
|
return tmpl(seekTimeHTML);
|
|
@@ -50592,7 +50537,7 @@ class Share extends UICorePlugin {
|
|
|
50592
50537
|
return 'share';
|
|
50593
50538
|
}
|
|
50594
50539
|
get supportedVersion() {
|
|
50595
|
-
return { min: CLAPPR_VERSION };
|
|
50540
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50596
50541
|
}
|
|
50597
50542
|
get template() {
|
|
50598
50543
|
return tmpl(pluginHtml$2);
|
|
@@ -50711,7 +50656,7 @@ class SkipTime extends UICorePlugin {
|
|
|
50711
50656
|
return 'skip_time';
|
|
50712
50657
|
}
|
|
50713
50658
|
get supportedVersion() {
|
|
50714
|
-
return { min: CLAPPR_VERSION };
|
|
50659
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50715
50660
|
}
|
|
50716
50661
|
get container() {
|
|
50717
50662
|
return this.core && this.core.activeContainer;
|
|
@@ -50830,7 +50775,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
50830
50775
|
* @internal
|
|
50831
50776
|
*/
|
|
50832
50777
|
get supportedVersion() {
|
|
50833
|
-
return { min: CLAPPR_VERSION };
|
|
50778
|
+
return { min: CLAPPR_VERSION$1 };
|
|
50834
50779
|
}
|
|
50835
50780
|
/**
|
|
50836
50781
|
* @internal
|
|
@@ -51064,7 +51009,7 @@ class SourceController extends CorePlugin {
|
|
|
51064
51009
|
* @internal
|
|
51065
51010
|
*/
|
|
51066
51011
|
get supportedVersion() {
|
|
51067
|
-
return { min: CLAPPR_VERSION };
|
|
51012
|
+
return { min: CLAPPR_VERSION$1 };
|
|
51068
51013
|
}
|
|
51069
51014
|
/**
|
|
51070
51015
|
* @param core - The Clappr core instance.
|
|
@@ -51249,7 +51194,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51249
51194
|
* @internal
|
|
51250
51195
|
*/
|
|
51251
51196
|
get supportedVersion() {
|
|
51252
|
-
return { min: CLAPPR_VERSION };
|
|
51197
|
+
return { min: CLAPPR_VERSION$1 };
|
|
51253
51198
|
}
|
|
51254
51199
|
/**
|
|
51255
51200
|
* @internal
|
|
@@ -51595,7 +51540,7 @@ class Telemetry extends ContainerPlugin {
|
|
|
51595
51540
|
* The supported version of the plugin.
|
|
51596
51541
|
*/
|
|
51597
51542
|
get supportedVersion() {
|
|
51598
|
-
return { min: CLAPPR_VERSION };
|
|
51543
|
+
return { min: CLAPPR_VERSION$1 };
|
|
51599
51544
|
}
|
|
51600
51545
|
started = false;
|
|
51601
51546
|
timeStart = 0;
|
|
@@ -51882,7 +51827,7 @@ class Thumbnails extends UICorePlugin {
|
|
|
51882
51827
|
* @internal
|
|
51883
51828
|
*/
|
|
51884
51829
|
get supportedVersion() {
|
|
51885
|
-
return { min: CLAPPR_VERSION };
|
|
51830
|
+
return { min: CLAPPR_VERSION$1 };
|
|
51886
51831
|
}
|
|
51887
51832
|
/**
|
|
51888
51833
|
* @internal
|
|
@@ -52381,4 +52326,4 @@ class VolumeFade extends UICorePlugin {
|
|
|
52381
52326
|
}
|
|
52382
52327
|
}
|
|
52383
52328
|
|
|
52384
|
-
export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, ClapprNerdStats, ClapprStats, ClickToPause,
|
|
52329
|
+
export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, NerdStats as ClapprNerdStats, ClapprStats, ClickToPause, Clips, ClosedCaptions, ContextMenu, DvrControls, ErrorScreen, Favicon, GearEvents, GoogleAnalytics, QualityLevels as LevelSelector, LogTracer, Logger, Logo, MediaControl, MultiCamera, NerdStats, PictureInPicture, PlaybackErrorCode, PlaybackRate, Player, PlayerEvent, Poster, QualityLevels, SeekTime, SentryTracer, Share, SkipTime, SourceController, SpinnerThreeBounce as Spinner, SpinnerEvents, SpinnerThreeBounce, ClosedCaptions as Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents, reportError, setTracer, trace, version };
|