@gcorevideo/player 2.24.10 → 2.24.13
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/README.md +1 -0
- package/assets/dvr-controls/dvr_controls.scss +43 -80
- package/assets/dvr-controls/index.ejs +8 -2
- package/assets/media-control/width370.scss +1 -1
- package/dist/core.js +34 -23
- package/dist/index.css +394 -420
- package/dist/index.embed.js +107 -71
- package/dist/index.js +172 -134
- package/dist/player.d.ts +3264 -0
- package/lib/playback/dash-playback/DashPlayback.d.ts +2 -0
- package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
- package/lib/playback/dash-playback/DashPlayback.js +17 -11
- package/lib/playback/hls-playback/HlsPlayback.d.ts +6 -2
- package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
- package/lib/playback/hls-playback/HlsPlayback.js +16 -11
- package/lib/plugins/audio-selector/AudioTracks.js +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +1 -1
- package/lib/plugins/clips/Clips.js +1 -1
- package/lib/plugins/dvr-controls/DvrControls.d.ts +3 -3
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.js +14 -12
- package/lib/plugins/media-control/MediaControl.d.ts +14 -5
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +55 -29
- package/lib/plugins/picture-in-picture/PictureInPicture.js +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.js +1 -1
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +2 -0
- package/package.json +1 -1
- package/src/playback/dash-playback/DashPlayback.ts +20 -13
- package/src/playback/hls-playback/HlsPlayback.ts +40 -26
- package/src/plugins/audio-selector/AudioTracks.ts +1 -1
- package/src/plugins/audio-selector/__tests__/AudioTracks.test.ts +2 -2
- package/src/plugins/bottom-gear/BottomGear.ts +1 -1
- package/src/plugins/bottom-gear/__tests__/BottomGear.test.ts +2 -2
- package/src/plugins/clips/Clips.ts +1 -1
- package/src/plugins/clips/__tests__/Clips.test.ts +1 -1
- package/src/plugins/dvr-controls/DvrControls.ts +14 -14
- package/src/plugins/dvr-controls/__tests__/DvrControls.test.ts +20 -17
- package/src/plugins/dvr-controls/__tests__/__snapshots__/DvrControls.test.ts.snap +4 -2
- package/src/plugins/media-control/MediaControl.ts +69 -35
- package/src/plugins/media-control/__tests__/MediaControl.test.ts +128 -112
- package/src/plugins/media-control/__tests__/__snapshots__/MediaControl.test.ts.snap +227 -24
- package/src/plugins/picture-in-picture/PictureInPicture.ts +1 -1
- package/src/plugins/subtitles/ClosedCaptions.ts +1 -1
- package/src/plugins/subtitles/__tests__/ClosedCaptions.test.ts +1 -1
- package/src/testUtils.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -12680,7 +12680,7 @@ var PlaybackEvents;
|
|
|
12680
12680
|
// https://github.com/clappr/clappr/blob/8752995ea439321ac7ca3cd35e8c64de7a3c3d17/LICENSE
|
|
12681
12681
|
const AUTO$1 = -1;
|
|
12682
12682
|
const { now: now$2 } = Utils;
|
|
12683
|
-
const T$
|
|
12683
|
+
const T$o = 'playback.dash';
|
|
12684
12684
|
class DashPlayback extends BasePlayback {
|
|
12685
12685
|
_levels = null;
|
|
12686
12686
|
_currentLevel = null;
|
|
@@ -12871,10 +12871,9 @@ class DashPlayback extends BasePlayback {
|
|
|
12871
12871
|
return super.render();
|
|
12872
12872
|
}
|
|
12873
12873
|
_ready() {
|
|
12874
|
-
this.
|
|
12875
|
-
|
|
12874
|
+
!this._dash && this._setup();
|
|
12875
|
+
super._ready();
|
|
12876
12876
|
}
|
|
12877
|
-
// override
|
|
12878
12877
|
_setupSrc() {
|
|
12879
12878
|
// this playback manages the src on the video element itself
|
|
12880
12879
|
}
|
|
@@ -12955,10 +12954,10 @@ class DashPlayback extends BasePlayback {
|
|
|
12955
12954
|
}
|
|
12956
12955
|
_onPlaybackError = (event) => {
|
|
12957
12956
|
// TODO
|
|
12958
|
-
trace(`${T$
|
|
12957
|
+
trace(`${T$o} _onPlaybackError`, { event });
|
|
12959
12958
|
};
|
|
12960
12959
|
_onDASHJSSError = (event) => {
|
|
12961
|
-
trace(`${T$
|
|
12960
|
+
trace(`${T$o} _onDASHJSSError`, { event });
|
|
12962
12961
|
this._stopTimeUpdateTimer();
|
|
12963
12962
|
// Note that the other error types are deprecated
|
|
12964
12963
|
const e = event.error;
|
|
@@ -12993,7 +12992,7 @@ class DashPlayback extends BasePlayback {
|
|
|
12993
12992
|
}
|
|
12994
12993
|
};
|
|
12995
12994
|
triggerError(error) {
|
|
12996
|
-
trace(`${T$
|
|
12995
|
+
trace(`${T$o} triggerError`, { error });
|
|
12997
12996
|
// this triggers Events.ERROR to be handled by the UI
|
|
12998
12997
|
this.trigger(Events$1.PLAYBACK_ERROR, this.createError(error, {
|
|
12999
12998
|
useCodePrefix: false,
|
|
@@ -13032,10 +13031,10 @@ class DashPlayback extends BasePlayback {
|
|
|
13032
13031
|
}
|
|
13033
13032
|
get dvrEnabled() {
|
|
13034
13033
|
if (!this._dash) {
|
|
13035
|
-
trace(`${T$
|
|
13034
|
+
trace(`${T$o} dvrEnable no dash player instance`);
|
|
13036
13035
|
return false;
|
|
13037
13036
|
}
|
|
13038
|
-
trace(`${T$
|
|
13037
|
+
trace(`${T$o} get.dvrEnabled`, {
|
|
13039
13038
|
dvrWindowSize: this._dash?.getDVRWindowSize(),
|
|
13040
13039
|
minDvrSize: this._minDvrSize,
|
|
13041
13040
|
playbackType: this.getPlaybackType(),
|
|
@@ -13057,10 +13056,8 @@ class DashPlayback extends BasePlayback {
|
|
|
13057
13056
|
this.trigger(Events$1.PLAYBACK_PROGRESS, progress, {});
|
|
13058
13057
|
}
|
|
13059
13058
|
play() {
|
|
13060
|
-
trace(`${T$
|
|
13061
|
-
|
|
13062
|
-
this._setup();
|
|
13063
|
-
}
|
|
13059
|
+
trace(`${T$o} play`, { dash: !!this._dash });
|
|
13060
|
+
!this._dash && this._setup();
|
|
13064
13061
|
super.play();
|
|
13065
13062
|
this._startTimeUpdateTimer();
|
|
13066
13063
|
}
|
|
@@ -13076,20 +13073,22 @@ class DashPlayback extends BasePlayback {
|
|
|
13076
13073
|
stop() {
|
|
13077
13074
|
if (this._dash) {
|
|
13078
13075
|
this._stopTimeUpdateTimer();
|
|
13079
|
-
this.
|
|
13076
|
+
this.destroyInstance();
|
|
13080
13077
|
super.stop();
|
|
13081
|
-
this._dash = null;
|
|
13082
13078
|
}
|
|
13083
13079
|
}
|
|
13084
|
-
|
|
13085
|
-
this._stopTimeUpdateTimer();
|
|
13080
|
+
destroyInstance() {
|
|
13086
13081
|
if (this._dash) {
|
|
13087
13082
|
this._dash.off(DASHJS.MediaPlayer.events.ERROR, this._onDASHJSSError);
|
|
13088
13083
|
this._dash.off(DASHJS.MediaPlayer.events.PLAYBACK_ERROR, this._onPlaybackError);
|
|
13089
13084
|
this._dash.off(DASHJS.MediaPlayer.events.MANIFEST_LOADED, this.getDuration);
|
|
13090
13085
|
this._dash.reset();
|
|
13086
|
+
this._dash = null;
|
|
13091
13087
|
}
|
|
13092
|
-
|
|
13088
|
+
}
|
|
13089
|
+
destroy() {
|
|
13090
|
+
this._stopTimeUpdateTimer();
|
|
13091
|
+
this.destroyInstance();
|
|
13093
13092
|
return super.destroy();
|
|
13094
13093
|
}
|
|
13095
13094
|
_updatePlaybackType() {
|
|
@@ -13143,7 +13142,7 @@ class DashPlayback extends BasePlayback {
|
|
|
13143
13142
|
}
|
|
13144
13143
|
// @ts-expect-error
|
|
13145
13144
|
get currentAudioTrack() {
|
|
13146
|
-
trace(`${T$
|
|
13145
|
+
trace(`${T$o} get currentAudioTrack`);
|
|
13147
13146
|
assert.ok(this._dash, 'DASH.js MediaPlayer is not initialized');
|
|
13148
13147
|
const t = this._dash.getCurrentTrackFor('audio');
|
|
13149
13148
|
if (!t) {
|
|
@@ -13158,6 +13157,13 @@ class DashPlayback extends BasePlayback {
|
|
|
13158
13157
|
assert.ok(track, 'Invalid audio track ID');
|
|
13159
13158
|
this._dash.setCurrentTrack(track);
|
|
13160
13159
|
}
|
|
13160
|
+
load(srcUrl) {
|
|
13161
|
+
this._stopTimeUpdateTimer();
|
|
13162
|
+
this.options.src = srcUrl;
|
|
13163
|
+
// TODO destroy the instance first?
|
|
13164
|
+
this.destroyInstance();
|
|
13165
|
+
this._setup();
|
|
13166
|
+
}
|
|
13161
13167
|
checkAudioTracks() {
|
|
13162
13168
|
// @ts-ignore
|
|
13163
13169
|
const tracks = this._dash.getTracksFor('audio');
|
|
@@ -41844,7 +41850,7 @@ const AUTO = -1;
|
|
|
41844
41850
|
const DEFAULT_RECOVER_ATTEMPTS = 16;
|
|
41845
41851
|
Events$1.register('PLAYBACK_FRAGMENT_CHANGED');
|
|
41846
41852
|
Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
|
|
41847
|
-
const T$
|
|
41853
|
+
const T$n = 'playback.hls';
|
|
41848
41854
|
class HlsPlayback extends BasePlayback {
|
|
41849
41855
|
_ccIsSetup = false;
|
|
41850
41856
|
_ccTracksUpdated = false;
|
|
@@ -41854,7 +41860,6 @@ class HlsPlayback extends BasePlayback {
|
|
|
41854
41860
|
_extrapolatedWindowNumSegments = 0; // TODO
|
|
41855
41861
|
highDefinition = false;
|
|
41856
41862
|
_hls = null;
|
|
41857
|
-
_isReadyState = false;
|
|
41858
41863
|
_lastDuration = null;
|
|
41859
41864
|
_lastTimeUpdate = null;
|
|
41860
41865
|
_levels = null;
|
|
@@ -41871,9 +41876,15 @@ class HlsPlayback extends BasePlayback {
|
|
|
41871
41876
|
_recoveredDecodingError = false;
|
|
41872
41877
|
_segmentTargetDuration = null;
|
|
41873
41878
|
_timeUpdateTimer = null;
|
|
41879
|
+
/**
|
|
41880
|
+
* @internal
|
|
41881
|
+
*/
|
|
41874
41882
|
get name() {
|
|
41875
41883
|
return 'hls';
|
|
41876
41884
|
}
|
|
41885
|
+
/**
|
|
41886
|
+
* @internal
|
|
41887
|
+
*/
|
|
41877
41888
|
get supportedVersion() {
|
|
41878
41889
|
return { min: CLAPPR_VERSION$1 };
|
|
41879
41890
|
}
|
|
@@ -41883,9 +41894,6 @@ class HlsPlayback extends BasePlayback {
|
|
|
41883
41894
|
get currentLevel() {
|
|
41884
41895
|
return this._currentLevel ?? AUTO;
|
|
41885
41896
|
}
|
|
41886
|
-
get isReady() {
|
|
41887
|
-
return this._isReadyState;
|
|
41888
|
-
}
|
|
41889
41897
|
set currentLevel(id) {
|
|
41890
41898
|
this._currentLevel = id;
|
|
41891
41899
|
this.trigger(Events$1.PLAYBACK_LEVEL_SWITCH_START);
|
|
@@ -42072,8 +42080,9 @@ class HlsPlayback extends BasePlayback {
|
|
|
42072
42080
|
const config = $.extend(true, {
|
|
42073
42081
|
maxBufferLength: 2,
|
|
42074
42082
|
maxMaxBufferLength: 4,
|
|
42083
|
+
autoStartLoad: false,
|
|
42075
42084
|
}, this.options.playback.hlsjsConfig);
|
|
42076
|
-
trace(`${T$
|
|
42085
|
+
trace(`${T$n} _createHLSInstance`, { config });
|
|
42077
42086
|
this._hls = new Hls(config);
|
|
42078
42087
|
}
|
|
42079
42088
|
_attachHLSMedia() {
|
|
@@ -42090,6 +42099,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42090
42099
|
assert.ok(this._hls, 'HLS.js is not initialized');
|
|
42091
42100
|
this.options.hlsPlayback.preload && this._hls.loadSource(this.options.src);
|
|
42092
42101
|
});
|
|
42102
|
+
// TODO drop?
|
|
42093
42103
|
const onPlaying = () => {
|
|
42094
42104
|
if (this._hls) {
|
|
42095
42105
|
this._hls.config.maxBufferLength =
|
|
@@ -42100,8 +42110,13 @@ class HlsPlayback extends BasePlayback {
|
|
|
42100
42110
|
this.el.removeEventListener('playing', onPlaying);
|
|
42101
42111
|
};
|
|
42102
42112
|
this.el.addEventListener('playing', onPlaying);
|
|
42103
|
-
this._hls.on(Hls.Events.MANIFEST_PARSED, () =>
|
|
42104
|
-
|
|
42113
|
+
this._hls.on(Hls.Events.MANIFEST_PARSED, () => {
|
|
42114
|
+
this._manifestParsed = true;
|
|
42115
|
+
this._hls.startLoad(-1);
|
|
42116
|
+
});
|
|
42117
|
+
this._hls.on(Hls.Events.LEVEL_LOADED, (evt, data) => {
|
|
42118
|
+
this._updatePlaybackType(evt, data);
|
|
42119
|
+
});
|
|
42105
42120
|
this._hls.on(Hls.Events.LEVEL_UPDATED, (evt, data) => this._onLevelUpdated(evt, data));
|
|
42106
42121
|
this._hls.on(Hls.Events.LEVEL_SWITCHING, (evt, data) => this._onLevelSwitch(evt, data));
|
|
42107
42122
|
this._hls.on(Hls.Events.LEVEL_SWITCHED, (evt, data) => this._onLevelSwitched(evt, data));
|
|
@@ -42144,12 +42159,8 @@ class HlsPlayback extends BasePlayback {
|
|
|
42144
42159
|
return super.render();
|
|
42145
42160
|
}
|
|
42146
42161
|
_ready() {
|
|
42147
|
-
if (this._isReadyState) {
|
|
42148
|
-
return;
|
|
42149
|
-
}
|
|
42150
42162
|
!this._hls && this._setup();
|
|
42151
|
-
|
|
42152
|
-
this.trigger(Events$1.PLAYBACK_READY, this.name);
|
|
42163
|
+
super._ready();
|
|
42153
42164
|
}
|
|
42154
42165
|
_recover(evt, data, error) {
|
|
42155
42166
|
assert(this._hls, 'HLS.js is not initialized');
|
|
@@ -42164,7 +42175,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42164
42175
|
}
|
|
42165
42176
|
else {
|
|
42166
42177
|
Log.error('hlsjs: failed to recover', { evt, data });
|
|
42167
|
-
trace(`${T$
|
|
42178
|
+
trace(`${T$n} _recover failed to recover`, {
|
|
42168
42179
|
type: data.type,
|
|
42169
42180
|
details: data.details,
|
|
42170
42181
|
});
|
|
@@ -42250,7 +42261,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42250
42261
|
this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
|
|
42251
42262
|
}
|
|
42252
42263
|
_onHLSJSError(evt, data) {
|
|
42253
|
-
trace(`${T$
|
|
42264
|
+
trace(`${T$n} _onHLSJSError`, {
|
|
42254
42265
|
fatal: data.fatal,
|
|
42255
42266
|
type: data.type,
|
|
42256
42267
|
details: data.details,
|
|
@@ -42298,7 +42309,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42298
42309
|
evt,
|
|
42299
42310
|
data,
|
|
42300
42311
|
});
|
|
42301
|
-
trace(`${T$
|
|
42312
|
+
trace(`${T$n} _onHLSJSError trying to recover from network error`, {
|
|
42302
42313
|
details: data.details,
|
|
42303
42314
|
});
|
|
42304
42315
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42311,7 +42322,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42311
42322
|
evt,
|
|
42312
42323
|
data,
|
|
42313
42324
|
});
|
|
42314
|
-
trace(`${T$
|
|
42325
|
+
trace(`${T$n} _onHLSJSError trying to recover from media error`, {
|
|
42315
42326
|
details: data.details,
|
|
42316
42327
|
});
|
|
42317
42328
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42341,7 +42352,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42341
42352
|
return;
|
|
42342
42353
|
}
|
|
42343
42354
|
Log.warn('hlsjs: non-fatal error occurred', { evt, data });
|
|
42344
|
-
trace(`${T$
|
|
42355
|
+
trace(`${T$n} _onHLSJSError non-fatal error occurred`, {
|
|
42345
42356
|
type: data.type,
|
|
42346
42357
|
details: data.details,
|
|
42347
42358
|
});
|
|
@@ -42675,11 +42686,11 @@ class HlsPlayback extends BasePlayback {
|
|
|
42675
42686
|
this._hls.audioTrack = Number(id); // TODO or find index by .id == id?
|
|
42676
42687
|
}
|
|
42677
42688
|
_onAudioTracksUpdated(_, data) {
|
|
42678
|
-
trace(`${T$
|
|
42689
|
+
trace(`${T$n} onAudioTracksUpdated`);
|
|
42679
42690
|
this.trigger(Events$1.PLAYBACK_AUDIO_AVAILABLE, data.audioTracks.map(toClapprTrack));
|
|
42680
42691
|
}
|
|
42681
42692
|
_onAudioTrackSwitched(_, data) {
|
|
42682
|
-
trace(`${T$
|
|
42693
|
+
trace(`${T$n} onAudioTrackSwitched`);
|
|
42683
42694
|
// @ts-ignore
|
|
42684
42695
|
const track = this._hls.audioTracks[data.id];
|
|
42685
42696
|
this.trigger(Events$1.PLAYBACK_AUDIO_CHANGED, toClapprTrack(track));
|
|
@@ -42700,7 +42711,7 @@ function toClapprTrack(t) {
|
|
|
42700
42711
|
};
|
|
42701
42712
|
}
|
|
42702
42713
|
|
|
42703
|
-
const T$
|
|
42714
|
+
const T$m = 'playback.html5_video';
|
|
42704
42715
|
const STALL_TIMEOUT = 15000;
|
|
42705
42716
|
class HTML5Video extends BasePlayback {
|
|
42706
42717
|
stallTimerId = null;
|
|
@@ -42708,7 +42719,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42708
42719
|
* @internal
|
|
42709
42720
|
*/
|
|
42710
42721
|
createError(errorData, options) {
|
|
42711
|
-
trace(`${T$
|
|
42722
|
+
trace(`${T$m} createError`, {
|
|
42712
42723
|
errorData: { ...errorData },
|
|
42713
42724
|
});
|
|
42714
42725
|
const i18n = this.i18n ||
|
|
@@ -42724,11 +42735,11 @@ class HTML5Video extends BasePlayback {
|
|
|
42724
42735
|
return super.createError(errorData, { ...options, useCodePrefix: false });
|
|
42725
42736
|
}
|
|
42726
42737
|
_onWaiting() {
|
|
42727
|
-
trace(`${T$
|
|
42738
|
+
trace(`${T$m} _onWaiting`);
|
|
42728
42739
|
super._onWaiting();
|
|
42729
42740
|
}
|
|
42730
42741
|
_onEnded() {
|
|
42731
|
-
trace(`${T$
|
|
42742
|
+
trace(`${T$m} _onEnded`);
|
|
42732
42743
|
if (this.stallTimerId) {
|
|
42733
42744
|
clearTimeout(this.stallTimerId);
|
|
42734
42745
|
this.stallTimerId = null;
|
|
@@ -42736,12 +42747,12 @@ class HTML5Video extends BasePlayback {
|
|
|
42736
42747
|
super._onEnded();
|
|
42737
42748
|
}
|
|
42738
42749
|
_handleBufferingEvents() {
|
|
42739
|
-
trace(`${T$
|
|
42750
|
+
trace(`${T$m} _handleBufferingEvents`, {
|
|
42740
42751
|
networkState: this.el.networkState,
|
|
42741
42752
|
});
|
|
42742
42753
|
if (!this.stallTimerId) {
|
|
42743
42754
|
this.stallTimerId = setTimeout(() => {
|
|
42744
|
-
trace(`${T$
|
|
42755
|
+
trace(`${T$m} _handleBufferingEvents stall timeout`, {
|
|
42745
42756
|
buffering: this.buffering,
|
|
42746
42757
|
ended: this.ended,
|
|
42747
42758
|
});
|
|
@@ -42759,7 +42770,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42759
42770
|
super._handleBufferingEvents();
|
|
42760
42771
|
}
|
|
42761
42772
|
_onPlaying() {
|
|
42762
|
-
trace(`${T$
|
|
42773
|
+
trace(`${T$m} _onPlaying`);
|
|
42763
42774
|
if (this.stallTimerId) {
|
|
42764
42775
|
clearTimeout(this.stallTimerId);
|
|
42765
42776
|
this.stallTimerId = null;
|
|
@@ -42767,7 +42778,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42767
42778
|
super._onPlaying();
|
|
42768
42779
|
}
|
|
42769
42780
|
_onPause() {
|
|
42770
|
-
trace(`${T$
|
|
42781
|
+
trace(`${T$m} _onPause`);
|
|
42771
42782
|
super._onPause();
|
|
42772
42783
|
if (this.stallTimerId) {
|
|
42773
42784
|
clearTimeout(this.stallTimerId);
|
|
@@ -42777,7 +42788,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42777
42788
|
get audioTracks() {
|
|
42778
42789
|
const tracks = this.el.audioTracks;
|
|
42779
42790
|
const supported = !!tracks;
|
|
42780
|
-
trace(`${T$
|
|
42791
|
+
trace(`${T$m} get audioTracks`, { supported });
|
|
42781
42792
|
const retval = [];
|
|
42782
42793
|
if (supported) {
|
|
42783
42794
|
for (let i = 0; i < tracks.length; i++) {
|
|
@@ -42796,7 +42807,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42796
42807
|
get currentAudioTrack() {
|
|
42797
42808
|
const tracks = this.el.audioTracks;
|
|
42798
42809
|
const supported = !!tracks;
|
|
42799
|
-
trace(`${T$
|
|
42810
|
+
trace(`${T$m} get currentAudioTrack`, {
|
|
42800
42811
|
supported,
|
|
42801
42812
|
});
|
|
42802
42813
|
if (supported) {
|
|
@@ -42817,7 +42828,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42817
42828
|
switchAudioTrack(id) {
|
|
42818
42829
|
const tracks = this.el.audioTracks;
|
|
42819
42830
|
const supported = !!tracks;
|
|
42820
|
-
trace(`${T$
|
|
42831
|
+
trace(`${T$m} switchAudioTrack`, {
|
|
42821
42832
|
supported,
|
|
42822
42833
|
});
|
|
42823
42834
|
if (supported) {
|
|
@@ -42836,7 +42847,7 @@ function registerPlaybacks() {
|
|
|
42836
42847
|
Loader.registerPlayback(DashPlayback);
|
|
42837
42848
|
}
|
|
42838
42849
|
|
|
42839
|
-
const T$
|
|
42850
|
+
const T$l = 'gplayer';
|
|
42840
42851
|
const DEFAULT_OPTIONS = {
|
|
42841
42852
|
autoPlay: false,
|
|
42842
42853
|
debug: 'none',
|
|
@@ -42924,7 +42935,7 @@ class Player {
|
|
|
42924
42935
|
* ```
|
|
42925
42936
|
*/
|
|
42926
42937
|
attachTo(playerElement) {
|
|
42927
|
-
trace(`${T$
|
|
42938
|
+
trace(`${T$l} attachTo`, {
|
|
42928
42939
|
player: !!this.player,
|
|
42929
42940
|
});
|
|
42930
42941
|
assert.ok(!this.player, 'Player already initialized');
|
|
@@ -42934,7 +42945,7 @@ class Player {
|
|
|
42934
42945
|
}
|
|
42935
42946
|
const coreOpts = this.buildCoreOptions(playerElement);
|
|
42936
42947
|
const { core, container } = Player.getRegisteredPlugins();
|
|
42937
|
-
trace(`${T$
|
|
42948
|
+
trace(`${T$l} init`, {
|
|
42938
42949
|
registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.prototype.name),
|
|
42939
42950
|
});
|
|
42940
42951
|
coreOpts.plugins = {
|
|
@@ -42948,7 +42959,7 @@ class Player {
|
|
|
42948
42959
|
* Destroys the player, releasing all resources and unmounting its UI from the DOM.
|
|
42949
42960
|
*/
|
|
42950
42961
|
destroy() {
|
|
42951
|
-
trace(`${T$
|
|
42962
|
+
trace(`${T$l} destroy`, {
|
|
42952
42963
|
player: !!this.player,
|
|
42953
42964
|
});
|
|
42954
42965
|
if (this.player) {
|
|
@@ -43135,7 +43146,7 @@ class Player {
|
|
|
43135
43146
|
this.config = $.extend(true, this.config, config);
|
|
43136
43147
|
}
|
|
43137
43148
|
initPlayer(coreOptions) {
|
|
43138
|
-
trace(`${T$
|
|
43149
|
+
trace(`${T$l} initPlayer`, {
|
|
43139
43150
|
autoPlay: coreOptions.autoPlay,
|
|
43140
43151
|
sources: coreOptions.sources,
|
|
43141
43152
|
player: !!this.player,
|
|
@@ -43160,7 +43171,7 @@ class Player {
|
|
|
43160
43171
|
}
|
|
43161
43172
|
}
|
|
43162
43173
|
triggerAutoPlay() {
|
|
43163
|
-
trace(`${T$
|
|
43174
|
+
trace(`${T$l} triggerAutoPlay`);
|
|
43164
43175
|
setTimeout(() => {
|
|
43165
43176
|
this.player?.play({
|
|
43166
43177
|
autoPlay: true,
|
|
@@ -43178,7 +43189,7 @@ class Player {
|
|
|
43178
43189
|
// TODO test
|
|
43179
43190
|
events = {
|
|
43180
43191
|
onReady: () => {
|
|
43181
|
-
trace(`${T$
|
|
43192
|
+
trace(`${T$l} onReady`, {
|
|
43182
43193
|
ready: this.ready,
|
|
43183
43194
|
});
|
|
43184
43195
|
if (this.ready) {
|
|
@@ -43212,7 +43223,7 @@ class Player {
|
|
|
43212
43223
|
buildCoreOptions(rootNode) {
|
|
43213
43224
|
const sources = this.buildMediaSourcesList();
|
|
43214
43225
|
const source = sources[0];
|
|
43215
|
-
trace(`${T$
|
|
43226
|
+
trace(`${T$l} buildCoreOptions`, {
|
|
43216
43227
|
source,
|
|
43217
43228
|
sources,
|
|
43218
43229
|
});
|
|
@@ -43273,7 +43284,7 @@ class Player {
|
|
|
43273
43284
|
assert.ok(this.player, 'Player is not initialized');
|
|
43274
43285
|
const core = this.player.core;
|
|
43275
43286
|
core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
|
|
43276
|
-
trace(`${T$
|
|
43287
|
+
trace(`${T$l} on CORE_SCREEN_ORIENTATION_CHANGED`, {
|
|
43277
43288
|
orientation,
|
|
43278
43289
|
rootNode: {
|
|
43279
43290
|
width: this.rootNode?.clientWidth,
|
|
@@ -43288,14 +43299,14 @@ class Player {
|
|
|
43288
43299
|
}
|
|
43289
43300
|
}, null);
|
|
43290
43301
|
core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
|
|
43291
|
-
trace(`${T$
|
|
43302
|
+
trace(`${T$l} on CORE_RESIZE`, {
|
|
43292
43303
|
width,
|
|
43293
43304
|
height,
|
|
43294
43305
|
});
|
|
43295
43306
|
this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
|
|
43296
43307
|
}, null);
|
|
43297
43308
|
core.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
|
|
43298
|
-
trace(`${T$
|
|
43309
|
+
trace(`${T$l} CORE_FULLSCREEN`, {
|
|
43299
43310
|
isFullscreen,
|
|
43300
43311
|
});
|
|
43301
43312
|
this.safeTriggerEvent(PlayerEvent.Fullscreen, isFullscreen);
|
|
@@ -43303,7 +43314,7 @@ class Player {
|
|
|
43303
43314
|
}
|
|
43304
43315
|
}
|
|
43305
43316
|
|
|
43306
|
-
var version$1 = "2.24.
|
|
43317
|
+
var version$1 = "2.24.13";
|
|
43307
43318
|
|
|
43308
43319
|
var packages = {
|
|
43309
43320
|
"node_modules/@clappr/core": {
|
|
@@ -43627,7 +43638,7 @@ const INITIAL_SETTINGS = {
|
|
|
43627
43638
|
default: [],
|
|
43628
43639
|
seekEnabled: false,
|
|
43629
43640
|
};
|
|
43630
|
-
const T$
|
|
43641
|
+
const T$k = 'plugins.media_control';
|
|
43631
43642
|
const LEFT_ORDER = [
|
|
43632
43643
|
'playpause',
|
|
43633
43644
|
'playstop',
|
|
@@ -43882,7 +43893,7 @@ class MediaControl extends UICorePlugin {
|
|
|
43882
43893
|
* Hides the media control UI
|
|
43883
43894
|
*/
|
|
43884
43895
|
disable() {
|
|
43885
|
-
trace(`${T$
|
|
43896
|
+
trace(`${T$k} disable`);
|
|
43886
43897
|
this.userDisabled = true; // TODO distinguish between user and system (e.g., unplayable) disabled?
|
|
43887
43898
|
this.hide();
|
|
43888
43899
|
this.unbindKeyEvents();
|
|
@@ -43892,7 +43903,7 @@ class MediaControl extends UICorePlugin {
|
|
|
43892
43903
|
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
43893
43904
|
*/
|
|
43894
43905
|
enable() {
|
|
43895
|
-
trace(`${T$
|
|
43906
|
+
trace(`${T$k} enable`);
|
|
43896
43907
|
if (this.options.chromeless) {
|
|
43897
43908
|
return;
|
|
43898
43909
|
}
|
|
@@ -44061,7 +44072,9 @@ class MediaControl extends UICorePlugin {
|
|
|
44061
44072
|
return false;
|
|
44062
44073
|
}
|
|
44063
44074
|
togglePlayStop() {
|
|
44064
|
-
this.container.isPlaying()
|
|
44075
|
+
this.container.isPlaying()
|
|
44076
|
+
? this.container.stop({ ui: true })
|
|
44077
|
+
: this.container.play();
|
|
44065
44078
|
}
|
|
44066
44079
|
startSeekDrag(event) {
|
|
44067
44080
|
if (!this.settings.seekEnabled) {
|
|
@@ -44203,17 +44216,20 @@ class MediaControl extends UICorePlugin {
|
|
|
44203
44216
|
this.$volumeBarContainer?.removeClass('volume-bar-hide');
|
|
44204
44217
|
}
|
|
44205
44218
|
hideVolumeBar(timeout = 400) {
|
|
44206
|
-
if (!this.$volumeBarContainer) {
|
|
44207
|
-
return;
|
|
44208
|
-
}
|
|
44209
44219
|
if (this.hideVolumeId) {
|
|
44210
44220
|
clearTimeout(this.hideVolumeId);
|
|
44211
44221
|
}
|
|
44212
44222
|
if (this.draggingVolumeBar) {
|
|
44213
|
-
this.hideVolumeId = setTimeout(() =>
|
|
44223
|
+
this.hideVolumeId = setTimeout(() => {
|
|
44224
|
+
this.hideVolumeId = null;
|
|
44225
|
+
this.hideVolumeBar();
|
|
44226
|
+
}, timeout);
|
|
44214
44227
|
}
|
|
44215
44228
|
else {
|
|
44216
|
-
this.hideVolumeId = setTimeout(() =>
|
|
44229
|
+
this.hideVolumeId = setTimeout(() => {
|
|
44230
|
+
this.hideVolumeId = null;
|
|
44231
|
+
this.$volumeBarContainer.addClass('volume-bar-hide');
|
|
44232
|
+
}, timeout);
|
|
44217
44233
|
}
|
|
44218
44234
|
}
|
|
44219
44235
|
ended() {
|
|
@@ -44378,7 +44394,7 @@ class MediaControl extends UICorePlugin {
|
|
|
44378
44394
|
if (this.core.activePlayback.name === 'html5_video') {
|
|
44379
44395
|
newSettings.seekEnabled = this.isSeekEnabledForHtml5Playback();
|
|
44380
44396
|
}
|
|
44381
|
-
const settingsChanged =
|
|
44397
|
+
const settingsChanged = !isEqualSettings(this.settings, newSettings);
|
|
44382
44398
|
if (settingsChanged) {
|
|
44383
44399
|
this.settings = newSettings;
|
|
44384
44400
|
this.hasUpdate = true;
|
|
@@ -44413,35 +44429,50 @@ class MediaControl extends UICorePlugin {
|
|
|
44413
44429
|
/**
|
|
44414
44430
|
* Get a media control element DOM node
|
|
44415
44431
|
* @param name - The name of the media control element
|
|
44416
|
-
* @
|
|
44432
|
+
* @param element - The DOM node/fragment to mount
|
|
44433
|
+
* @deprecated Use {@link MediaControl.mount} instead
|
|
44434
|
+
*/
|
|
44435
|
+
slot(name, element) {
|
|
44436
|
+
const panel = this.getElementLocation(name);
|
|
44437
|
+
if (panel) {
|
|
44438
|
+
element.attr(`data-${name}`, '');
|
|
44439
|
+
mountTo(panel, element);
|
|
44440
|
+
}
|
|
44441
|
+
}
|
|
44442
|
+
/**
|
|
44443
|
+
* Mounts a media control element at a specific location
|
|
44444
|
+
* @param name - The location to mount the element
|
|
44445
|
+
* @param element - The element to mount
|
|
44417
44446
|
* @remarks
|
|
44418
44447
|
* Use this method to render custom media control UI in a plugin
|
|
44419
44448
|
* @example
|
|
44420
44449
|
* ```ts
|
|
44421
44450
|
* class MyPlugin extends UICorePlugin {
|
|
44422
44451
|
* override render() {
|
|
44423
|
-
* this.$el.html('<div
|
|
44424
|
-
* this.core.getPlugin('media_control').mount('
|
|
44452
|
+
* this.$el.html('<div id="my-element" class="my-class">Here we go</div>')
|
|
44453
|
+
* this.core.getPlugin('media_control').mount('left', this.$el)
|
|
44425
44454
|
* return this
|
|
44426
44455
|
* }
|
|
44427
44456
|
* }
|
|
44428
44457
|
* ```
|
|
44429
44458
|
*/
|
|
44430
44459
|
mount(name, element) {
|
|
44431
|
-
|
|
44432
|
-
|
|
44433
|
-
|
|
44434
|
-
|
|
44435
|
-
|
|
44436
|
-
|
|
44437
|
-
|
|
44438
|
-
|
|
44439
|
-
|
|
44440
|
-
|
|
44441
|
-
|
|
44442
|
-
|
|
44443
|
-
|
|
44444
|
-
|
|
44460
|
+
mountTo(this.getMountParent(name), element);
|
|
44461
|
+
}
|
|
44462
|
+
getMountParent(name) {
|
|
44463
|
+
switch (name) {
|
|
44464
|
+
case 'root':
|
|
44465
|
+
return this.$el;
|
|
44466
|
+
case 'base':
|
|
44467
|
+
return this.$el.find('.media-control-layer');
|
|
44468
|
+
case 'center':
|
|
44469
|
+
return this.getCenterPanel();
|
|
44470
|
+
case 'left':
|
|
44471
|
+
return this.getLeftPanel();
|
|
44472
|
+
case 'right':
|
|
44473
|
+
return this.getRightPanel();
|
|
44474
|
+
default:
|
|
44475
|
+
assert.fail(`Invalid mount parent name: ${name}`);
|
|
44445
44476
|
}
|
|
44446
44477
|
}
|
|
44447
44478
|
/**
|
|
@@ -44619,7 +44650,7 @@ class MediaControl extends UICorePlugin {
|
|
|
44619
44650
|
return this;
|
|
44620
44651
|
}
|
|
44621
44652
|
const timeout = this.options.hideMediaControlDelay || 2000;
|
|
44622
|
-
trace(`${T$
|
|
44653
|
+
trace(`${T$k} render`, { settings: this.settings });
|
|
44623
44654
|
this.$el.html(MediaControl.template({ settings: this.settings }));
|
|
44624
44655
|
// const style = Styler.getStyleFor(mediaControlStyle, { baseUrl: this.options.baseUrl });
|
|
44625
44656
|
// this.$el.append(style[0]);
|
|
@@ -44642,14 +44673,12 @@ class MediaControl extends UICorePlugin {
|
|
|
44642
44673
|
this.$volumeBarContainer?.css({ display: 'none' });
|
|
44643
44674
|
}
|
|
44644
44675
|
}
|
|
44676
|
+
// TODO check if needed
|
|
44645
44677
|
this.$seekBarPosition?.addClass('media-control-notransition');
|
|
44646
44678
|
this.$seekBarScrubber?.addClass('media-control-notransition');
|
|
44647
|
-
|
|
44648
|
-
if (this.displayedSeekBarPercentage) {
|
|
44649
|
-
previousSeekPercentage = this.displayedSeekBarPercentage;
|
|
44650
|
-
}
|
|
44679
|
+
const prevSeekPercentage = this.displayedSeekBarPercentage || 0;
|
|
44651
44680
|
this.displayedSeekBarPercentage = null;
|
|
44652
|
-
this.setSeekPercentage(
|
|
44681
|
+
this.setSeekPercentage(prevSeekPercentage);
|
|
44653
44682
|
setTimeout(() => {
|
|
44654
44683
|
!this.settings.seekEnabled &&
|
|
44655
44684
|
this.$seekBarContainer?.addClass('seek-disabled');
|
|
@@ -44773,9 +44802,17 @@ function serializeSettings(s) {
|
|
|
44773
44802
|
.concat([s.seekEnabled])
|
|
44774
44803
|
.join(',');
|
|
44775
44804
|
}
|
|
44805
|
+
function isEqualSettings(a, b) {
|
|
44806
|
+
return serializeSettings(a) === serializeSettings(b);
|
|
44807
|
+
}
|
|
44808
|
+
function mountTo(parent, element) {
|
|
44809
|
+
if (!parent.find(element).length) {
|
|
44810
|
+
parent.append(element);
|
|
44811
|
+
}
|
|
44812
|
+
}
|
|
44776
44813
|
|
|
44777
44814
|
const VERSION$7 = '2.22.4';
|
|
44778
|
-
const T$
|
|
44815
|
+
const T$j = 'plugins.audiotracks';
|
|
44779
44816
|
/**
|
|
44780
44817
|
* `PLUGIN` that makes possible to switch audio tracks via the media control UI.
|
|
44781
44818
|
* @beta
|
|
@@ -44836,7 +44873,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
44836
44873
|
const mediaControl = this.core.getPlugin('media_control');
|
|
44837
44874
|
assert(mediaControl, 'media_control plugin is required');
|
|
44838
44875
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, () => {
|
|
44839
|
-
mediaControl.
|
|
44876
|
+
mediaControl.slot('audiotracks', this.$el);
|
|
44840
44877
|
});
|
|
44841
44878
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.hideMenu);
|
|
44842
44879
|
this.listenTo(mediaControl, ExtendedEvents.MEDIACONTROL_MENU_COLLAPSE, (from) => {
|
|
@@ -44897,7 +44934,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
44897
44934
|
this.updateText();
|
|
44898
44935
|
}
|
|
44899
44936
|
hideMenu() {
|
|
44900
|
-
trace(`${T$
|
|
44937
|
+
trace(`${T$j} hideMenu`);
|
|
44901
44938
|
this.$el.find('#audiotracks-select').addClass('hidden');
|
|
44902
44939
|
this.$el.find('#audiotracks-button').attr('aria-expanded', 'false');
|
|
44903
44940
|
}
|
|
@@ -44950,7 +44987,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
44950
44987
|
|
|
44951
44988
|
const templateHtml$2 = "<div class=\"big-mute-icon-wrapper\" data-big-mute id=\"gplayer-big-mute-button\">\n <div class=\"big-mute-icon gcore-skin-border-color\" data-big-mute-icon id=\"gplayer-big-mute-icon\"></div>\n</div>\n";
|
|
44952
44989
|
|
|
44953
|
-
const T$
|
|
44990
|
+
const T$i = 'plugins.big_mute_button';
|
|
44954
44991
|
// TODO rewrite as a container plugin
|
|
44955
44992
|
/**
|
|
44956
44993
|
* `PLUGIN` that displays a big mute button over the video when it's being played muted.
|
|
@@ -45013,7 +45050,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
45013
45050
|
if (autoPlay) {
|
|
45014
45051
|
this.autoPlay = true;
|
|
45015
45052
|
}
|
|
45016
|
-
trace(`${T$
|
|
45053
|
+
trace(`${T$i} onPlay`, {
|
|
45017
45054
|
autoPlay: this.autoPlay,
|
|
45018
45055
|
wasMuted,
|
|
45019
45056
|
volume,
|
|
@@ -45026,7 +45063,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
45026
45063
|
}
|
|
45027
45064
|
}
|
|
45028
45065
|
onStop(_, { ui }) {
|
|
45029
|
-
trace(`${T$
|
|
45066
|
+
trace(`${T$i} onStop`, { ui });
|
|
45030
45067
|
if (ui) {
|
|
45031
45068
|
this.destroy();
|
|
45032
45069
|
}
|
|
@@ -45054,7 +45091,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
45054
45091
|
* @internal
|
|
45055
45092
|
*/
|
|
45056
45093
|
render() {
|
|
45057
|
-
trace(`${T$
|
|
45094
|
+
trace(`${T$i} render`);
|
|
45058
45095
|
this.$el.html(BigMuteButton.template());
|
|
45059
45096
|
this.$el.find('#gplayer-big-mute-icon').append(volumeMuteIcon);
|
|
45060
45097
|
// TODO
|
|
@@ -45074,7 +45111,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
45074
45111
|
this.$el.find('#gplayer-big-mute-button')?.removeClass('hide');
|
|
45075
45112
|
}
|
|
45076
45113
|
clicked(e) {
|
|
45077
|
-
trace(`${T$
|
|
45114
|
+
trace(`${T$i} clicked`);
|
|
45078
45115
|
const mediaControl = this.core.getPlugin('media_control');
|
|
45079
45116
|
// TODO delegate to media_control plugin
|
|
45080
45117
|
const localVolume = Utils.Config.restore('volume');
|
|
@@ -45098,7 +45135,7 @@ const gearIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"n
|
|
|
45098
45135
|
const gearHdIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_28_1567)\">\n <path\n d=\"M19.14 12.94C19.18 12.64 19.2 12.33 19.2 12C19.2 11.68 19.18 11.36 19.13 11.06L21.16 9.47999C21.34 9.33999 21.39 9.06999 21.28 8.86999L19.36 5.54999C19.24 5.32999 18.99 5.25999 18.77 5.32999L16.38 6.28999C15.88 5.90999 15.35 5.58999 14.76 5.34999L14.4 2.80999C14.36 2.56999 14.16 2.39999 13.92 2.39999H10.08C9.83999 2.39999 9.64999 2.56999 9.60999 2.80999L9.24999 5.34999C8.65999 5.58999 8.11999 5.91999 7.62999 6.28999L5.23999 5.32999C5.01999 5.24999 4.76999 5.32999 4.64999 5.54999L2.73999 8.86999C2.61999 9.07999 2.65999 9.33999 2.85999 9.47999L4.88999 11.06C4.83999 11.36 4.79999 11.69 4.79999 12C4.79999 12.31 4.81999 12.64 4.86999 12.94L2.83999 14.52C2.65999 14.66 2.60999 14.93 2.71999 15.13L4.63999 18.45C4.75999 18.67 5.00999 18.74 5.22999 18.67L7.61999 17.71C8.11999 18.09 8.64999 18.41 9.23999 18.65L9.59999 21.19C9.64999 21.43 9.83999 21.6 10.08 21.6H13.92C14.16 21.6 14.36 21.43 14.39 21.19L14.75 18.65C15.34 18.41 15.88 18.09 16.37 17.71L18.76 18.67C18.98 18.75 19.23 18.67 19.35 18.45L21.27 15.13C21.39 14.91 21.34 14.66 21.15 14.52L19.14 12.94ZM12 15.6C10.02 15.6 8.39999 13.98 8.39999 12C8.39999 10.02 10.02 8.39999 12 8.39999C13.98 8.39999 15.6 10.02 15.6 12C15.6 13.98 13.98 15.6 12 15.6Z\"\n fill=\"#C9C9C9\"/>\n <rect x=\"13\" width=\"11\" height=\"7\" rx=\"1\" fill=\"#F6413B\"/>\n <path\n d=\"M14.6962 6V1.63636H15.3546V3.53267H17.53V1.63636H18.1905V6H17.53V4.0973H15.3546V6H14.6962ZM20.562 6H19.1493V1.63636H20.6067C21.0343 1.63636 21.4015 1.72372 21.7083 1.89844C22.0151 2.07173 22.2502 2.32102 22.4135 2.64631C22.5783 2.97017 22.6607 3.35866 22.6607 3.81179C22.6607 4.26634 22.5776 4.65696 22.4114 4.98366C22.2466 5.31037 22.008 5.56179 21.6955 5.73793C21.383 5.91264 21.0051 6 20.562 6ZM19.8077 5.42472H20.5257C20.8581 5.42472 21.1344 5.36222 21.3546 5.23722C21.5748 5.1108 21.7395 4.92827 21.8489 4.68963C21.9583 4.44957 22.013 4.15696 22.013 3.81179C22.013 3.46946 21.9583 3.17898 21.8489 2.94034C21.7409 2.7017 21.5797 2.5206 21.3652 2.39702C21.1507 2.27344 20.8844 2.21165 20.5662 2.21165H19.8077V5.42472Z\"\n fill=\"#C9C9C9\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_28_1567\">\n <rect width=\"24\" height=\"24\" fill=\"white\"/>\n </clipPath>\n </defs>\n</svg>\n";
|
|
45099
45136
|
|
|
45100
45137
|
const VERSION$6 = '2.19.12';
|
|
45101
|
-
const T$
|
|
45138
|
+
const T$h = 'plugins.bottom_gear';
|
|
45102
45139
|
const MENU_VMARGIN = 12;
|
|
45103
45140
|
const MENU_BACKLINK_HEIGHT = 44;
|
|
45104
45141
|
/**
|
|
@@ -45250,14 +45287,14 @@ class BottomGear extends UICorePlugin {
|
|
|
45250
45287
|
addItem(name, $subMenu) {
|
|
45251
45288
|
const $existingItem = this.$el.find(`#gear-options li[data-${name}]`);
|
|
45252
45289
|
if ($existingItem.length) {
|
|
45253
|
-
trace(`${T$
|
|
45290
|
+
trace(`${T$h} addItem already exists`, { name });
|
|
45254
45291
|
return $existingItem;
|
|
45255
45292
|
}
|
|
45256
45293
|
const $item = $('<li></li>')
|
|
45257
45294
|
.attr(`data-${name}`, '')
|
|
45258
45295
|
.appendTo(this.$el.find('#gear-options'));
|
|
45259
45296
|
if ($subMenu) {
|
|
45260
|
-
trace(`${T$
|
|
45297
|
+
trace(`${T$h} addItem adding submenu`, { name });
|
|
45261
45298
|
$subMenu
|
|
45262
45299
|
.addClass('gear-sub-menu-wrapper')
|
|
45263
45300
|
.hide()
|
|
@@ -45280,7 +45317,7 @@ class BottomGear extends UICorePlugin {
|
|
|
45280
45317
|
});
|
|
45281
45318
|
}
|
|
45282
45319
|
highDefinitionUpdate(isHd) {
|
|
45283
|
-
trace(`${T$
|
|
45320
|
+
trace(`${T$h} highDefinitionUpdate`, { isHd });
|
|
45284
45321
|
this.hd = isHd;
|
|
45285
45322
|
this.$el.find('#gear-button').html(isHd ? gearHdIcon : gearIcon);
|
|
45286
45323
|
}
|
|
@@ -45359,7 +45396,7 @@ class BottomGear extends UICorePlugin {
|
|
|
45359
45396
|
}
|
|
45360
45397
|
mount() {
|
|
45361
45398
|
const mediaControl = this.core.getPlugin('media_control');
|
|
45362
|
-
mediaControl.
|
|
45399
|
+
mediaControl.slot('gear', this.$el);
|
|
45363
45400
|
}
|
|
45364
45401
|
alignSubmenu($subMenu) {
|
|
45365
45402
|
const availableHeight = this.core.getPlugin('media_control').getAvailableHeight() -
|
|
@@ -47958,7 +47995,7 @@ const PLAYBACK_NAMES = {
|
|
|
47958
47995
|
hls: 'HLS.js',
|
|
47959
47996
|
html5_video: 'Native',
|
|
47960
47997
|
};
|
|
47961
|
-
const T$
|
|
47998
|
+
const T$g = 'plugins.nerd_stats';
|
|
47962
47999
|
/**
|
|
47963
48000
|
* `PLUGIN` that displays useful statistics regarding the playback as well as the network quality estimation.
|
|
47964
48001
|
* @beta
|
|
@@ -48277,7 +48314,7 @@ class NerdStats extends UICorePlugin {
|
|
|
48277
48314
|
return this;
|
|
48278
48315
|
}
|
|
48279
48316
|
attach() {
|
|
48280
|
-
trace(`${T$
|
|
48317
|
+
trace(`${T$g} attach`);
|
|
48281
48318
|
const gear = this.core.getPlugin('bottom_gear');
|
|
48282
48319
|
gear
|
|
48283
48320
|
.addItem('nerd_stats')
|
|
@@ -48291,7 +48328,7 @@ class NerdStats extends UICorePlugin {
|
|
|
48291
48328
|
});
|
|
48292
48329
|
}
|
|
48293
48330
|
clearSpeedtestMetrics() {
|
|
48294
|
-
trace(`${T$
|
|
48331
|
+
trace(`${T$g} clearSpeedtestMetrics`);
|
|
48295
48332
|
const clapprStats = this.container?.getPlugin('clappr_stats');
|
|
48296
48333
|
this.speedtestMetrics.connectionSpeed = 0;
|
|
48297
48334
|
this.speedtestMetrics.ping = 0;
|
|
@@ -48346,7 +48383,7 @@ function newMetrics() {
|
|
|
48346
48383
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
48347
48384
|
// Use of this source code is governed by a BSD-style
|
|
48348
48385
|
// license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
|
|
48349
|
-
const T$
|
|
48386
|
+
const T$f = 'plugins.click_to_pause';
|
|
48350
48387
|
/**
|
|
48351
48388
|
* A small `PLUGIN` that toggles the playback state on click over the video container
|
|
48352
48389
|
* @beta
|
|
@@ -48376,7 +48413,7 @@ class ClickToPause extends ContainerPlugin {
|
|
|
48376
48413
|
click() {
|
|
48377
48414
|
const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
|
|
48378
48415
|
const isDvrEnabled = this.container.isDvrEnabled();
|
|
48379
|
-
trace(`${T$
|
|
48416
|
+
trace(`${T$f} click`, {
|
|
48380
48417
|
isLivePlayback,
|
|
48381
48418
|
isDvrEnabled,
|
|
48382
48419
|
});
|
|
@@ -48455,7 +48492,7 @@ function buildSvg(clips, duration, barWidth) {
|
|
|
48455
48492
|
|
|
48456
48493
|
const clipsHTML = "<div class=\"media-clip-text\" id=\"clips-text\"></div>";
|
|
48457
48494
|
|
|
48458
|
-
const T$
|
|
48495
|
+
const T$e = 'plugins.clips';
|
|
48459
48496
|
const VERSION$5 = '2.22.16';
|
|
48460
48497
|
const CLAPPR_VERSION = '0.11.4';
|
|
48461
48498
|
/**
|
|
@@ -48505,7 +48542,7 @@ class Clips extends UICorePlugin {
|
|
|
48505
48542
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
|
|
48506
48543
|
}
|
|
48507
48544
|
render() {
|
|
48508
|
-
trace(`${T$
|
|
48545
|
+
trace(`${T$e} render`);
|
|
48509
48546
|
if (!this.options.clips) {
|
|
48510
48547
|
return this;
|
|
48511
48548
|
}
|
|
@@ -48541,19 +48578,19 @@ class Clips extends UICorePlugin {
|
|
|
48541
48578
|
?.text;
|
|
48542
48579
|
}
|
|
48543
48580
|
onCoreReady() {
|
|
48544
|
-
trace(`${T$
|
|
48581
|
+
trace(`${T$e} onCoreReady`);
|
|
48545
48582
|
const mediaControl = this.core.getPlugin('media_control');
|
|
48546
48583
|
assert(mediaControl, 'media_control plugin is required');
|
|
48547
48584
|
this.parseClips(this.options.clips.text);
|
|
48548
48585
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMcRender);
|
|
48549
48586
|
}
|
|
48550
48587
|
onMcRender() {
|
|
48551
|
-
trace(`${T$
|
|
48588
|
+
trace(`${T$e} onMcRender`);
|
|
48552
48589
|
const mediaControl = this.core.getPlugin('media_control');
|
|
48553
|
-
mediaControl.
|
|
48590
|
+
mediaControl.slot('clips', this.$el);
|
|
48554
48591
|
}
|
|
48555
48592
|
onContainerChanged() {
|
|
48556
|
-
trace(`${T$
|
|
48593
|
+
trace(`${T$e} onContainerChanged`);
|
|
48557
48594
|
// TODO figure out the conditions of changing the container (without destroying the previous one)
|
|
48558
48595
|
if (this.oldContainer) {
|
|
48559
48596
|
this.stopListening(this.oldContainer, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
@@ -48729,9 +48766,9 @@ class ContextMenu extends UIContainerPlugin {
|
|
|
48729
48766
|
};
|
|
48730
48767
|
}
|
|
48731
48768
|
|
|
48732
|
-
const dvrHTML = "<div class=\"live-info\" id=\"
|
|
48769
|
+
const dvrHTML = "<div class=\"live-info\" id=\"gplayer-mc-live\"><%= i18n.t('live') %></div>\n<button type=\"button\"\n class=\"live-button\"\n aria-label=\"<%= i18n.t('back_to_live') %>\"\n id=\"gplayer-mc-back-to-live\"\n>\n <%= i18n.t('back_to_live') %>\n</button>\n";
|
|
48733
48770
|
|
|
48734
|
-
|
|
48771
|
+
const T$d = 'plugins.dvr_controls';
|
|
48735
48772
|
/**
|
|
48736
48773
|
* `PLUGIN` that adds the DVR controls to the media control UI
|
|
48737
48774
|
*
|
|
@@ -48765,7 +48802,7 @@ class DvrControls extends UICorePlugin {
|
|
|
48765
48802
|
*/
|
|
48766
48803
|
get events() {
|
|
48767
48804
|
return {
|
|
48768
|
-
'click
|
|
48805
|
+
'click #gplayer-mc-back-to-live': 'clicked',
|
|
48769
48806
|
};
|
|
48770
48807
|
}
|
|
48771
48808
|
/**
|
|
@@ -48774,6 +48811,7 @@ class DvrControls extends UICorePlugin {
|
|
|
48774
48811
|
get attributes() {
|
|
48775
48812
|
return {
|
|
48776
48813
|
class: 'dvr-controls',
|
|
48814
|
+
'data-dvr': '',
|
|
48777
48815
|
};
|
|
48778
48816
|
}
|
|
48779
48817
|
/**
|
|
@@ -48792,7 +48830,7 @@ class DvrControls extends UICorePlugin {
|
|
|
48792
48830
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_LOADEDMETADATA, this.onMetadataLoaded);
|
|
48793
48831
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, this.onDvrStateChanged);
|
|
48794
48832
|
}
|
|
48795
|
-
|
|
48833
|
+
clicked() {
|
|
48796
48834
|
const container = this.core.activeContainer;
|
|
48797
48835
|
if (!container.isPlaying()) {
|
|
48798
48836
|
container.play();
|
|
@@ -48803,14 +48841,14 @@ class DvrControls extends UICorePlugin {
|
|
|
48803
48841
|
* @internal
|
|
48804
48842
|
*/
|
|
48805
48843
|
render() {
|
|
48844
|
+
trace(`${T$d} render`);
|
|
48806
48845
|
this.$el.html(DvrControls.template({
|
|
48807
48846
|
i18n: this.core.i18n,
|
|
48808
48847
|
}));
|
|
48848
|
+
this.$el.find('#gplayer-mc-back-to-live').hide();
|
|
48849
|
+
this.$el.find('#gplayer-mc-live').hide();
|
|
48809
48850
|
return this;
|
|
48810
48851
|
}
|
|
48811
|
-
onMediacontrolRendered() {
|
|
48812
|
-
this.render();
|
|
48813
|
-
}
|
|
48814
48852
|
onMetadataLoaded() {
|
|
48815
48853
|
this.mount();
|
|
48816
48854
|
this.toggleState(this.core.activeContainer.isDvrInUse());
|
|
@@ -48822,22 +48860,22 @@ class DvrControls extends UICorePlugin {
|
|
|
48822
48860
|
}
|
|
48823
48861
|
const mediaControl = this.core.getPlugin('media_control');
|
|
48824
48862
|
assert(mediaControl, 'media_control plugin is required');
|
|
48825
|
-
// TODO -> to MediaControl
|
|
48863
|
+
// TODO -> to MediaControl (auto hide)
|
|
48826
48864
|
mediaControl.toggleElement('duration', false);
|
|
48827
48865
|
mediaControl.toggleElement('position', false);
|
|
48828
|
-
mediaControl.mount('
|
|
48866
|
+
mediaControl.mount('left', this.$el); // TODO use independent mount point
|
|
48829
48867
|
}
|
|
48830
48868
|
onDvrStateChanged(dvrInUse) {
|
|
48831
48869
|
this.toggleState(dvrInUse);
|
|
48832
48870
|
}
|
|
48833
48871
|
toggleState(dvrInUse) {
|
|
48834
48872
|
if (dvrInUse) {
|
|
48835
|
-
this.$el.find('#
|
|
48836
|
-
this.$el.find('#
|
|
48873
|
+
this.$el.find('#gplayer-mc-back-to-live').show();
|
|
48874
|
+
this.$el.find('#gplayer-mc-live').hide();
|
|
48837
48875
|
}
|
|
48838
48876
|
else {
|
|
48839
|
-
this.$el.find('#
|
|
48840
|
-
this.$el.find('#
|
|
48877
|
+
this.$el.find('#gplayer-mc-back-to-live').hide();
|
|
48878
|
+
this.$el.find('#gplayer-mc-live').show();
|
|
48841
48879
|
}
|
|
48842
48880
|
}
|
|
48843
48881
|
}
|
|
@@ -49838,7 +49876,7 @@ class PictureInPicture extends UICorePlugin {
|
|
|
49838
49876
|
this.$el.html(PictureInPicture.buttonTemplate({ pipIcon }));
|
|
49839
49877
|
const mediaControl = this.core.getPlugin('media_control');
|
|
49840
49878
|
if (mediaControl) {
|
|
49841
|
-
mediaControl.
|
|
49879
|
+
mediaControl.slot('pip', this.$el);
|
|
49842
49880
|
}
|
|
49843
49881
|
return this;
|
|
49844
49882
|
}
|
|
@@ -51749,7 +51787,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51749
51787
|
this.$line = $(ClosedCaptions.templateString());
|
|
51750
51788
|
this.resizeFont();
|
|
51751
51789
|
this.core.activeContainer.$el.append(this.$line);
|
|
51752
|
-
mediaControl.
|
|
51790
|
+
mediaControl.slot('cc', this.$el);
|
|
51753
51791
|
this.updateSelection();
|
|
51754
51792
|
this.renderIcon();
|
|
51755
51793
|
return this;
|