@gcorevideo/player 2.25.8 → 2.25.10
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/dist/core.js +23 -19
- package/dist/index.css +831 -831
- package/dist/index.embed.js +93 -77
- package/dist/index.js +37 -24
- package/lib/Player.d.ts.map +1 -1
- package/lib/playback/hls-playback/HlsPlayback.d.ts +0 -1
- package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
- package/lib/playback/hls-playback/HlsPlayback.js +22 -18
- package/lib/plugins/subtitles/ClosedCaptions.d.ts +9 -1
- package/lib/plugins/subtitles/ClosedCaptions.d.ts.map +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.js +14 -5
- package/package.json +1 -1
- package/src/Player.ts +0 -1
- package/src/playback/hls-playback/HlsPlayback.ts +22 -26
- package/src/plugins/subtitles/ClosedCaptions.ts +18 -5
- package/src/plugins/subtitles/__tests__/ClosedCaptions.test.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.embed.js
CHANGED
|
@@ -12524,7 +12524,7 @@ var PlaybackEvents;
|
|
|
12524
12524
|
// https://github.com/clappr/clappr/blob/8752995ea439321ac7ca3cd35e8c64de7a3c3d17/LICENSE
|
|
12525
12525
|
const AUTO$1 = -1;
|
|
12526
12526
|
const { now: now$2 } = Utils;
|
|
12527
|
-
const T$
|
|
12527
|
+
const T$e = 'playback.dash';
|
|
12528
12528
|
class DashPlayback extends BasePlayback {
|
|
12529
12529
|
_levels = null;
|
|
12530
12530
|
_currentLevel = null;
|
|
@@ -12873,7 +12873,7 @@ class DashPlayback extends BasePlayback {
|
|
|
12873
12873
|
if (!this._dash) {
|
|
12874
12874
|
return false;
|
|
12875
12875
|
}
|
|
12876
|
-
trace(`${T$
|
|
12876
|
+
trace(`${T$e} get.dvrEnabled`, {
|
|
12877
12877
|
dvrWindowSize: this._dash?.getDVRWindowSize(),
|
|
12878
12878
|
minDvrSize: this._minDvrSize,
|
|
12879
12879
|
playbackType: this.getPlaybackType(),
|
|
@@ -12895,7 +12895,7 @@ class DashPlayback extends BasePlayback {
|
|
|
12895
12895
|
this.trigger(Events$1.PLAYBACK_PROGRESS, progress, {});
|
|
12896
12896
|
}
|
|
12897
12897
|
play() {
|
|
12898
|
-
trace(`${T$
|
|
12898
|
+
trace(`${T$e} play`, { dash: !!this._dash });
|
|
12899
12899
|
!this._dash && this._setup();
|
|
12900
12900
|
super.play();
|
|
12901
12901
|
this._startTimeUpdateTimer();
|
|
@@ -41688,7 +41688,7 @@ const AUTO = -1;
|
|
|
41688
41688
|
const DEFAULT_RECOVER_ATTEMPTS = 16;
|
|
41689
41689
|
Events$1.register('PLAYBACK_FRAGMENT_CHANGED');
|
|
41690
41690
|
Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
|
|
41691
|
-
const T$
|
|
41691
|
+
const T$d = 'playback.hls';
|
|
41692
41692
|
class HlsPlayback extends BasePlayback {
|
|
41693
41693
|
_ccIsSetup = false;
|
|
41694
41694
|
_ccTracksUpdated = false;
|
|
@@ -41961,9 +41961,9 @@ class HlsPlayback extends BasePlayback {
|
|
|
41961
41961
|
this._hls.on(Hls.Events.FRAG_LOADED, (evt, data) => this._onFragmentLoaded(evt, data));
|
|
41962
41962
|
this._hls.on(Hls.Events.FRAG_PARSING_METADATA, (evt, data) => this._onFragmentParsingMetadata(evt, data));
|
|
41963
41963
|
this._hls.on(Hls.Events.ERROR, (evt, data) => this._onHLSJSError(evt, data));
|
|
41964
|
-
// this._hls.on(HLSJS.Events.SUBTITLE_TRACK_LOADED, (
|
|
41965
|
-
this.
|
|
41966
|
-
|
|
41964
|
+
// this._hls.on(HLSJS.Events.SUBTITLE_TRACK_LOADED, () =>
|
|
41965
|
+
// this._onSubtitleLoaded(),
|
|
41966
|
+
// )
|
|
41967
41967
|
this._hls.on(Events.AUDIO_TRACKS_UPDATED, (evt, data) => this._onAudioTracksUpdated(evt, data));
|
|
41968
41968
|
this._hls.on(Events.AUDIO_TRACK_SWITCHED, (evt, data) => this._onAudioTrackSwitched(evt, data));
|
|
41969
41969
|
this.bindCustomListeners();
|
|
@@ -42012,7 +42012,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42012
42012
|
}
|
|
42013
42013
|
else {
|
|
42014
42014
|
Log.error('hlsjs: failed to recover', { evt, data });
|
|
42015
|
-
trace(`${T$
|
|
42015
|
+
trace(`${T$d} _recover failed to recover`, {
|
|
42016
42016
|
type: data.type,
|
|
42017
42017
|
details: data.details,
|
|
42018
42018
|
});
|
|
@@ -42098,7 +42098,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42098
42098
|
this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
|
|
42099
42099
|
}
|
|
42100
42100
|
_onHLSJSError(evt, data) {
|
|
42101
|
-
trace(`${T$
|
|
42101
|
+
trace(`${T$d} _onHLSJSError`, {
|
|
42102
42102
|
fatal: data.fatal,
|
|
42103
42103
|
type: data.type,
|
|
42104
42104
|
details: data.details,
|
|
@@ -42146,7 +42146,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42146
42146
|
evt,
|
|
42147
42147
|
data,
|
|
42148
42148
|
});
|
|
42149
|
-
trace(`${T$
|
|
42149
|
+
trace(`${T$d} _onHLSJSError trying to recover from network error`, {
|
|
42150
42150
|
details: data.details,
|
|
42151
42151
|
});
|
|
42152
42152
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42159,7 +42159,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42159
42159
|
evt,
|
|
42160
42160
|
data,
|
|
42161
42161
|
});
|
|
42162
|
-
trace(`${T$
|
|
42162
|
+
trace(`${T$d} _onHLSJSError trying to recover from media error`, {
|
|
42163
42163
|
details: data.details,
|
|
42164
42164
|
});
|
|
42165
42165
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42189,7 +42189,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
42189
42189
|
return;
|
|
42190
42190
|
}
|
|
42191
42191
|
Log.warn('hlsjs: non-fatal error occurred', { evt, data });
|
|
42192
|
-
trace(`${T$
|
|
42192
|
+
trace(`${T$d} _onHLSJSError non-fatal error occurred`, {
|
|
42193
42193
|
type: data.type,
|
|
42194
42194
|
details: data.details,
|
|
42195
42195
|
});
|
|
@@ -42293,11 +42293,13 @@ class HlsPlayback extends BasePlayback {
|
|
|
42293
42293
|
this._playbackType = (data.details.live ? Playback.LIVE : Playback.VOD);
|
|
42294
42294
|
this._onLevelUpdated(evt, data);
|
|
42295
42295
|
// Live stream subtitle tracks detection hack (may not immediately available)
|
|
42296
|
-
if (
|
|
42297
|
-
|
|
42298
|
-
|
|
42299
|
-
|
|
42300
|
-
|
|
42296
|
+
// if (
|
|
42297
|
+
// this._ccTracksUpdated &&
|
|
42298
|
+
// this._playbackType === Playback.LIVE &&
|
|
42299
|
+
// this.hasClosedCaptionsTracks
|
|
42300
|
+
// ) {
|
|
42301
|
+
// this._onSubtitleLoaded()
|
|
42302
|
+
// }
|
|
42301
42303
|
if (prevPlaybackType !== this._playbackType) {
|
|
42302
42304
|
this._updateSettings();
|
|
42303
42305
|
}
|
|
@@ -42450,16 +42452,18 @@ class HlsPlayback extends BasePlayback {
|
|
|
42450
42452
|
_onFragmentLoaded(evt, data) {
|
|
42451
42453
|
this.trigger(Events$1.PLAYBACK_FRAGMENT_LOADED, data);
|
|
42452
42454
|
}
|
|
42453
|
-
_onSubtitleLoaded() {
|
|
42454
|
-
|
|
42455
|
-
|
|
42456
|
-
|
|
42457
|
-
|
|
42458
|
-
|
|
42459
|
-
|
|
42460
|
-
|
|
42461
|
-
|
|
42462
|
-
|
|
42455
|
+
// _onSubtitleLoaded() {
|
|
42456
|
+
// trace(`${T} _onSubtitleLoaded`)
|
|
42457
|
+
// // This event may be triggered multiple times
|
|
42458
|
+
// // Setup CC only once (disable CC by default)
|
|
42459
|
+
// if (!this._ccIsSetup) {
|
|
42460
|
+
// this.trigger(Events.PLAYBACK_SUBTITLE_AVAILABLE)
|
|
42461
|
+
// const trackId =
|
|
42462
|
+
// this._playbackType === Playback.LIVE ? -1 : this.closedCaptionsTrackId
|
|
42463
|
+
// this.closedCaptionsTrackId = trackId
|
|
42464
|
+
// this._ccIsSetup = true
|
|
42465
|
+
// }
|
|
42466
|
+
// }
|
|
42463
42467
|
_onLevelSwitch(evt, data) {
|
|
42464
42468
|
if (!this.levels.length) {
|
|
42465
42469
|
this._fillLevels();
|
|
@@ -42546,7 +42550,7 @@ function toClapprTrack(t) {
|
|
|
42546
42550
|
};
|
|
42547
42551
|
}
|
|
42548
42552
|
|
|
42549
|
-
const T$
|
|
42553
|
+
const T$c = 'playback.html5_video';
|
|
42550
42554
|
const STALL_TIMEOUT = 15000;
|
|
42551
42555
|
class HTML5Video extends BasePlayback {
|
|
42552
42556
|
stallTimerId = null;
|
|
@@ -42554,7 +42558,7 @@ class HTML5Video extends BasePlayback {
|
|
|
42554
42558
|
* @internal
|
|
42555
42559
|
*/
|
|
42556
42560
|
createError(errorData, options) {
|
|
42557
|
-
trace(`${T$
|
|
42561
|
+
trace(`${T$c} createError`, {
|
|
42558
42562
|
errorData: { ...errorData },
|
|
42559
42563
|
});
|
|
42560
42564
|
const i18n = this.i18n ||
|
|
@@ -42580,12 +42584,12 @@ class HTML5Video extends BasePlayback {
|
|
|
42580
42584
|
super._onEnded();
|
|
42581
42585
|
}
|
|
42582
42586
|
_handleBufferingEvents() {
|
|
42583
|
-
trace(`${T$
|
|
42587
|
+
trace(`${T$c} _handleBufferingEvents`, {
|
|
42584
42588
|
networkState: this.el.networkState,
|
|
42585
42589
|
});
|
|
42586
42590
|
if (!this.stallTimerId) {
|
|
42587
42591
|
this.stallTimerId = setTimeout(() => {
|
|
42588
|
-
trace(`${T$
|
|
42592
|
+
trace(`${T$c} _handleBufferingEvents stall timeout`, {
|
|
42589
42593
|
buffering: this.buffering,
|
|
42590
42594
|
ended: this.ended,
|
|
42591
42595
|
});
|
|
@@ -42671,7 +42675,7 @@ function registerPlaybacks() {
|
|
|
42671
42675
|
Loader.registerPlayback(DashPlayback);
|
|
42672
42676
|
}
|
|
42673
42677
|
|
|
42674
|
-
const T$
|
|
42678
|
+
const T$b = 'gplayer';
|
|
42675
42679
|
const DEFAULT_OPTIONS = {
|
|
42676
42680
|
autoPlay: false,
|
|
42677
42681
|
debug: 'none',
|
|
@@ -42759,7 +42763,7 @@ class Player {
|
|
|
42759
42763
|
* ```
|
|
42760
42764
|
*/
|
|
42761
42765
|
attachTo(playerElement) {
|
|
42762
|
-
trace(`${T$
|
|
42766
|
+
trace(`${T$b} attachTo`, {
|
|
42763
42767
|
player: !!this.player,
|
|
42764
42768
|
});
|
|
42765
42769
|
assert.ok(!this.player, 'Player already initialized');
|
|
@@ -42769,7 +42773,7 @@ class Player {
|
|
|
42769
42773
|
}
|
|
42770
42774
|
const coreOpts = this.buildCoreOptions(playerElement);
|
|
42771
42775
|
const { core, container } = Player.getRegisteredPlugins();
|
|
42772
|
-
trace(`${T$
|
|
42776
|
+
trace(`${T$b} init`, {
|
|
42773
42777
|
registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.prototype.name),
|
|
42774
42778
|
});
|
|
42775
42779
|
coreOpts.plugins = {
|
|
@@ -42783,7 +42787,7 @@ class Player {
|
|
|
42783
42787
|
* Destroys the player, releasing all resources and unmounting its UI from the DOM.
|
|
42784
42788
|
*/
|
|
42785
42789
|
destroy() {
|
|
42786
|
-
trace(`${T$
|
|
42790
|
+
trace(`${T$b} destroy`, {
|
|
42787
42791
|
player: !!this.player,
|
|
42788
42792
|
});
|
|
42789
42793
|
if (this.player) {
|
|
@@ -42970,7 +42974,7 @@ class Player {
|
|
|
42970
42974
|
this.config = $.extend(true, this.config, config);
|
|
42971
42975
|
}
|
|
42972
42976
|
initPlayer(coreOptions) {
|
|
42973
|
-
trace(`${T$
|
|
42977
|
+
trace(`${T$b} initPlayer`, {
|
|
42974
42978
|
autoPlay: coreOptions.autoPlay,
|
|
42975
42979
|
sources: coreOptions.sources,
|
|
42976
42980
|
player: !!this.player,
|
|
@@ -43010,7 +43014,7 @@ class Player {
|
|
|
43010
43014
|
// TODO test
|
|
43011
43015
|
events = {
|
|
43012
43016
|
onReady: () => {
|
|
43013
|
-
trace(`${T$
|
|
43017
|
+
trace(`${T$b} onReady`, {
|
|
43014
43018
|
ready: this.ready,
|
|
43015
43019
|
});
|
|
43016
43020
|
if (this.ready) {
|
|
@@ -43100,7 +43104,7 @@ class Player {
|
|
|
43100
43104
|
assert.ok(this.player, 'Player is not initialized');
|
|
43101
43105
|
const core = this.player.core;
|
|
43102
43106
|
core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
|
|
43103
|
-
trace(`${T$
|
|
43107
|
+
trace(`${T$b} on CORE_SCREEN_ORIENTATION_CHANGED`, {
|
|
43104
43108
|
rootNode: {
|
|
43105
43109
|
width: this.rootNode?.clientWidth,
|
|
43106
43110
|
height: this.rootNode?.clientHeight,
|
|
@@ -44867,7 +44871,7 @@ const templateHtml$2 = "<div class=\"big-mute-icon-wrapper\" data-big-mute id=\"
|
|
|
44867
44871
|
|
|
44868
44872
|
insertStyle(".big-mute-icon-wrapper[data-big-mute] {\n position: absolute;\n z-index: 9998;\n background-color: transparent;\n display: flex;\n justify-content: center;\n width: 100%;\n height: calc(100% - 50px);\n margin: 0 auto;\n opacity: 0.75;\n transition: opacity 0.1s ease;\n pointer-events: auto;\n}\n.big-mute-icon-wrapper[data-big-mute].hide {\n display: none;\n}\n.big-mute-icon-wrapper[data-big-mute]:hover {\n cursor: pointer;\n}\n\n.big-mute-icon[data-big-mute-icon] {\n display: flex;\n align-items: center;\n justify-content: center;\n align-self: center;\n width: 120px;\n height: 120px;\n border: 2px solid white;\n border-radius: 50%;\n filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)\";\n filter: alpha(opacity=60);\n opacity: 1;\n box-shadow: 0 0 1px 0 white;\n background: rgba(240, 243, 247, 0.9411764706);\n z-index: 10000;\n}\n.big-mute-icon[data-big-mute-icon] svg {\n margin-left: 5px;\n width: 80px;\n height: 80px;\n}\n.big-mute-icon[data-big-mute-icon] svg path {\n fill: #1f1e1e !important;\n}\n.big-mute-icon[data-big-mute-icon]:hover {\n background: rgba(240, 243, 247, 0.8784313725);\n}\n.big-mute-icon[data-big-mute-icon]:hover svg path {\n fill: #151515 !important;\n}");
|
|
44869
44873
|
|
|
44870
|
-
const T$
|
|
44874
|
+
const T$a = 'plugins.big_mute_button';
|
|
44871
44875
|
// TODO rewrite as a container plugin
|
|
44872
44876
|
/**
|
|
44873
44877
|
* `PLUGIN` that displays a big mute button over the video when it's being played muted.
|
|
@@ -44930,7 +44934,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
44930
44934
|
if (autoPlay) {
|
|
44931
44935
|
this.autoPlay = true;
|
|
44932
44936
|
}
|
|
44933
|
-
trace(`${T$
|
|
44937
|
+
trace(`${T$a} onPlay`, {
|
|
44934
44938
|
autoPlay: this.autoPlay});
|
|
44935
44939
|
if (this.autoPlay && !wasMuted && volume === 0) {
|
|
44936
44940
|
this.mount();
|
|
@@ -48499,7 +48503,7 @@ const templateHtml = "<div class=\"player-error-screen__content\" data-error-scr
|
|
|
48499
48503
|
|
|
48500
48504
|
insertStyle("div.player-error-screen, [data-player] div.player-error-screen {\n color: #CCCACA;\n position: absolute;\n top: 0;\n height: 100%;\n width: 100%;\n background-color: rgba(0, 0, 0, 0.7);\n z-index: 2000;\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\ndiv.player-error-screen__content[data-error-screen], [data-player] div.player-error-screen__content[data-error-screen] {\n font-size: 14px;\n color: #CCCACA;\n margin-top: 45px;\n}\ndiv.player-error-screen__title[data-error-screen], [data-player] div.player-error-screen__title[data-error-screen] {\n font-weight: bold;\n line-height: 30px;\n font-size: 18px;\n}\ndiv.player-error-screen__message[data-error-screen], [data-player] div.player-error-screen__message[data-error-screen] {\n width: 90%;\n margin: 0 auto;\n}\ndiv.player-error-screen__code[data-error-screen], [data-player] div.player-error-screen__code[data-error-screen] {\n font-size: 13px;\n margin-top: 15px;\n}\ndiv.player-error-screen__reload, [data-player] div.player-error-screen__reload {\n cursor: pointer;\n width: 30px;\n margin: 15px auto 0;\n}");
|
|
48501
48505
|
|
|
48502
|
-
const T$
|
|
48506
|
+
const T$9 = 'plugins.error_screen';
|
|
48503
48507
|
/**
|
|
48504
48508
|
* `PLUGIN` that displays fatal errors nicely in the overlay on top of the player.
|
|
48505
48509
|
* @public
|
|
@@ -48575,7 +48579,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
48575
48579
|
}, 0);
|
|
48576
48580
|
}
|
|
48577
48581
|
onActiveContainerChanged() {
|
|
48578
|
-
trace(`${T$
|
|
48582
|
+
trace(`${T$9} onActiveContainerChanged`, {
|
|
48579
48583
|
reloading: this.core.options.reloading,
|
|
48580
48584
|
});
|
|
48581
48585
|
this.err = null;
|
|
@@ -48634,7 +48638,7 @@ const buttonHtml$2 = "<button class=\"gplayer-lite-btn gcore-skin-button-color\"
|
|
|
48634
48638
|
insertStyle(".media-control-skin-1 .media-control-item.media-control-pip {\n order: 95;\n}\n.media-control-skin-1 .media-control-item.media-control-pip button {\n height: 20px;\n}\n.media-control-skin-1 .media-control-item.media-control-pip button svg {\n height: 20px;\n}");
|
|
48635
48639
|
|
|
48636
48640
|
const VERSION$3 = '0.0.1';
|
|
48637
|
-
const T$
|
|
48641
|
+
const T$8 = `plugins.pip`;
|
|
48638
48642
|
/**
|
|
48639
48643
|
* `PLUGIN` that enables picture in picture mode.
|
|
48640
48644
|
* @beta
|
|
@@ -48717,7 +48721,7 @@ class PictureInPicture extends UICorePlugin {
|
|
|
48717
48721
|
}
|
|
48718
48722
|
}
|
|
48719
48723
|
requestPictureInPicture() {
|
|
48720
|
-
trace(`${T$
|
|
48724
|
+
trace(`${T$8} requestPictureInPicture`, {
|
|
48721
48725
|
videoElement: !!this.videoElement,
|
|
48722
48726
|
});
|
|
48723
48727
|
this.videoElement.requestPictureInPicture();
|
|
@@ -48749,7 +48753,7 @@ const DEFAULT_PLAYBACK_RATES = [
|
|
|
48749
48753
|
{ value: 2.0, label: '2x' },
|
|
48750
48754
|
];
|
|
48751
48755
|
const DEFAULT_PLAYBACK_RATE = 1;
|
|
48752
|
-
const T$
|
|
48756
|
+
const T$7 = 'plugins.playback_rate';
|
|
48753
48757
|
/**
|
|
48754
48758
|
* `PLUGIN` that allows changing the playback speed of the video.
|
|
48755
48759
|
* @beta
|
|
@@ -48856,7 +48860,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
48856
48860
|
this.mount();
|
|
48857
48861
|
}
|
|
48858
48862
|
mount() {
|
|
48859
|
-
trace(`${T$
|
|
48863
|
+
trace(`${T$7} mount`, {
|
|
48860
48864
|
shouldMount: this.shouldMount(),
|
|
48861
48865
|
});
|
|
48862
48866
|
if (!this.shouldMount()) {
|
|
@@ -48873,7 +48877,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
48873
48877
|
})));
|
|
48874
48878
|
}
|
|
48875
48879
|
onMetaDataLoaded() {
|
|
48876
|
-
trace(`${T$
|
|
48880
|
+
trace(`${T$7} onMetaDataLoaded`, {
|
|
48877
48881
|
playbackType: this.core.activePlayback.getPlaybackType(),
|
|
48878
48882
|
dvrEnabled: this.core.activePlayback.dvrEnabled,
|
|
48879
48883
|
});
|
|
@@ -48895,13 +48899,13 @@ class PlaybackRate extends UICorePlugin {
|
|
|
48895
48899
|
this.core.activePlayback?.setPlaybackRate(this.selectedRate);
|
|
48896
48900
|
}
|
|
48897
48901
|
else {
|
|
48898
|
-
trace(`${T$
|
|
48902
|
+
trace(`${T$7} onPlaybackRateChange not steering to the selected rate, it is seemingly a catchup algorithm working`, {
|
|
48899
48903
|
selectedRate: this.selectedRate,
|
|
48900
48904
|
});
|
|
48901
48905
|
}
|
|
48902
48906
|
}
|
|
48903
48907
|
shouldMount() {
|
|
48904
|
-
trace(`${T$
|
|
48908
|
+
trace(`${T$7} shouldMount`, {
|
|
48905
48909
|
playbackType: this.core.activePlayback?.getPlaybackType(),
|
|
48906
48910
|
dvrEnabled: this.core.activePlayback?.dvrEnabled,
|
|
48907
48911
|
});
|
|
@@ -48918,7 +48922,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
48918
48922
|
* @internal
|
|
48919
48923
|
*/
|
|
48920
48924
|
render() {
|
|
48921
|
-
trace(`${T$
|
|
48925
|
+
trace(`${T$7} render`, {
|
|
48922
48926
|
shouldMount: this.shouldMount(),
|
|
48923
48927
|
});
|
|
48924
48928
|
this.$el.html(PlaybackRate.listTemplate({
|
|
@@ -48964,13 +48968,13 @@ class PlaybackRate extends UICorePlugin {
|
|
|
48964
48968
|
}
|
|
48965
48969
|
}
|
|
48966
48970
|
syncRate() {
|
|
48967
|
-
trace(`${T$
|
|
48971
|
+
trace(`${T$7} syncRate`, {
|
|
48968
48972
|
selectedRate: this.selectedRate,
|
|
48969
48973
|
});
|
|
48970
48974
|
this.core.activePlayback?.setPlaybackRate(this.selectedRate);
|
|
48971
48975
|
}
|
|
48972
48976
|
resetPlaybackRate() {
|
|
48973
|
-
trace(`${T$
|
|
48977
|
+
trace(`${T$7} resetPlaybackRate`, {
|
|
48974
48978
|
selectedRate: this.selectedRate,
|
|
48975
48979
|
});
|
|
48976
48980
|
this.core.activePlayback?.setPlaybackRate(DEFAULT_PLAYBACK_RATE);
|
|
@@ -49005,7 +49009,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49005
49009
|
?.label || `x${rate}`);
|
|
49006
49010
|
}
|
|
49007
49011
|
highlightCurrentRate() {
|
|
49008
|
-
trace(`${T$
|
|
49012
|
+
trace(`${T$7} highlightCurrentRate`, {
|
|
49009
49013
|
selectedRate: this.selectedRate,
|
|
49010
49014
|
});
|
|
49011
49015
|
this.allRateElements().removeClass('current');
|
|
@@ -49016,7 +49020,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49016
49020
|
.addClass('gcore-skin-active');
|
|
49017
49021
|
}
|
|
49018
49022
|
updateGearOptionLabel() {
|
|
49019
|
-
trace(`${T$
|
|
49023
|
+
trace(`${T$7} updateGearOptionLabel`, {
|
|
49020
49024
|
selectedRate: this.selectedRate,
|
|
49021
49025
|
});
|
|
49022
49026
|
this.mount();
|
|
@@ -49030,7 +49034,7 @@ const posterHTML = "<div class=\"play-wrapper\" id=\"gplayer-poster\">\n <div
|
|
|
49030
49034
|
//Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
49031
49035
|
// Use of this source code is governed by a BSD-style
|
|
49032
49036
|
// license that can be found in the LICENSE file.
|
|
49033
|
-
const T$
|
|
49037
|
+
const T$6 = 'plugins.poster';
|
|
49034
49038
|
/**
|
|
49035
49039
|
* `PLUGIN` that displays a poster image in the background and a big play button on top when playback is stopped
|
|
49036
49040
|
* @beta
|
|
@@ -49134,7 +49138,7 @@ class Poster extends UIContainerPlugin {
|
|
|
49134
49138
|
super.disable();
|
|
49135
49139
|
}
|
|
49136
49140
|
onError(error) {
|
|
49137
|
-
trace(`${T$
|
|
49141
|
+
trace(`${T$6} onError`, {
|
|
49138
49142
|
enabled: this.enabled,
|
|
49139
49143
|
});
|
|
49140
49144
|
if (this.hasFatalError) {
|
|
@@ -49267,7 +49271,7 @@ const hdIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"non
|
|
|
49267
49271
|
|
|
49268
49272
|
insertStyle(".quality-levels li.disabled {\n opacity: 0.5;\n pointer-events: none;\n}\n.quality-levels li.current {\n background-color: #000;\n}");
|
|
49269
49273
|
|
|
49270
|
-
const T$
|
|
49274
|
+
const T$5 = 'plugins.quality_levels';
|
|
49271
49275
|
const VERSION$2 = 'v2.22.5';
|
|
49272
49276
|
/**
|
|
49273
49277
|
* `PLUGIN` that provides a UI to select the desired quality level of the playback.
|
|
@@ -49510,7 +49514,7 @@ class QualityLevels extends UICorePlugin {
|
|
|
49510
49514
|
this.highlightCurrentLevel();
|
|
49511
49515
|
}
|
|
49512
49516
|
highlightCurrentLevel() {
|
|
49513
|
-
trace(`${T$
|
|
49517
|
+
trace(`${T$5} highlightCurrentLevel`, {
|
|
49514
49518
|
selectedLevelId: this.selectedLevelId,
|
|
49515
49519
|
});
|
|
49516
49520
|
this.allLevelElements()
|
|
@@ -49538,7 +49542,7 @@ insertStyle(".seek-time {\n position: absolute;\n white-space: nowrap;\n heig
|
|
|
49538
49542
|
// Use of this source code is governed by a BSD-style
|
|
49539
49543
|
// license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE
|
|
49540
49544
|
const { formatTime } = Utils;
|
|
49541
|
-
const T$
|
|
49545
|
+
const T$4 = 'plugins.seek_time';
|
|
49542
49546
|
/**
|
|
49543
49547
|
* `PLUGIN` that adds a seek time indicator when the mouse pointer is over the seek bar.
|
|
49544
49548
|
* @beta
|
|
@@ -49597,7 +49601,7 @@ class SeekTime extends UICorePlugin {
|
|
|
49597
49601
|
showTime(event) {
|
|
49598
49602
|
this.hoveringOverSeekBar = true;
|
|
49599
49603
|
this.calculateHoverPosition(event);
|
|
49600
|
-
trace(`${T$
|
|
49604
|
+
trace(`${T$4} showTime`, {
|
|
49601
49605
|
hoverPosition: this.hoverPosition,
|
|
49602
49606
|
});
|
|
49603
49607
|
this.update();
|
|
@@ -49684,7 +49688,7 @@ const pluginHtml$1 = "<div class=\"skip-container\" id=\"mc-skip-container\">\n
|
|
|
49684
49688
|
|
|
49685
49689
|
insertStyle(".container-with-poster-clickable .mc-skip-time {\n height: 0;\n}\n\n.mc-skip-time {\n position: absolute;\n width: 100%;\n height: calc(100% - 50px);\n z-index: 9998;\n background-color: transparent;\n font-family: Roboto, \"Open Sans\", Arial, sans-serif;\n}\n.mc-skip-time .skip-container {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: space-between;\n}\n.mc-skip-time .skip-container .skip-item {\n flex: 1 0 0px;\n height: 100%;\n}");
|
|
49686
49690
|
|
|
49687
|
-
const T$
|
|
49691
|
+
const T$3 = 'plugins.skip_time';
|
|
49688
49692
|
/**
|
|
49689
49693
|
* `PLUGIN` that allows skipping time by tapping on the left or right side of the video.
|
|
49690
49694
|
* @beta
|
|
@@ -49734,7 +49738,7 @@ class SkipTime extends UICorePlugin {
|
|
|
49734
49738
|
this.position = 'left';
|
|
49735
49739
|
}
|
|
49736
49740
|
handleRewindClicks() {
|
|
49737
|
-
trace(`${T$
|
|
49741
|
+
trace(`${T$3} handleRewindClicks`, {
|
|
49738
49742
|
position: this.position,
|
|
49739
49743
|
});
|
|
49740
49744
|
if (this.core.getPlaybackType() === Playback.LIVE &&
|
|
@@ -49745,7 +49749,7 @@ class SkipTime extends UICorePlugin {
|
|
|
49745
49749
|
this.handleSkip();
|
|
49746
49750
|
}
|
|
49747
49751
|
handleSkip() {
|
|
49748
|
-
trace(`${T$
|
|
49752
|
+
trace(`${T$3} handleSkip`, {
|
|
49749
49753
|
position: this.position,
|
|
49750
49754
|
});
|
|
49751
49755
|
if (Browser.isMobile) {
|
|
@@ -49800,7 +49804,7 @@ insertStyle(".spinner-three-bounce[data-spinner] {\n position: absolute;\n wid
|
|
|
49800
49804
|
// Use of this source code is governed by a BSD-style
|
|
49801
49805
|
// license that can be found in the LICENSE file.
|
|
49802
49806
|
// https://github.com/clappr/clappr-plugins/blob/ffaa9d27005fa5a8a7c243ffc47eb5655b84b371/LICENSE
|
|
49803
|
-
const T$
|
|
49807
|
+
const T$2 = 'plugins.spinner';
|
|
49804
49808
|
/**
|
|
49805
49809
|
* Custom events emitted by the plugin
|
|
49806
49810
|
* @public
|
|
@@ -49873,14 +49877,14 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
49873
49877
|
this._hide();
|
|
49874
49878
|
}
|
|
49875
49879
|
onStop() {
|
|
49876
|
-
trace(`${T$
|
|
49880
|
+
trace(`${T$2} onStop`, {
|
|
49877
49881
|
hasFatalError: this.hasFatalError,
|
|
49878
49882
|
});
|
|
49879
49883
|
this._hide();
|
|
49880
49884
|
}
|
|
49881
49885
|
onError(e) {
|
|
49882
49886
|
this.hasFatalError = e.code === PlaybackErrorCode.MediaSourceUnavailable;
|
|
49883
|
-
trace(`${T$
|
|
49887
|
+
trace(`${T$2} onError`, {
|
|
49884
49888
|
hasFatalError: this.hasFatalError,
|
|
49885
49889
|
error: e.code,
|
|
49886
49890
|
});
|
|
@@ -49913,7 +49917,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
49913
49917
|
}
|
|
49914
49918
|
}
|
|
49915
49919
|
_hide() {
|
|
49916
|
-
trace(`${T$
|
|
49920
|
+
trace(`${T$2} _hide`, {
|
|
49917
49921
|
userShown: this.userShown,
|
|
49918
49922
|
});
|
|
49919
49923
|
if (this.userShown) {
|
|
@@ -49930,7 +49934,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
49930
49934
|
* @internal
|
|
49931
49935
|
*/
|
|
49932
49936
|
render() {
|
|
49933
|
-
trace(`${T$
|
|
49937
|
+
trace(`${T$2} render`, {
|
|
49934
49938
|
buffering: this.container.buffering,
|
|
49935
49939
|
});
|
|
49936
49940
|
this.$el.html(this.template());
|
|
@@ -49948,7 +49952,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
49948
49952
|
}
|
|
49949
49953
|
}
|
|
49950
49954
|
|
|
49951
|
-
const T = 'plugins.source_controller';
|
|
49955
|
+
const T$1 = 'plugins.source_controller';
|
|
49952
49956
|
const INITIAL_RETRY_DELAY = 1000;
|
|
49953
49957
|
const MAX_RETRY_DELAY = 5000;
|
|
49954
49958
|
const RETRY_DELAY_BLUR = 500;
|
|
@@ -50094,7 +50098,7 @@ class SourceController extends CorePlugin {
|
|
|
50094
50098
|
this.core.getPlugin('error_screen')?.disable(); // TODO test
|
|
50095
50099
|
}
|
|
50096
50100
|
onActiveContainerChanged() {
|
|
50097
|
-
trace(`${T} onActiveContainerChanged`, {
|
|
50101
|
+
trace(`${T$1} onActiveContainerChanged`, {
|
|
50098
50102
|
retrying: this.active,
|
|
50099
50103
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
50100
50104
|
});
|
|
@@ -50115,7 +50119,7 @@ class SourceController extends CorePlugin {
|
|
|
50115
50119
|
}
|
|
50116
50120
|
bindContainerEventListeners() {
|
|
50117
50121
|
this.core.activePlayback.on(Events$1.PLAYBACK_ERROR, (error) => {
|
|
50118
|
-
trace(`${T} on PLAYBACK_ERROR`, {
|
|
50122
|
+
trace(`${T$1} on PLAYBACK_ERROR`, {
|
|
50119
50123
|
error: {
|
|
50120
50124
|
code: error?.code,
|
|
50121
50125
|
description: error?.description,
|
|
@@ -50139,7 +50143,7 @@ class SourceController extends CorePlugin {
|
|
|
50139
50143
|
}
|
|
50140
50144
|
});
|
|
50141
50145
|
this.core.activePlayback.on(Events$1.PLAYBACK_PLAY, () => {
|
|
50142
|
-
trace(`${T} on PLAYBACK_PLAY`, {
|
|
50146
|
+
trace(`${T$1} on PLAYBACK_PLAY`, {
|
|
50143
50147
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
50144
50148
|
retrying: this.active,
|
|
50145
50149
|
});
|
|
@@ -50158,7 +50162,7 @@ class SourceController extends CorePlugin {
|
|
|
50158
50162
|
this.sourcesDelay = {};
|
|
50159
50163
|
}
|
|
50160
50164
|
retryPlayback() {
|
|
50161
|
-
trace(`${T} retryPlayback enter`, {
|
|
50165
|
+
trace(`${T$1} retryPlayback enter`, {
|
|
50162
50166
|
currentSourceIndex: this.currentSourceIndex,
|
|
50163
50167
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
50164
50168
|
});
|
|
@@ -50171,7 +50175,7 @@ class SourceController extends CorePlugin {
|
|
|
50171
50175
|
this.switching = false;
|
|
50172
50176
|
this.core.load(nextSource.source, nextSource.mimeType);
|
|
50173
50177
|
setTimeout(() => {
|
|
50174
|
-
trace(`${T} retryPlayback playing`, {
|
|
50178
|
+
trace(`${T$1} retryPlayback playing`, {
|
|
50175
50179
|
autoPlay: this.autoPlay,
|
|
50176
50180
|
});
|
|
50177
50181
|
this.core.activeContainer.play({
|
|
@@ -50211,6 +50215,7 @@ const stringHTML = "<div class=\"gplayer-cc-line\" id=\"gplayer-cc-line\">\n <p
|
|
|
50211
50215
|
|
|
50212
50216
|
const VERSION = '2.19.14';
|
|
50213
50217
|
const LOCAL_STORAGE_CC_ID = 'gplayer.plugins.cc.selected';
|
|
50218
|
+
const T = 'plugins.cc';
|
|
50214
50219
|
/**
|
|
50215
50220
|
* `PLUGIN` that provides a UI to select the subtitles when available.
|
|
50216
50221
|
* @beta
|
|
@@ -50224,6 +50229,14 @@ const LOCAL_STORAGE_CC_ID = 'gplayer.plugins.cc.selected';
|
|
|
50224
50229
|
* - {@link MediaControl}
|
|
50225
50230
|
*
|
|
50226
50231
|
* Configuration options - {@link ClosedCaptionsPluginSettings}
|
|
50232
|
+
*
|
|
50233
|
+
* Known issues:
|
|
50234
|
+
*
|
|
50235
|
+
* 1. When media source changes, the subtitles tracks aren't reloaded. Possible solution: use `playback.recycleVideo = false`
|
|
50236
|
+
* {@link PlayerConfig | main config option}, which will force new video element creation every time media source changes.
|
|
50237
|
+
* However, this may lead to other issues, such as autoplay not working (after media source has been changed).
|
|
50238
|
+
* {@link https://github.com/video-dev/hls.js/issues/2198 | related discussion}
|
|
50239
|
+
*
|
|
50227
50240
|
* @example
|
|
50228
50241
|
* ```ts
|
|
50229
50242
|
* import { ClosedCaptions } from '@gcorevideo/player'
|
|
@@ -50292,7 +50305,6 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
50292
50305
|
*/
|
|
50293
50306
|
bindEvents() {
|
|
50294
50307
|
this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
50295
|
-
this.listenTo(this.core, Events$1.CORE_RESIZE, this.playerResize);
|
|
50296
50308
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
|
|
50297
50309
|
}
|
|
50298
50310
|
onCoreReady() {
|
|
@@ -50309,7 +50321,8 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
50309
50321
|
});
|
|
50310
50322
|
}
|
|
50311
50323
|
onContainerChanged() {
|
|
50312
|
-
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_FULLSCREEN, this.
|
|
50324
|
+
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_FULLSCREEN, this.onContainerResize);
|
|
50325
|
+
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_RESIZE, this.onContainerResize);
|
|
50313
50326
|
this.listenTo(this.core.activeContainer, 'container:advertisement:start', this.onStartAd);
|
|
50314
50327
|
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_SUBTITLE_AVAILABLE, this.onSubtitleAvailable);
|
|
50315
50328
|
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_SUBTITLE_CHANGED, this.onSubtitleChanged);
|
|
@@ -50332,6 +50345,9 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
50332
50345
|
});
|
|
50333
50346
|
}
|
|
50334
50347
|
onSubtitleAvailable() {
|
|
50348
|
+
trace(`${T} onSubtitleAvailable`, {
|
|
50349
|
+
tracks: this.core.activePlayback.closedCaptionsTracks.length,
|
|
50350
|
+
});
|
|
50335
50351
|
this.applyTracks();
|
|
50336
50352
|
this.mount();
|
|
50337
50353
|
}
|
|
@@ -50382,7 +50398,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
50382
50398
|
this.show();
|
|
50383
50399
|
this.stopListening(this.core.activeContainer, 'container:advertisement:finish', this.onFinishAd);
|
|
50384
50400
|
}
|
|
50385
|
-
|
|
50401
|
+
onContainerResize() {
|
|
50386
50402
|
const shouldShow = this.core.activeContainer &&
|
|
50387
50403
|
isFullscreen(this.core.activeContainer.el) &&
|
|
50388
50404
|
this.track &&
|