@gcorevideo/player 2.22.18 → 2.22.21
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/audio-selector/track-selector.ejs +3 -3
- package/assets/bottom-gear/bottomgear.ejs +3 -3
- package/assets/dvr-controls/dvr_controls.scss +0 -12
- package/assets/level-selector/button.ejs +1 -1
- package/dist/core.js +1 -1
- package/dist/index.css +664 -671
- package/dist/index.js +285 -260
- package/dist/player.d.ts +144 -123
- package/dist/plugins/index.css +758 -765
- package/dist/plugins/index.js +194 -172
- package/docs/api/player.clapprstats.exportmetrics.md +2 -2
- package/docs/api/player.clapprstats.md +0 -4
- package/docs/api/player.clapprstatsbitratetrack.md +20 -0
- package/docs/api/player.clapprstatschronograph.md +115 -0
- package/docs/api/player.clapprstatscounter.md +211 -0
- package/docs/api/player.clapprstatsevents.md +51 -0
- package/docs/api/player.clapprstatsmetrics.md +52 -0
- package/docs/api/player.clipspluginsettings.md +1 -1
- package/docs/api/player.gearevents.md +1 -1
- package/docs/api/player.md +57 -2
- package/docs/api/player.mediacontrol.mount.md +0 -5
- package/docs/api/player.mediacontrol.putelement.md +5 -0
- package/docs/api/player.mediacontrol.toggleelement.md +1 -1
- package/docs/api/player.nerdstats.md +3 -3
- package/docs/api/player.playerconfig.md +1 -1
- package/docs/api/player.playerconfig.playbacktype.md +6 -1
- package/docs/api/player.timeupdate.md +6 -3
- package/lib/plugins/audio-selector/AudioSelector.d.ts +1 -1
- package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -1
- package/lib/plugins/audio-selector/AudioSelector.js +15 -8
- package/lib/plugins/bottom-gear/BottomGear.d.ts +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +2 -2
- package/lib/plugins/clappr-nerd-stats/NerdStats.d.ts +4 -4
- package/lib/plugins/clappr-nerd-stats/NerdStats.js +4 -4
- package/lib/plugins/clappr-stats/ClapprStats.d.ts +5 -2
- package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
- package/lib/plugins/clappr-stats/ClapprStats.js +31 -33
- package/lib/plugins/clappr-stats/types.d.ts +21 -21
- package/lib/plugins/clappr-stats/types.d.ts.map +1 -1
- package/lib/plugins/clappr-stats/types.js +22 -22
- package/lib/plugins/clappr-stats/utils.d.ts +2 -2
- package/lib/plugins/clappr-stats/utils.d.ts.map +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.js +1 -1
- package/lib/plugins/clips/Clips.d.ts +1 -1
- package/lib/plugins/dvr-controls/DvrControls.d.ts +6 -2
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.js +39 -27
- package/lib/plugins/media-control/MediaControl.d.ts +9 -2
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +26 -10
- package/lib/plugins/picture-in-picture/PictureInPicture.js +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.js +1 -1
- package/lib/plugins/vast-ads/VastAds.js +1 -1
- package/lib/plugins/vast-ads/rollmanager.js +1 -1
- package/lib/plugins/volume-fade/VolumeFade.d.ts +25 -10
- package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
- package/lib/plugins/volume-fade/VolumeFade.js +62 -60
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +7 -4
- package/lib/types.d.ts +1 -1
- package/package.json +3 -3
- package/src/playback/__tests__/HTML5Video.test.ts +2 -2
- package/src/plugins/audio-selector/AudioSelector.ts +14 -7
- package/src/plugins/audio-selector/__tests__/AudioSelector.test.ts +8 -8
- package/src/plugins/audio-selector/__tests__/__snapshots__/AudioSelector.test.ts.snap +15 -15
- package/src/plugins/bottom-gear/BottomGear.ts +2 -2
- package/src/plugins/bottom-gear/__tests__/BottomGear.test.ts +8 -5
- package/src/plugins/bottom-gear/__tests__/__snapshots__/BottomGear.test.ts.snap +3 -3
- package/src/plugins/clappr-nerd-stats/NerdStats.ts +5 -5
- package/src/plugins/clappr-stats/ClapprStats.ts +41 -40
- package/src/plugins/clappr-stats/__tests__/ClapprStats.test.ts +12 -12
- package/src/plugins/clappr-stats/types.ts +21 -21
- package/src/plugins/clappr-stats/utils.ts +2 -2
- package/src/plugins/click-to-pause/ClickToPause.ts +1 -1
- package/src/plugins/clips/Clips.ts +1 -1
- package/src/plugins/clips/__tests__/Clips.test.ts +1 -1
- package/src/plugins/clips/__tests__/__snapshots__/Clips.test.ts.snap +1 -1
- package/src/plugins/dvr-controls/DvrControls.ts +51 -37
- package/src/plugins/dvr-controls/__tests__/DvrControls.test.ts +84 -26
- package/src/plugins/dvr-controls/__tests__/__snapshots__/DvrControls.test.ts.snap +0 -12
- package/src/plugins/level-selector/__tests__/__snapshots__/QualityLevels.test.ts.snap +1 -1
- package/src/plugins/media-control/MediaControl.ts +27 -10
- package/src/plugins/media-control/__tests__/MediaControl.test.ts +8 -5
- package/src/plugins/media-control/__tests__/__snapshots__/MediaControl.test.ts.snap +20 -20
- 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/plugins/vast-ads/VastAds.ts +1 -1
- package/src/plugins/vast-ads/rollmanager.ts +1 -1
- package/src/plugins/volume-fade/VolumeFade.ts +92 -75
- package/src/testUtils.ts +11 -5
- package/src/types.ts +1 -1
- package/temp/player.api.json +634 -16
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -43303,7 +43303,7 @@ class Player {
|
|
|
43303
43303
|
}
|
|
43304
43304
|
}
|
|
43305
43305
|
|
|
43306
|
-
var version$1 = "2.22.
|
|
43306
|
+
var version$1 = "2.22.21";
|
|
43307
43307
|
|
|
43308
43308
|
var packages = {
|
|
43309
43309
|
"node_modules/@clappr/core": {
|
|
@@ -43327,10 +43327,11 @@ function version() {
|
|
|
43327
43327
|
};
|
|
43328
43328
|
}
|
|
43329
43329
|
|
|
43330
|
-
const pluginHtml$7 = "<button data-audiotracks-button class='gcore-skin-button-color' id=\"audiotracks-button\">\n <span class='audio-text'><%= title %></span> <span class=\"audio-arrow\"><%= icon %></span>\n</button>\n<ul class='gcore-skin-bg-color menu hidden' id=\"audiotracks-select\">\n <% for (const track of tracks) { %>\n <li>\n <a href=\"#\" class='gcore-skin-text-color' data-audiotracks-select=\"<%= track.id %>\">\n <%= track.label %>\n </a>\n </li>\n <% }; %>\n</ul>\n";
|
|
43330
|
+
const pluginHtml$7 = "<button data-audiotracks-button class='gcore-skin-button-color' id=\"audiotracks-button\" aria-haspopup=\"menu\" aria-expanded=\"false\">\n <span class='audio-text'><%= title %></span> <span class=\"audio-arrow\"><%= icon %></span>\n</button>\n<ul class='gcore-skin-bg-color menu hidden' id=\"audiotracks-select\" role=\"menu\">\n <% for (const track of tracks) { %>\n <li>\n <a href=\"#\" class='gcore-skin-text-color' data-audiotracks-select=\"<%= track.id %>\" role=\"menuitemradio\" aria-checked=\"<%= track.id === current %>\">\n <%= track.label %>\n </a>\n </li>\n <% }; %>\n</ul>\n";
|
|
43331
43331
|
|
|
43332
43332
|
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";
|
|
43333
43333
|
|
|
43334
|
+
// import { trace } from '@gcorevideo/utils'
|
|
43334
43335
|
const VERSION$7 = '2.22.4';
|
|
43335
43336
|
// const T = 'plugins.audiotracks'
|
|
43336
43337
|
/**
|
|
@@ -43393,7 +43394,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
43393
43394
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43394
43395
|
assert(mediaControl, 'media_control plugin is required');
|
|
43395
43396
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, () => {
|
|
43396
|
-
mediaControl.
|
|
43397
|
+
mediaControl.mount('audiotracks', this.$el);
|
|
43397
43398
|
});
|
|
43398
43399
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.hideMenu);
|
|
43399
43400
|
}
|
|
@@ -43424,18 +43425,18 @@ class AudioTracks extends UICorePlugin {
|
|
|
43424
43425
|
if (!this.shouldRender()) {
|
|
43425
43426
|
return this;
|
|
43426
43427
|
}
|
|
43427
|
-
this.core.getPlugin('media_control');
|
|
43428
43428
|
this.$el.html(AudioTracks.template({
|
|
43429
43429
|
tracks: this.tracks,
|
|
43430
43430
|
title: this.getTitle(),
|
|
43431
43431
|
icon: audioArrow,
|
|
43432
|
+
current: this.currentTrack?.id,
|
|
43432
43433
|
}));
|
|
43433
43434
|
this.updateText();
|
|
43434
43435
|
this.highlightCurrentTrack();
|
|
43435
43436
|
return this;
|
|
43436
43437
|
}
|
|
43437
43438
|
onTrackSelect(event) {
|
|
43438
|
-
const id = event.
|
|
43439
|
+
const id = event.currentTarget?.dataset?.audiotracksSelect;
|
|
43439
43440
|
if (id) {
|
|
43440
43441
|
this.selectAudioTrack(id);
|
|
43441
43442
|
}
|
|
@@ -43444,7 +43445,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
43444
43445
|
return false;
|
|
43445
43446
|
}
|
|
43446
43447
|
selectAudioTrack(id) {
|
|
43447
|
-
this.
|
|
43448
|
+
this.startTrackSwitching();
|
|
43448
43449
|
this.core.activeContainer.switchAudioTrack(id);
|
|
43449
43450
|
this.updateText();
|
|
43450
43451
|
}
|
|
@@ -43452,7 +43453,9 @@ class AudioTracks extends UICorePlugin {
|
|
|
43452
43453
|
this.$el.find('#audiotracks-select').addClass('hidden');
|
|
43453
43454
|
}
|
|
43454
43455
|
toggleContextMenu() {
|
|
43455
|
-
this.$el.find('#audiotracks-select').toggleClass('hidden');
|
|
43456
|
+
this.$el.find('#audiotracks-select').toggleClass('hidden'); // TODO use plain CSS display: none
|
|
43457
|
+
const open = !this.$el.find('#audiotracks-select').hasClass('hidden'); // TODO hold state
|
|
43458
|
+
this.$el.find('#audiotracks-button').attr('aria-expanded', open);
|
|
43456
43459
|
}
|
|
43457
43460
|
buttonElement() {
|
|
43458
43461
|
return this.$('button');
|
|
@@ -43470,7 +43473,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
43470
43473
|
}
|
|
43471
43474
|
return this.currentTrack.label || this.currentTrack.language;
|
|
43472
43475
|
}
|
|
43473
|
-
|
|
43476
|
+
startTrackSwitching() {
|
|
43474
43477
|
this.buttonElement().addClass('changing');
|
|
43475
43478
|
}
|
|
43476
43479
|
updateText() {
|
|
@@ -43481,12 +43484,16 @@ class AudioTracks extends UICorePlugin {
|
|
|
43481
43484
|
}
|
|
43482
43485
|
highlightCurrentTrack() {
|
|
43483
43486
|
this.trackElement().removeClass('current');
|
|
43484
|
-
this.trackElement()
|
|
43487
|
+
this.trackElement()
|
|
43488
|
+
.find('a')
|
|
43489
|
+
.removeClass('gcore-skin-active')
|
|
43490
|
+
.attr('aria-checked', 'false');
|
|
43485
43491
|
if (this.currentTrack) {
|
|
43486
43492
|
this.trackElement(this.currentTrack.id)
|
|
43487
43493
|
.addClass('current')
|
|
43488
43494
|
.find('a')
|
|
43489
|
-
.addClass('gcore-skin-active')
|
|
43495
|
+
.addClass('gcore-skin-active')
|
|
43496
|
+
.attr('aria-checked', 'true');
|
|
43490
43497
|
}
|
|
43491
43498
|
}
|
|
43492
43499
|
}
|
|
@@ -43641,7 +43648,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43641
43648
|
}
|
|
43642
43649
|
}
|
|
43643
43650
|
|
|
43644
|
-
const pluginHtml$5 = "<button
|
|
43651
|
+
const pluginHtml$5 = "<button class=\"media-control-button gplayer-lite-btn gcore-skin-button-color gear-icon\" id=\"gear-button\">\n <%= icon %>\n</button>\n<div class=\"gear-wrapper gcore-skin-bg-color\" id=\"gear-options-wrapper\" style=\"display:none\">\n <ul class=\"gear-options-list\" id=\"gear-options\" role=\"menu\"></ul>\n</div>\n";
|
|
43645
43652
|
|
|
43646
43653
|
const gearIcon = "<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_660_1503)\">\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 </g>\n <defs>\n <clipPath id=\"clip0_660_1503\">\n <rect width=\"24\" height=\"24\" fill=\"white\"/>\n </clipPath>\n </defs>\n</svg>\n";
|
|
43647
43654
|
|
|
@@ -43656,7 +43663,7 @@ const T$g = 'plugins.bottom_gear';
|
|
|
43656
43663
|
var GearEvents;
|
|
43657
43664
|
(function (GearEvents) {
|
|
43658
43665
|
/**
|
|
43659
|
-
*
|
|
43666
|
+
* Subscribe to this event to accurately attach an item to the gear menu
|
|
43660
43667
|
*/
|
|
43661
43668
|
GearEvents["RENDERED"] = "rendered";
|
|
43662
43669
|
})(GearEvents || (GearEvents = {}));
|
|
@@ -43877,39 +43884,39 @@ class BottomGear extends UICorePlugin {
|
|
|
43877
43884
|
onMediaControlRendered() {
|
|
43878
43885
|
trace(`${T$g} onMediaControlRendered`);
|
|
43879
43886
|
const mediaControl = this.core.getPlugin('media_control');
|
|
43880
|
-
mediaControl.
|
|
43887
|
+
mediaControl.mount('gear', this.$el);
|
|
43881
43888
|
}
|
|
43882
43889
|
}
|
|
43883
43890
|
|
|
43884
43891
|
/**
|
|
43885
43892
|
* @beta
|
|
43886
43893
|
*/
|
|
43887
|
-
var
|
|
43888
|
-
(function (
|
|
43889
|
-
|
|
43890
|
-
|
|
43891
|
-
|
|
43892
|
-
|
|
43893
|
-
|
|
43894
|
+
var ClapprStatsChronograph;
|
|
43895
|
+
(function (ClapprStatsChronograph) {
|
|
43896
|
+
ClapprStatsChronograph["Startup"] = "startup";
|
|
43897
|
+
ClapprStatsChronograph["Watch"] = "watch";
|
|
43898
|
+
ClapprStatsChronograph["Pause"] = "pause";
|
|
43899
|
+
ClapprStatsChronograph["Buffering"] = "buffering";
|
|
43900
|
+
ClapprStatsChronograph["Session"] = "session";
|
|
43894
43901
|
// Latency = 'latency',
|
|
43895
|
-
})(
|
|
43902
|
+
})(ClapprStatsChronograph || (ClapprStatsChronograph = {}));
|
|
43896
43903
|
/**
|
|
43897
43904
|
* @beta
|
|
43898
43905
|
*/
|
|
43899
|
-
var
|
|
43900
|
-
(function (
|
|
43901
|
-
|
|
43902
|
-
|
|
43903
|
-
|
|
43904
|
-
|
|
43905
|
-
|
|
43906
|
-
|
|
43907
|
-
|
|
43908
|
-
|
|
43909
|
-
|
|
43910
|
-
|
|
43911
|
-
|
|
43912
|
-
})(
|
|
43906
|
+
var ClapprStatsCounter;
|
|
43907
|
+
(function (ClapprStatsCounter) {
|
|
43908
|
+
ClapprStatsCounter["Play"] = "play";
|
|
43909
|
+
ClapprStatsCounter["Pause"] = "pause";
|
|
43910
|
+
ClapprStatsCounter["Error"] = "error";
|
|
43911
|
+
ClapprStatsCounter["Buffering"] = "buffering";
|
|
43912
|
+
ClapprStatsCounter["DecodedFrames"] = "decodedFrames";
|
|
43913
|
+
ClapprStatsCounter["DroppedFrames"] = "droppedFrames";
|
|
43914
|
+
ClapprStatsCounter["Fps"] = "fps";
|
|
43915
|
+
ClapprStatsCounter["ChangeLevel"] = "changeLevel";
|
|
43916
|
+
ClapprStatsCounter["Seek"] = "seek";
|
|
43917
|
+
ClapprStatsCounter["Fullscreen"] = "fullscreen";
|
|
43918
|
+
ClapprStatsCounter["DvrUsage"] = "dvrUsage";
|
|
43919
|
+
})(ClapprStatsCounter || (ClapprStatsCounter = {}));
|
|
43913
43920
|
/**
|
|
43914
43921
|
* @beta
|
|
43915
43922
|
*/
|
|
@@ -43970,6 +43977,8 @@ function newMetrics$1() {
|
|
|
43970
43977
|
* @remarks
|
|
43971
43978
|
* This plugin does not render anything and is supposed to be extended or used together with other plugins that actually render something.
|
|
43972
43979
|
*
|
|
43980
|
+
* @see {@link NerdStats} - a plugin that visualises the playback metrics
|
|
43981
|
+
*
|
|
43973
43982
|
* Configuration options - {@link ClapprStatsSettings}
|
|
43974
43983
|
*
|
|
43975
43984
|
* Events - {@link ClapprStatsEvents}
|
|
@@ -43979,11 +43988,11 @@ class ClapprStats extends ContainerPlugin {
|
|
|
43979
43988
|
lastDecodedFramesCount = 0;
|
|
43980
43989
|
metrics = newMetrics$1();
|
|
43981
43990
|
timers = {
|
|
43982
|
-
[
|
|
43983
|
-
[
|
|
43984
|
-
[
|
|
43985
|
-
[
|
|
43986
|
-
[
|
|
43991
|
+
[ClapprStatsChronograph.Startup]: 0,
|
|
43992
|
+
[ClapprStatsChronograph.Watch]: 0,
|
|
43993
|
+
[ClapprStatsChronograph.Pause]: 0,
|
|
43994
|
+
[ClapprStatsChronograph.Buffering]: 0,
|
|
43995
|
+
[ClapprStatsChronograph.Session]: 0,
|
|
43987
43996
|
};
|
|
43988
43997
|
runEach;
|
|
43989
43998
|
/**
|
|
@@ -44013,15 +44022,10 @@ class ClapprStats extends ContainerPlugin {
|
|
|
44013
44022
|
inc(counter) {
|
|
44014
44023
|
this.metrics.counters[counter] += 1;
|
|
44015
44024
|
}
|
|
44016
|
-
// _timerHasStarted(timer) {
|
|
44017
|
-
// return this[`_start${timer}`] !== undefined;
|
|
44018
|
-
// }
|
|
44019
44025
|
start(timer) {
|
|
44020
|
-
// this[`_start${timer}`] = this._now();
|
|
44021
44026
|
this.timers[timer] = this.now();
|
|
44022
44027
|
}
|
|
44023
44028
|
stop(timer) {
|
|
44024
|
-
// this._metrics.timers[timer] += this._now() - this[`_start${timer}`];
|
|
44025
44029
|
this.metrics.chrono[timer] += this.now() - this.timers[timer];
|
|
44026
44030
|
}
|
|
44027
44031
|
constructor(container) {
|
|
@@ -44041,10 +44045,10 @@ class ClapprStats extends ContainerPlugin {
|
|
|
44041
44045
|
this.listenTo(this.container, Events$1.CONTAINER_PAUSE, this.onPause);
|
|
44042
44046
|
this.listenToOnce(this.container, Events$1.CONTAINER_STATE_BUFFERING, this.onBuffering);
|
|
44043
44047
|
this.listenTo(this.container, Events$1.CONTAINER_SEEK, this.onSeek);
|
|
44044
|
-
this.listenTo(this.container, Events$1.CONTAINER_ERROR, () => this.inc(
|
|
44045
|
-
this.listenTo(this.container, Events$1.CONTAINER_FULLSCREEN, () => this.inc(
|
|
44048
|
+
this.listenTo(this.container, Events$1.CONTAINER_ERROR, () => this.inc(ClapprStatsCounter.Error));
|
|
44049
|
+
this.listenTo(this.container, Events$1.CONTAINER_FULLSCREEN, () => this.inc(ClapprStatsCounter.Fullscreen));
|
|
44046
44050
|
this.listenTo(this.container, Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, (dvrInUse) => {
|
|
44047
|
-
dvrInUse && this.inc(
|
|
44051
|
+
dvrInUse && this.inc(ClapprStatsCounter.DvrUsage);
|
|
44048
44052
|
});
|
|
44049
44053
|
this.listenTo(this.container.playback, Events$1.PLAYBACK_PROGRESS, this.onProgress);
|
|
44050
44054
|
this.listenTo(this.container.playback, Events$1.PLAYBACK_TIMEUPDATE, this.onTimeUpdate);
|
|
@@ -44072,7 +44076,7 @@ class ClapprStats extends ContainerPlugin {
|
|
|
44072
44076
|
last.time = now - last.start;
|
|
44073
44077
|
}
|
|
44074
44078
|
this.metrics.extra.bitratesHistory.push({ start: this.now(), bitrate });
|
|
44075
|
-
this.inc(
|
|
44079
|
+
this.inc(ClapprStatsCounter.ChangeLevel);
|
|
44076
44080
|
}
|
|
44077
44081
|
stopReporting() {
|
|
44078
44082
|
this.buildReport();
|
|
@@ -44083,31 +44087,31 @@ class ClapprStats extends ContainerPlugin {
|
|
|
44083
44087
|
}
|
|
44084
44088
|
startTimers() {
|
|
44085
44089
|
this.timerId = setInterval(this.buildReport.bind(this), this.runEach);
|
|
44086
|
-
this.start(
|
|
44087
|
-
this.start(
|
|
44090
|
+
this.start(ClapprStatsChronograph.Session);
|
|
44091
|
+
this.start(ClapprStatsChronograph.Startup);
|
|
44088
44092
|
}
|
|
44089
44093
|
onFirstPlaying() {
|
|
44090
44094
|
this.listenTo(this.container, Events$1.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
44091
|
-
this.start(
|
|
44092
|
-
this.stop(
|
|
44095
|
+
this.start(ClapprStatsChronograph.Watch);
|
|
44096
|
+
this.stop(ClapprStatsChronograph.Startup);
|
|
44093
44097
|
}
|
|
44094
44098
|
playAfterPause() {
|
|
44095
44099
|
this.listenTo(this.container, Events$1.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
44096
|
-
this.stop(
|
|
44097
|
-
this.start(
|
|
44100
|
+
this.stop(ClapprStatsChronograph.Pause);
|
|
44101
|
+
this.start(ClapprStatsChronograph.Watch);
|
|
44098
44102
|
}
|
|
44099
44103
|
onPlay() {
|
|
44100
|
-
this.inc(
|
|
44104
|
+
this.inc(ClapprStatsCounter.Play);
|
|
44101
44105
|
}
|
|
44102
44106
|
onPause() {
|
|
44103
|
-
this.stop(
|
|
44104
|
-
this.start(
|
|
44105
|
-
this.inc(
|
|
44107
|
+
this.stop(ClapprStatsChronograph.Watch);
|
|
44108
|
+
this.start(ClapprStatsChronograph.Pause);
|
|
44109
|
+
this.inc(ClapprStatsCounter.Pause);
|
|
44106
44110
|
this.listenToOnce(this.container, Events$1.CONTAINER_PLAY, this.playAfterPause);
|
|
44107
44111
|
this.stopListening(this.container, Events$1.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
44108
44112
|
}
|
|
44109
44113
|
onSeek(e) {
|
|
44110
|
-
this.inc(
|
|
44114
|
+
this.inc(ClapprStatsCounter.Seek);
|
|
44111
44115
|
this.metrics.extra.watchHistory.push([e * 1000, e * 1000]);
|
|
44112
44116
|
}
|
|
44113
44117
|
onTimeUpdate(e) {
|
|
@@ -44132,17 +44136,17 @@ class ClapprStats extends ContainerPlugin {
|
|
|
44132
44136
|
}
|
|
44133
44137
|
onContainerUpdateWhilePlaying() {
|
|
44134
44138
|
if (this.container.playback.isPlaying()) {
|
|
44135
|
-
this.stop(
|
|
44136
|
-
this.start(
|
|
44139
|
+
this.stop(ClapprStatsChronograph.Watch);
|
|
44140
|
+
this.start(ClapprStatsChronograph.Watch);
|
|
44137
44141
|
}
|
|
44138
44142
|
}
|
|
44139
44143
|
onBuffering() {
|
|
44140
|
-
this.inc(
|
|
44141
|
-
this.start(
|
|
44144
|
+
this.inc(ClapprStatsCounter.Buffering);
|
|
44145
|
+
this.start(ClapprStatsChronograph.Buffering);
|
|
44142
44146
|
this.listenToOnce(this.container, Events$1.CONTAINER_STATE_BUFFERFULL, this.onBufferfull);
|
|
44143
44147
|
}
|
|
44144
44148
|
onBufferfull() {
|
|
44145
|
-
this.stop(
|
|
44149
|
+
this.stop(ClapprStatsChronograph.Buffering);
|
|
44146
44150
|
this.listenToOnce(this.container, Events$1.CONTAINER_STATE_BUFFERING, this.onBuffering);
|
|
44147
44151
|
}
|
|
44148
44152
|
onProgress(progress) {
|
|
@@ -44154,8 +44158,8 @@ class ClapprStats extends ContainerPlugin {
|
|
|
44154
44158
|
// this.trigger(ClapprStatsEvents.PERCENTAGE, currentPercentage);
|
|
44155
44159
|
}
|
|
44156
44160
|
buildReport() {
|
|
44157
|
-
this.stop(
|
|
44158
|
-
this.start(
|
|
44161
|
+
this.stop(ClapprStatsChronograph.Session);
|
|
44162
|
+
this.start(ClapprStatsChronograph.Session);
|
|
44159
44163
|
this.metrics.extra.playbackName = this.playbackName;
|
|
44160
44164
|
this.metrics.extra.playbackType = this.playbackType;
|
|
44161
44165
|
this.calcBitrates();
|
|
@@ -46344,16 +46348,16 @@ const PLAYBACK_NAMES = {
|
|
|
46344
46348
|
};
|
|
46345
46349
|
const T$f = 'plugins.nerd_stats';
|
|
46346
46350
|
/**
|
|
46347
|
-
* `PLUGIN` that displays useful network
|
|
46351
|
+
* `PLUGIN` that displays useful statistics regarding the playback as well as the network quality estimation.
|
|
46348
46352
|
* @beta
|
|
46349
46353
|
*
|
|
46350
46354
|
* @remarks
|
|
46351
46355
|
* Depends on:
|
|
46352
46356
|
*
|
|
46353
|
-
* - {@link BottomGear}
|
|
46354
|
-
*
|
|
46355
|
-
* - {@link ClapprStats}
|
|
46357
|
+
* - {@link BottomGear} - where the button is attached
|
|
46356
46358
|
*
|
|
46359
|
+
* - {@link ClapprStats} - to get the metrics from
|
|
46360
|
+
*
|
|
46357
46361
|
* The plugin is rendered as an item in the gear menu.
|
|
46358
46362
|
*
|
|
46359
46363
|
* When clicked, it shows an overlay window with the information about the network speed, latency, etc,
|
|
@@ -46728,7 +46732,7 @@ class ClickToPause extends ContainerPlugin {
|
|
|
46728
46732
|
* @internal
|
|
46729
46733
|
*/
|
|
46730
46734
|
get name() {
|
|
46731
|
-
return '
|
|
46735
|
+
return 'click_to_pause';
|
|
46732
46736
|
}
|
|
46733
46737
|
/**
|
|
46734
46738
|
* @internal
|
|
@@ -47128,7 +47132,7 @@ class ContextMenu extends UIContainerPlugin {
|
|
|
47128
47132
|
|
|
47129
47133
|
const dvrHTML = "<div class=\"live-info\" id=\"media-control-live\"><%= i18n.t('live') %></div>\n<button type=\"button\" class=\"live-button\" aria-label=\"<%= i18n.t('back_to_live') %>\" id=\"media-control-back-to-live\"><%= i18n.t('back_to_live') %></button>\n";
|
|
47130
47134
|
|
|
47131
|
-
const T
|
|
47135
|
+
// const T = 'plugins.dvr_controls'
|
|
47132
47136
|
/**
|
|
47133
47137
|
* `PLUGIN` that adds the DVR controls to the media control UI
|
|
47134
47138
|
*
|
|
@@ -47177,19 +47181,17 @@ class DvrControls extends UICorePlugin {
|
|
|
47177
47181
|
* @internal
|
|
47178
47182
|
*/
|
|
47179
47183
|
bindEvents() {
|
|
47180
|
-
this.
|
|
47181
|
-
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.
|
|
47184
|
+
this.listenToOnce(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
47185
|
+
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
47182
47186
|
}
|
|
47183
47187
|
onCoreReady() {
|
|
47184
47188
|
const mediaControl = this.core.getPlugin('media_control');
|
|
47185
47189
|
assert(mediaControl, 'media_control plugin is required');
|
|
47186
|
-
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.
|
|
47187
|
-
// MediaControl has been rendered
|
|
47188
|
-
this.render();
|
|
47190
|
+
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mount);
|
|
47189
47191
|
}
|
|
47190
|
-
|
|
47191
|
-
|
|
47192
|
-
this.
|
|
47192
|
+
onActiveContainerChanged() {
|
|
47193
|
+
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_LOADEDMETADATA, this.onMetadataLoaded);
|
|
47194
|
+
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, this.onDvrStateChanged);
|
|
47193
47195
|
}
|
|
47194
47196
|
click() {
|
|
47195
47197
|
const container = this.core.activeContainer;
|
|
@@ -47198,39 +47200,54 @@ class DvrControls extends UICorePlugin {
|
|
|
47198
47200
|
}
|
|
47199
47201
|
container.seek(container.getDuration());
|
|
47200
47202
|
}
|
|
47201
|
-
shouldRender() {
|
|
47202
|
-
return this.core.getPlaybackType() === Playback.LIVE;
|
|
47203
|
-
}
|
|
47204
47203
|
/**
|
|
47205
47204
|
* @internal
|
|
47206
47205
|
*/
|
|
47207
47206
|
render() {
|
|
47208
|
-
trace(`${T$c} render`, {
|
|
47209
|
-
dvrEnabled: this.core.activePlayback?.dvrEnabled,
|
|
47210
|
-
playbackType: this.core.getPlaybackType(),
|
|
47211
|
-
});
|
|
47212
|
-
const mediaControl = this.core.getPlugin('media_control');
|
|
47213
|
-
if (!mediaControl) {
|
|
47214
|
-
return this;
|
|
47215
|
-
}
|
|
47216
|
-
if (!this.shouldRender()) {
|
|
47217
|
-
return this;
|
|
47218
|
-
}
|
|
47219
|
-
mediaControl.toggleElement('duration', false);
|
|
47220
|
-
mediaControl.toggleElement('position', false);
|
|
47221
47207
|
this.$el.html(DvrControls.template({
|
|
47222
47208
|
i18n: this.core.i18n,
|
|
47223
47209
|
}));
|
|
47224
|
-
mediaControl.putElement('dvr', this.$el);
|
|
47225
47210
|
return this;
|
|
47226
47211
|
}
|
|
47212
|
+
onMediacontrolRendered() {
|
|
47213
|
+
this.render();
|
|
47214
|
+
}
|
|
47215
|
+
onMetadataLoaded() {
|
|
47216
|
+
this.mount();
|
|
47217
|
+
this.toggleState(this.core.activeContainer.isDvrInUse());
|
|
47218
|
+
}
|
|
47219
|
+
mount() {
|
|
47220
|
+
// TODO move mount point management logic to MediaControl
|
|
47221
|
+
if (this.core.getPlaybackType() !== Playback.LIVE) {
|
|
47222
|
+
return;
|
|
47223
|
+
}
|
|
47224
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
47225
|
+
assert(mediaControl, 'media_control plugin is required');
|
|
47226
|
+
// TODO -> to MediaControl
|
|
47227
|
+
mediaControl.toggleElement('duration', false);
|
|
47228
|
+
mediaControl.toggleElement('position', false);
|
|
47229
|
+
mediaControl.mount('dvr', this.$el);
|
|
47230
|
+
}
|
|
47231
|
+
onDvrStateChanged(dvrInUse) {
|
|
47232
|
+
this.toggleState(dvrInUse);
|
|
47233
|
+
}
|
|
47234
|
+
toggleState(dvrInUse) {
|
|
47235
|
+
if (dvrInUse) {
|
|
47236
|
+
this.$el.find('#media-control-back-to-live').show();
|
|
47237
|
+
this.$el.find('#media-control-live').hide();
|
|
47238
|
+
}
|
|
47239
|
+
else {
|
|
47240
|
+
this.$el.find('#media-control-back-to-live').hide();
|
|
47241
|
+
this.$el.find('#media-control-live').show();
|
|
47242
|
+
}
|
|
47243
|
+
}
|
|
47227
47244
|
}
|
|
47228
47245
|
|
|
47229
47246
|
const reloadIcon = "<svg fill=\"#FFFFFF\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\"/>\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\n</svg>";
|
|
47230
47247
|
|
|
47231
47248
|
const templateHtml = "<div class=\"player-error-screen__content\" data-error-screen>\n <% if (icon) { %>\n <div class=\"player-error-screen__icon\" data-error-screen><%= icon %></div>\n <% } %>\n <div class=\"player-error-screen__title\" data-error-screen><%= title %></div>\n <% if (message) { %>\n <div class=\"player-error-screen__message\" data-error-screen><%= message %></div>\n <% } %>\n <% if (code) { %>\n <div class=\"player-error-screen__code\" data-error-screen><%= i18n.t('error_code') %>: <%= code %></div>\n <% } %>\n <% if (reloadIcon) { %>\n <div class=\"player-error-screen__reload\" data-error-screen><%= reloadIcon %></div>\n <% } %>\n</div>\n";
|
|
47232
47249
|
|
|
47233
|
-
const T$
|
|
47250
|
+
const T$c = 'plugins.error_screen';
|
|
47234
47251
|
/**
|
|
47235
47252
|
* `PLUGIN` that displays fatal errors nicely in the overlay on top of the player.
|
|
47236
47253
|
* @public
|
|
@@ -47282,11 +47299,11 @@ class ErrorScreen extends UICorePlugin {
|
|
|
47282
47299
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
47283
47300
|
}
|
|
47284
47301
|
onPlay() {
|
|
47285
|
-
trace(`${T$
|
|
47302
|
+
trace(`${T$c} onPlay`);
|
|
47286
47303
|
this.unmount();
|
|
47287
47304
|
}
|
|
47288
47305
|
unmount() {
|
|
47289
|
-
trace(`${T$
|
|
47306
|
+
trace(`${T$c} unmount`);
|
|
47290
47307
|
this.err = null;
|
|
47291
47308
|
this.$el.remove();
|
|
47292
47309
|
}
|
|
@@ -47299,7 +47316,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
47299
47316
|
};
|
|
47300
47317
|
}
|
|
47301
47318
|
reload() {
|
|
47302
|
-
trace(`${T$
|
|
47319
|
+
trace(`${T$c} reload`);
|
|
47303
47320
|
setTimeout(() => {
|
|
47304
47321
|
this.core.configure({
|
|
47305
47322
|
reloading: true,
|
|
@@ -47309,7 +47326,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
47309
47326
|
}, 0);
|
|
47310
47327
|
}
|
|
47311
47328
|
onActiveContainerChanged() {
|
|
47312
|
-
trace(`${T$
|
|
47329
|
+
trace(`${T$c} onActiveContainerChanged`, {
|
|
47313
47330
|
reloading: this.core.options.reloading,
|
|
47314
47331
|
});
|
|
47315
47332
|
this.err = null;
|
|
@@ -47325,7 +47342,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
47325
47342
|
}
|
|
47326
47343
|
}
|
|
47327
47344
|
onError(err) {
|
|
47328
|
-
trace(`${T$
|
|
47345
|
+
trace(`${T$c} onError`, { err });
|
|
47329
47346
|
if (err.UI) {
|
|
47330
47347
|
if (this.err) {
|
|
47331
47348
|
this.unmount();
|
|
@@ -48033,8 +48050,6 @@ const DEFAULT_SETTINGS = {
|
|
|
48033
48050
|
right: [
|
|
48034
48051
|
'audiotracks',
|
|
48035
48052
|
'cc',
|
|
48036
|
-
// 'dvr',
|
|
48037
|
-
// 'duration',
|
|
48038
48053
|
'fullscreen',
|
|
48039
48054
|
'gear',
|
|
48040
48055
|
'multicamera',
|
|
@@ -48047,15 +48062,19 @@ const INITIAL_SETTINGS = {
|
|
|
48047
48062
|
default: [],
|
|
48048
48063
|
seekEnabled: false,
|
|
48049
48064
|
};
|
|
48050
|
-
const T$
|
|
48065
|
+
const T$b = 'plugins.media_control';
|
|
48051
48066
|
const LEFT_ORDER = [
|
|
48052
48067
|
'playpause',
|
|
48053
48068
|
'playstop',
|
|
48054
|
-
'dvr',
|
|
48055
48069
|
'volume',
|
|
48056
48070
|
'position',
|
|
48057
48071
|
'duration',
|
|
48072
|
+
'dvr',
|
|
48058
48073
|
];
|
|
48074
|
+
var ExtendedEvents;
|
|
48075
|
+
(function (ExtendedEvents) {
|
|
48076
|
+
ExtendedEvents["MEDIACONTROL_VOLUME"] = "mediacontrol:volume";
|
|
48077
|
+
})(ExtendedEvents || (ExtendedEvents = {}));
|
|
48059
48078
|
const { Config, Fullscreen, formatTime: formatTime$1, extend, removeArrayItem } = Utils;
|
|
48060
48079
|
function orderByOrderPattern(arr, order) {
|
|
48061
48080
|
const arrWithoutDuplicates = [...new Set(arr)];
|
|
@@ -48293,7 +48312,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48293
48312
|
* Hides the media control UI
|
|
48294
48313
|
*/
|
|
48295
48314
|
disable() {
|
|
48296
|
-
trace(`${T$
|
|
48315
|
+
trace(`${T$b} disable`);
|
|
48297
48316
|
this.userDisabled = true; // TODO distinguish between user and system (e.g., unplayable) disabled?
|
|
48298
48317
|
this.hide();
|
|
48299
48318
|
this.unbindKeyEvents();
|
|
@@ -48303,7 +48322,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48303
48322
|
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
48304
48323
|
*/
|
|
48305
48324
|
enable() {
|
|
48306
|
-
trace(`${T$
|
|
48325
|
+
trace(`${T$b} enable`);
|
|
48307
48326
|
if (this.options.chromeless) {
|
|
48308
48327
|
return;
|
|
48309
48328
|
}
|
|
@@ -48536,14 +48555,15 @@ class MediaControl extends UICorePlugin {
|
|
|
48536
48555
|
// if the container is not ready etc
|
|
48537
48556
|
this.intendedVolume = value;
|
|
48538
48557
|
this.persistConfig && !isInitialVolume && Config.persist('volume', value);
|
|
48539
|
-
// TODO
|
|
48540
48558
|
const setWhenContainerReady = () => {
|
|
48541
48559
|
if (this.core.activeContainer && this.core.activeContainer.isReady) {
|
|
48542
48560
|
this.core.activeContainer.setVolume(value);
|
|
48561
|
+
this.trigger(ExtendedEvents.MEDIACONTROL_VOLUME, value);
|
|
48543
48562
|
}
|
|
48544
48563
|
else {
|
|
48545
48564
|
this.listenToOnce(this.core.activeContainer, Events$1.CONTAINER_READY, () => {
|
|
48546
48565
|
this.core.activeContainer.setVolume(value);
|
|
48566
|
+
this.trigger(ExtendedEvents.MEDIACONTROL_VOLUME, value);
|
|
48547
48567
|
});
|
|
48548
48568
|
}
|
|
48549
48569
|
};
|
|
@@ -48701,8 +48721,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48701
48721
|
}
|
|
48702
48722
|
this.$el.show();
|
|
48703
48723
|
this.trigger(Events$1.MEDIACONTROL_SHOW, this.name);
|
|
48704
|
-
this.
|
|
48705
|
-
this.container.trigger(Events$1.CONTAINER_MEDIACONTROL_SHOW, this.name);
|
|
48724
|
+
this.core.activeContainer?.trigger(Events$1.CONTAINER_MEDIACONTROL_SHOW, this.name);
|
|
48706
48725
|
this.$el.removeClass('media-control-hide');
|
|
48707
48726
|
this.hideId = setTimeout(() => this.hide(), timeout);
|
|
48708
48727
|
if (event) {
|
|
@@ -48749,14 +48768,14 @@ class MediaControl extends UICorePlugin {
|
|
|
48749
48768
|
}
|
|
48750
48769
|
}
|
|
48751
48770
|
updateSettings() {
|
|
48752
|
-
trace(`${T$
|
|
48771
|
+
trace(`${T$b} updateSettings`, { settings: this.settings });
|
|
48753
48772
|
const newSettings = $.extend(true, {
|
|
48754
48773
|
left: [],
|
|
48755
48774
|
default: [],
|
|
48756
48775
|
right: [],
|
|
48757
48776
|
}, this.core.activeContainer.settings);
|
|
48758
|
-
trace(`${T$
|
|
48759
|
-
newSettings.left.push('clips'); // TODO
|
|
48777
|
+
trace(`${T$b} updateSettings`, { newSettings });
|
|
48778
|
+
newSettings.left.push('clips'); // TODO settings
|
|
48760
48779
|
// TODO make order controlled via CSS
|
|
48761
48780
|
newSettings.left = orderByOrderPattern([...newSettings.left, 'volume', 'clips'], LEFT_ORDER);
|
|
48762
48781
|
if (this.core.activePlayback.getPlaybackType() === Playback.LIVE &&
|
|
@@ -48767,7 +48786,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48767
48786
|
newSettings.right = DEFAULT_SETTINGS.right; // TODO get from the options
|
|
48768
48787
|
if ((!this.fullScreenOnVideoTagSupported && !fullscreenEnabled()) ||
|
|
48769
48788
|
this.options.fullscreenDisable) {
|
|
48770
|
-
trace(`${T$
|
|
48789
|
+
trace(`${T$b} updateSettings removing fullscreen`, {
|
|
48771
48790
|
supported: this.fullScreenOnVideoTagSupported,
|
|
48772
48791
|
enabled: Fullscreen.fullscreenEnabled(),
|
|
48773
48792
|
optionsDisable: this.options.fullscreenDisable,
|
|
@@ -48819,7 +48838,6 @@ class MediaControl extends UICorePlugin {
|
|
|
48819
48838
|
* Get a media control element DOM node
|
|
48820
48839
|
* @param name - The name of the media control element
|
|
48821
48840
|
* @returns The DOM node to render to or extend
|
|
48822
|
-
* @deprecated Use {@link MediaControl.putElement} instead
|
|
48823
48841
|
* @remarks
|
|
48824
48842
|
* Use this method to render custom media control UI in a plugin
|
|
48825
48843
|
* @example
|
|
@@ -48835,7 +48853,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48835
48853
|
*/
|
|
48836
48854
|
mount(name, element) {
|
|
48837
48855
|
const panel = this.getElementLocation(name);
|
|
48838
|
-
trace(`${T$
|
|
48856
|
+
trace(`${T$b} mount`, { name, panel: !!panel });
|
|
48839
48857
|
if (panel) {
|
|
48840
48858
|
const current = panel.find(`[data-${name}]`);
|
|
48841
48859
|
element.attr(`data-${name}`, '');
|
|
@@ -48852,13 +48870,18 @@ class MediaControl extends UICorePlugin {
|
|
|
48852
48870
|
return;
|
|
48853
48871
|
}
|
|
48854
48872
|
}
|
|
48873
|
+
/**
|
|
48874
|
+
* @deprecated Use {@link MediaControl.mount} instead
|
|
48875
|
+
* @param name
|
|
48876
|
+
* @param element
|
|
48877
|
+
*/
|
|
48855
48878
|
putElement(name, element) {
|
|
48856
48879
|
this.mount(name, element);
|
|
48857
48880
|
}
|
|
48858
48881
|
/**
|
|
48859
48882
|
* Toggle the visibility of a media control element
|
|
48860
48883
|
* @param name - The name of the media control element
|
|
48861
|
-
* @param show -
|
|
48884
|
+
* @param show - Visibility state
|
|
48862
48885
|
*/
|
|
48863
48886
|
toggleElement(area, show) {
|
|
48864
48887
|
this.$el.find(`[data-${area}]`).toggle(show);
|
|
@@ -49026,7 +49049,7 @@ class MediaControl extends UICorePlugin {
|
|
|
49026
49049
|
* @internal
|
|
49027
49050
|
*/
|
|
49028
49051
|
render() {
|
|
49029
|
-
trace(`${T$
|
|
49052
|
+
trace(`${T$b} render`, {
|
|
49030
49053
|
needsUpdate: this.hasUpdate,
|
|
49031
49054
|
metadataLoaded: this.metadataLoaded,
|
|
49032
49055
|
});
|
|
@@ -49074,6 +49097,7 @@ class MediaControl extends UICorePlugin {
|
|
|
49074
49097
|
width: this.options.width,
|
|
49075
49098
|
height: this.options.height,
|
|
49076
49099
|
});
|
|
49100
|
+
// TODO check out
|
|
49077
49101
|
this.hideVolumeBar(0);
|
|
49078
49102
|
}, 0);
|
|
49079
49103
|
this.parseColors();
|
|
@@ -49155,7 +49179,7 @@ class MediaControl extends UICorePlugin {
|
|
|
49155
49179
|
return isFinite(this.core.activePlayback.getDuration());
|
|
49156
49180
|
}
|
|
49157
49181
|
getElementLocation(name) {
|
|
49158
|
-
trace(`${T$
|
|
49182
|
+
trace(`${T$b} getElementLocation`, {
|
|
49159
49183
|
name,
|
|
49160
49184
|
right: this.settings.right,
|
|
49161
49185
|
left: this.settings.left,
|
|
@@ -49202,7 +49226,7 @@ const streamsMomentoIcon = "<svg id=\"Слой_1\" data-name=\"Слой 1\" xmln
|
|
|
49202
49226
|
const streamsWhiteNightsIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"50\" height=\"50\" viewBox=\"0 0 50 50\">\n <defs>\n <clipPath id=\"clip-Icon\">\n <rect width=\"50\" height=\"50\"/>\n </clipPath>\n </defs>\n <g id=\"Icon\" clip-path=\"url(#clip-Icon)\">\n <g id=\"icon2\" transform=\"translate(-0.041 0)\">\n <path id=\"Контур_77\" data-name=\"Контур 77\" d=\"M6.493,13v8.266h6.275V19.74H8.31V17.714h4.006V16.3H8.31V14.53h4.365V13Zm7.5,0v8.266h1.7V15.732h.023l3.438,5.534h1.818V13h-1.7v5.545h-.023L15.8,13Z\" fill=\"#fff\"/>\n <path id=\"Контур_76\" data-name=\"Контур 76\" d=\"M29.949,29.1V26.774H31.94a1.4,1.4,0,0,1,.938.272,1.1,1.1,0,0,1,.313.874,1.155,1.155,0,0,1-.313.9,1.375,1.375,0,0,1-.938.278ZM28.132,25.36v8.266h1.817V30.4h1.818a1.353,1.353,0,0,1,.984.3,1.637,1.637,0,0,1,.394.949c.046.333.079.681.1,1.042a3.2,3.2,0,0,0,.185.938h1.819a1.218,1.218,0,0,1-.191-.423,3.611,3.611,0,0,1-.093-.527c-.019-.185-.033-.367-.041-.544s-.016-.332-.023-.463a5.052,5.052,0,0,0-.087-.625,2.109,2.109,0,0,0-.2-.573,1.586,1.586,0,0,0-.359-.451,1.414,1.414,0,0,0-.556-.284v-.023a1.926,1.926,0,0,0,1-.81,2.494,2.494,0,0,0,.307-1.262,2.308,2.308,0,0,0-.165-.88,2.128,2.128,0,0,0-.486-.724,2.3,2.3,0,0,0-.764-.492,2.67,2.67,0,0,0-1-.179ZM43.506,30.5V25.36H41.689V30.5a2.065,2.065,0,0,1-.37,1.36,1.7,1.7,0,0,1-1.343.434,2.086,2.086,0,0,1-.886-.156,1.283,1.283,0,0,1-.758-.978,3.748,3.748,0,0,1-.058-.66V25.36H36.456V30.5a3.16,3.16,0,0,0,.92,2.5,3.807,3.807,0,0,0,2.6.81,3.82,3.82,0,0,0,2.593-.816,3.132,3.132,0,0,0,.937-2.492Z\" fill=\"#fff\"/>\n <path id=\"Контур_80\" data-name=\"Контур 80\" d=\"M22.646,31.2H4.689a4.505,4.505,0,0,1-4.5-4.5V8.5A4.505,4.505,0,0,1,4.689,4h18.2a4.505,4.505,0,0,1,4.5,4.5v8.445l-.893.1a3.184,3.184,0,0,0-2.846,3.177V30.5l-.465.7ZM4.689,6a2.5,2.5,0,0,0-2.5,2.5V26.7a2.5,2.5,0,0,0,2.5,2.5H21.65V20.22a5.18,5.18,0,0,1,3.739-4.992V8.5a2.5,2.5,0,0,0-2.5-2.5Z\" fill=\"#fff\"/>\n <path id=\"Контур_81\" data-name=\"Контур 81\" d=\"M30.127,47.884a1,1,0,0,1-1-1V43.267H26.846a5.206,5.206,0,0,1-5.2-5.2V20.222a5.206,5.206,0,0,1,5.2-5.2H44.692a5.206,5.206,0,0,1,5.2,5.2V38.068a5.206,5.206,0,0,1-5.2,5.2H35.058l-4.216,4.316A1,1,0,0,1,30.127,47.884ZM26.846,17.022a3.2,3.2,0,0,0-3.2,3.2V38.067a3.2,3.2,0,0,0,3.2,3.2h3.281a1,1,0,0,1,1,1v2.162l2.8-2.86a1,1,0,0,1,.715-.3H44.692a3.2,3.2,0,0,0,3.2-3.2V20.222a3.2,3.2,0,0,0-3.2-3.2Z\" fill=\"#fff\"/>\n </g>\n </g>\n</svg>\n";
|
|
49203
49227
|
|
|
49204
49228
|
const VERSION$4 = '0.0.1';
|
|
49205
|
-
const T$
|
|
49229
|
+
const T$a = 'plugins.multicamera';
|
|
49206
49230
|
/**
|
|
49207
49231
|
* `PLUGIN` that adds support for loading multiple streams and switching between them using the media control UI.
|
|
49208
49232
|
* @beta
|
|
@@ -49348,7 +49372,7 @@ class MultiCamera extends UICorePlugin {
|
|
|
49348
49372
|
}
|
|
49349
49373
|
onCameraSelect(event) {
|
|
49350
49374
|
const value = event.currentTarget.dataset.multicameraSelectorSelect;
|
|
49351
|
-
trace(`${T$
|
|
49375
|
+
trace(`${T$a} onCameraSelect`, { value });
|
|
49352
49376
|
if (value !== undefined) {
|
|
49353
49377
|
this.changeById(parseInt(value, 10));
|
|
49354
49378
|
}
|
|
@@ -49474,13 +49498,13 @@ class MultiCamera extends UICorePlugin {
|
|
|
49474
49498
|
}
|
|
49475
49499
|
}
|
|
49476
49500
|
changeById(id) {
|
|
49477
|
-
trace(`${T$
|
|
49501
|
+
trace(`${T$a} changeById`, { id });
|
|
49478
49502
|
queueMicrotask(() => {
|
|
49479
49503
|
const playbackOptions = this.core.options.playback || {};
|
|
49480
49504
|
// TODO figure out what this does
|
|
49481
49505
|
playbackOptions.recycleVideo = Browser.isMobile;
|
|
49482
49506
|
this.currentCamera = this.findElementById(id) ?? null;
|
|
49483
|
-
trace(`${T$
|
|
49507
|
+
trace(`${T$a} changeById`, { id, currentCamera: this.currentCamera, multicamera: this.multicamera });
|
|
49484
49508
|
if (!this.currentCamera) {
|
|
49485
49509
|
return;
|
|
49486
49510
|
}
|
|
@@ -49497,7 +49521,7 @@ class MultiCamera extends UICorePlugin {
|
|
|
49497
49521
|
// TODO remove?
|
|
49498
49522
|
// for html5 playback:
|
|
49499
49523
|
this.options.dvrEnabled = this.currentCamera.dvr;
|
|
49500
|
-
trace(`${T$
|
|
49524
|
+
trace(`${T$a} changeById`, { currentCamera: this.currentCamera });
|
|
49501
49525
|
// TODO
|
|
49502
49526
|
this.core.configure({
|
|
49503
49527
|
playback: playbackOptions,
|
|
@@ -49555,7 +49579,7 @@ const pipIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"no
|
|
|
49555
49579
|
const buttonHtml$2 = "<button class=\"gplayer-lite-btn gcore-skin-button-color\">\n <%= pipIcon %>\n</button>\n";
|
|
49556
49580
|
|
|
49557
49581
|
const VERSION$3 = '0.0.1';
|
|
49558
|
-
const T$
|
|
49582
|
+
const T$9 = `plugins.pip`;
|
|
49559
49583
|
/**
|
|
49560
49584
|
* `PLUGIN` that enables picture in picture mode.
|
|
49561
49585
|
* @beta
|
|
@@ -49613,7 +49637,7 @@ class PictureInPicture extends UICorePlugin {
|
|
|
49613
49637
|
});
|
|
49614
49638
|
}
|
|
49615
49639
|
isPiPSupported() {
|
|
49616
|
-
trace(`${T$
|
|
49640
|
+
trace(`${T$9} isPiPSupported`, {
|
|
49617
49641
|
pictureInPictureEnabled: !!document.pictureInPictureEnabled,
|
|
49618
49642
|
requestPictureInPicture: !!HTMLVideoElement.prototype.requestPictureInPicture,
|
|
49619
49643
|
});
|
|
@@ -49629,12 +49653,12 @@ class PictureInPicture extends UICorePlugin {
|
|
|
49629
49653
|
this.$el.html(PictureInPicture.buttonTemplate({ pipIcon }));
|
|
49630
49654
|
const mediaControl = this.core.getPlugin('media_control');
|
|
49631
49655
|
if (mediaControl) {
|
|
49632
|
-
mediaControl.
|
|
49656
|
+
mediaControl.mount('pip', this.$el);
|
|
49633
49657
|
}
|
|
49634
49658
|
return this;
|
|
49635
49659
|
}
|
|
49636
49660
|
togglePictureInPicture() {
|
|
49637
|
-
trace(`${T$
|
|
49661
|
+
trace(`${T$9} togglePictureInPicture`);
|
|
49638
49662
|
if (this.videoElement !== document.pictureInPictureElement) {
|
|
49639
49663
|
this.requestPictureInPicture();
|
|
49640
49664
|
}
|
|
@@ -49643,13 +49667,13 @@ class PictureInPicture extends UICorePlugin {
|
|
|
49643
49667
|
}
|
|
49644
49668
|
}
|
|
49645
49669
|
requestPictureInPicture() {
|
|
49646
|
-
trace(`${T$
|
|
49670
|
+
trace(`${T$9} requestPictureInPicture`, {
|
|
49647
49671
|
videoElement: !!this.videoElement,
|
|
49648
49672
|
});
|
|
49649
49673
|
this.videoElement.requestPictureInPicture();
|
|
49650
49674
|
}
|
|
49651
49675
|
exitPictureInPicture() {
|
|
49652
|
-
trace(`${T$
|
|
49676
|
+
trace(`${T$9} exitPictureInPicture`);
|
|
49653
49677
|
document.exitPictureInPicture();
|
|
49654
49678
|
}
|
|
49655
49679
|
}
|
|
@@ -49676,7 +49700,7 @@ const DEFAULT_PLAYBACK_RATES = [
|
|
|
49676
49700
|
{ value: 2.0, label: '2x' },
|
|
49677
49701
|
];
|
|
49678
49702
|
const DEFAULT_PLAYBACK_RATE = 1;
|
|
49679
|
-
const T$
|
|
49703
|
+
const T$8 = 'plugins.playback_rate';
|
|
49680
49704
|
/**
|
|
49681
49705
|
* `PLUGIN` that allows changing the playback speed of the video.
|
|
49682
49706
|
* @beta
|
|
@@ -49762,7 +49786,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49762
49786
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChange);
|
|
49763
49787
|
}
|
|
49764
49788
|
onCoreReady() {
|
|
49765
|
-
trace(`${T$
|
|
49789
|
+
trace(`${T$8} onCoreReady`);
|
|
49766
49790
|
const mediaControl = this.core.getPlugin('media_control');
|
|
49767
49791
|
assert(mediaControl, 'media_control plugin is required');
|
|
49768
49792
|
const gear = this.core.getPlugin('bottom_gear');
|
|
@@ -49771,7 +49795,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49771
49795
|
this.listenTo(gear, GearEvents.RENDERED, this.onGearRendered);
|
|
49772
49796
|
}
|
|
49773
49797
|
onActiveContainerChange() {
|
|
49774
|
-
trace(`${T$
|
|
49798
|
+
trace(`${T$8} onActiveContainerChange`);
|
|
49775
49799
|
this.metadataLoaded = false;
|
|
49776
49800
|
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_STOP, this.onStop);
|
|
49777
49801
|
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_PLAY, this.onPlay);
|
|
@@ -49779,15 +49803,15 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49779
49803
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_LOADEDMETADATA, this.onMetaDataLoaded);
|
|
49780
49804
|
}
|
|
49781
49805
|
onMediaControlRendered() {
|
|
49782
|
-
trace(`${T$
|
|
49806
|
+
trace(`${T$8} onMediaControlRendered`);
|
|
49783
49807
|
this.render();
|
|
49784
49808
|
}
|
|
49785
49809
|
onGearRendered() {
|
|
49786
|
-
trace(`${T$
|
|
49810
|
+
trace(`${T$8} onGearRendered`);
|
|
49787
49811
|
this.mount();
|
|
49788
49812
|
}
|
|
49789
49813
|
mount() {
|
|
49790
|
-
trace(`${T$
|
|
49814
|
+
trace(`${T$8} mount`, {
|
|
49791
49815
|
shouldMount: this.shouldMount(),
|
|
49792
49816
|
});
|
|
49793
49817
|
if (!this.shouldMount()) {
|
|
@@ -49804,7 +49828,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49804
49828
|
})));
|
|
49805
49829
|
}
|
|
49806
49830
|
onMetaDataLoaded() {
|
|
49807
|
-
trace(`${T$
|
|
49831
|
+
trace(`${T$8} onMetaDataLoaded`, {
|
|
49808
49832
|
playbackType: this.core.activePlayback.getPlaybackType(),
|
|
49809
49833
|
dvrEnabled: this.core.activePlayback.dvrEnabled,
|
|
49810
49834
|
});
|
|
@@ -49826,14 +49850,14 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49826
49850
|
this.core.activePlayback?.setPlaybackRate(this.selectedRate);
|
|
49827
49851
|
}
|
|
49828
49852
|
else {
|
|
49829
|
-
trace(`${T$
|
|
49853
|
+
trace(`${T$8} onPlaybackRateChange not steering to the selected rate, it is seemingly a catchup algorithm working`, {
|
|
49830
49854
|
playbackRate,
|
|
49831
49855
|
selectedRate: this.selectedRate,
|
|
49832
49856
|
});
|
|
49833
49857
|
}
|
|
49834
49858
|
}
|
|
49835
49859
|
shouldMount() {
|
|
49836
|
-
trace(`${T$
|
|
49860
|
+
trace(`${T$8} shouldMount`, {
|
|
49837
49861
|
playbackType: this.core.activePlayback?.getPlaybackType(),
|
|
49838
49862
|
dvrEnabled: this.core.activePlayback?.dvrEnabled,
|
|
49839
49863
|
});
|
|
@@ -49850,7 +49874,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49850
49874
|
* @internal
|
|
49851
49875
|
*/
|
|
49852
49876
|
render() {
|
|
49853
|
-
trace(`${T$
|
|
49877
|
+
trace(`${T$8} render`, {
|
|
49854
49878
|
shouldMount: this.shouldMount(),
|
|
49855
49879
|
});
|
|
49856
49880
|
this.$el.html(PlaybackRate.listTemplate({
|
|
@@ -49896,13 +49920,13 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49896
49920
|
}
|
|
49897
49921
|
}
|
|
49898
49922
|
syncRate() {
|
|
49899
|
-
trace(`${T$
|
|
49923
|
+
trace(`${T$8} syncRate`, {
|
|
49900
49924
|
selectedRate: this.selectedRate,
|
|
49901
49925
|
});
|
|
49902
49926
|
this.core.activePlayback?.setPlaybackRate(this.selectedRate);
|
|
49903
49927
|
}
|
|
49904
49928
|
resetPlaybackRate() {
|
|
49905
|
-
trace(`${T$
|
|
49929
|
+
trace(`${T$8} resetPlaybackRate`, {
|
|
49906
49930
|
selectedRate: this.selectedRate,
|
|
49907
49931
|
});
|
|
49908
49932
|
this.core.activePlayback?.setPlaybackRate(DEFAULT_PLAYBACK_RATE);
|
|
@@ -49937,7 +49961,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49937
49961
|
?.label || `x${rate}`);
|
|
49938
49962
|
}
|
|
49939
49963
|
highlightCurrentRate() {
|
|
49940
|
-
trace(`${T$
|
|
49964
|
+
trace(`${T$8} highlightCurrentRate`, {
|
|
49941
49965
|
selectedRate: this.selectedRate,
|
|
49942
49966
|
});
|
|
49943
49967
|
this.allRateElements().removeClass('current');
|
|
@@ -49948,7 +49972,7 @@ class PlaybackRate extends UICorePlugin {
|
|
|
49948
49972
|
.addClass('gcore-skin-active');
|
|
49949
49973
|
}
|
|
49950
49974
|
updateGearOptionLabel() {
|
|
49951
|
-
trace(`${T$
|
|
49975
|
+
trace(`${T$8} updateGearOptionLabel`, {
|
|
49952
49976
|
selectedRate: this.selectedRate,
|
|
49953
49977
|
});
|
|
49954
49978
|
this.mount();
|
|
@@ -49960,7 +49984,7 @@ const posterHTML = "<div class=\"play-wrapper\" data-poster></div>\n";
|
|
|
49960
49984
|
//Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
49961
49985
|
// Use of this source code is governed by a BSD-style
|
|
49962
49986
|
// license that can be found in the LICENSE file.
|
|
49963
|
-
const T$
|
|
49987
|
+
const T$7 = 'plugins.poster';
|
|
49964
49988
|
/**
|
|
49965
49989
|
* `PLUGIN` that displays a poster image in the background and a big play button on top when playback is stopped
|
|
49966
49990
|
* @beta
|
|
@@ -50066,13 +50090,13 @@ class Poster extends UIContainerPlugin {
|
|
|
50066
50090
|
* Disables the plugin, unmounting it from the DOM
|
|
50067
50091
|
*/
|
|
50068
50092
|
disable() {
|
|
50069
|
-
trace(`${T$
|
|
50093
|
+
trace(`${T$7} disable`);
|
|
50070
50094
|
this.hasStartedPlaying = false;
|
|
50071
50095
|
this.playRequested = false;
|
|
50072
50096
|
super.disable();
|
|
50073
50097
|
}
|
|
50074
50098
|
onError(error) {
|
|
50075
|
-
trace(`${T$
|
|
50099
|
+
trace(`${T$7} onError`, {
|
|
50076
50100
|
error,
|
|
50077
50101
|
enabled: this.enabled,
|
|
50078
50102
|
});
|
|
@@ -50085,18 +50109,18 @@ class Poster extends UIContainerPlugin {
|
|
|
50085
50109
|
}
|
|
50086
50110
|
}
|
|
50087
50111
|
onPlay() {
|
|
50088
|
-
trace(`${T$
|
|
50112
|
+
trace(`${T$7} onPlay`);
|
|
50089
50113
|
this.hasStartedPlaying = true;
|
|
50090
50114
|
this.playRequested = false;
|
|
50091
50115
|
this.update();
|
|
50092
50116
|
}
|
|
50093
50117
|
onPlayIntent() {
|
|
50094
|
-
trace(`${T$
|
|
50118
|
+
trace(`${T$7} onPlayIntent`);
|
|
50095
50119
|
this.playRequested = true;
|
|
50096
50120
|
this.update();
|
|
50097
50121
|
}
|
|
50098
50122
|
onStop() {
|
|
50099
|
-
trace(`${T$
|
|
50123
|
+
trace(`${T$7} onStop`, {
|
|
50100
50124
|
enabled: this.enabled,
|
|
50101
50125
|
});
|
|
50102
50126
|
this.hasStartedPlaying = false;
|
|
@@ -50104,7 +50128,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50104
50128
|
this.update();
|
|
50105
50129
|
}
|
|
50106
50130
|
updatePlayButton(show) {
|
|
50107
|
-
trace(`${T$
|
|
50131
|
+
trace(`${T$7} updatePlayButton`, {
|
|
50108
50132
|
show,
|
|
50109
50133
|
chromeless: this.options.chromeless,
|
|
50110
50134
|
allowUserInteraction: this.options.allowUserInteraction,
|
|
@@ -50133,7 +50157,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50133
50157
|
this.$el.removeClass('clickable');
|
|
50134
50158
|
}
|
|
50135
50159
|
clicked() {
|
|
50136
|
-
trace(`${T$
|
|
50160
|
+
trace(`${T$7} clicked`, {
|
|
50137
50161
|
hasStartedPlaying: this.hasStartedPlaying,
|
|
50138
50162
|
chromeless: this.options.chromeless,
|
|
50139
50163
|
allowUserInteraction: this.options.allowUserInteraction,
|
|
@@ -50154,7 +50178,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50154
50178
|
return !this.container.playback.isAudioOnly;
|
|
50155
50179
|
}
|
|
50156
50180
|
update() {
|
|
50157
|
-
trace(`${T$
|
|
50181
|
+
trace(`${T$7} update`, {
|
|
50158
50182
|
shouldRender: this.shouldRender,
|
|
50159
50183
|
});
|
|
50160
50184
|
if (!this.shouldRender) {
|
|
@@ -50167,7 +50191,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50167
50191
|
this.updatePoster();
|
|
50168
50192
|
}
|
|
50169
50193
|
updatePoster() {
|
|
50170
|
-
trace(`${T$
|
|
50194
|
+
trace(`${T$7} updatePoster`, {
|
|
50171
50195
|
hasStartedPlaying: this.hasStartedPlaying,
|
|
50172
50196
|
});
|
|
50173
50197
|
if (!this.hasStartedPlaying) {
|
|
@@ -50182,7 +50206,7 @@ class Poster extends UIContainerPlugin {
|
|
|
50182
50206
|
this.$el.show();
|
|
50183
50207
|
}
|
|
50184
50208
|
hidePoster() {
|
|
50185
|
-
trace(`${T$
|
|
50209
|
+
trace(`${T$7} hidePoster`, {
|
|
50186
50210
|
shouldHideOnPlay: this.shouldHideOnPlay(),
|
|
50187
50211
|
});
|
|
50188
50212
|
if (!this.options.disableMediaControl) {
|
|
@@ -50232,13 +50256,13 @@ class Poster extends UIContainerPlugin {
|
|
|
50232
50256
|
}
|
|
50233
50257
|
}
|
|
50234
50258
|
|
|
50235
|
-
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";
|
|
50259
|
+
const buttonHtml = "<button class='gplayer-lite-btn gcore-skin-text-color gear-option' aria-haspopup=\"menu\" id=\"quality-levels\">\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";
|
|
50236
50260
|
|
|
50237
50261
|
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";
|
|
50238
50262
|
|
|
50239
50263
|
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";
|
|
50240
50264
|
|
|
50241
|
-
const T$
|
|
50265
|
+
const T$6 = 'plugins.quality_levels';
|
|
50242
50266
|
const VERSION$2 = 'v2.22.5';
|
|
50243
50267
|
/**
|
|
50244
50268
|
* `PLUGIN` that provides a UI to select the desired quality level of the playback.
|
|
@@ -50315,14 +50339,14 @@ class QualityLevels extends UICorePlugin {
|
|
|
50315
50339
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChange);
|
|
50316
50340
|
}
|
|
50317
50341
|
onCoreReady() {
|
|
50318
|
-
trace(`${T$
|
|
50342
|
+
trace(`${T$6} onCoreReady`);
|
|
50319
50343
|
const gear = this.core.getPlugin('bottom_gear');
|
|
50320
50344
|
assert(gear, 'bottom_gear plugin is required');
|
|
50321
50345
|
this.currentText = this.core.i18n.t('auto');
|
|
50322
50346
|
this.listenTo(gear, GearEvents.RENDERED, this.onGearRendered);
|
|
50323
50347
|
}
|
|
50324
50348
|
onGearRendered() {
|
|
50325
|
-
trace(`${T$
|
|
50349
|
+
trace(`${T$6} onGearRendered`);
|
|
50326
50350
|
this.render();
|
|
50327
50351
|
}
|
|
50328
50352
|
onActiveContainerChange() {
|
|
@@ -50351,7 +50375,7 @@ class QualityLevels extends UICorePlugin {
|
|
|
50351
50375
|
}
|
|
50352
50376
|
}
|
|
50353
50377
|
onStop() {
|
|
50354
|
-
trace(`${T$
|
|
50378
|
+
trace(`${T$6} onStop`);
|
|
50355
50379
|
this.listenToOnce(this.core.activePlayback, Events$1.PLAYBACK_PLAY, () => {
|
|
50356
50380
|
if (this.core.activePlayback.getPlaybackType() === 'live') {
|
|
50357
50381
|
if (this.selectedLevelId !== -1) {
|
|
@@ -50447,7 +50471,7 @@ class QualityLevels extends UICorePlugin {
|
|
|
50447
50471
|
return false;
|
|
50448
50472
|
}
|
|
50449
50473
|
goBack() {
|
|
50450
|
-
trace(`${T$
|
|
50474
|
+
trace(`${T$6} goBack`);
|
|
50451
50475
|
this.core.getPlugin('bottom_gear').refresh();
|
|
50452
50476
|
}
|
|
50453
50477
|
setLevel(index) {
|
|
@@ -50482,11 +50506,11 @@ class QualityLevels extends UICorePlugin {
|
|
|
50482
50506
|
return this.levelLabels[index] ?? formatLevelLabel(this.levels[index]);
|
|
50483
50507
|
}
|
|
50484
50508
|
onBitrate(info) {
|
|
50485
|
-
trace(`${T$
|
|
50509
|
+
trace(`${T$6} updateCurrentLevel`, { info });
|
|
50486
50510
|
this.highlightCurrentLevel();
|
|
50487
50511
|
}
|
|
50488
50512
|
highlightCurrentLevel() {
|
|
50489
|
-
trace(`${T$
|
|
50513
|
+
trace(`${T$6} highlightCurrentLevel`, {
|
|
50490
50514
|
selectedLevelId: this.selectedLevelId,
|
|
50491
50515
|
});
|
|
50492
50516
|
this.allLevelElements()
|
|
@@ -50886,7 +50910,7 @@ const spinnerHTML = "<div data-bounce1></div>\n<div data-bounce2></div>\n<div da
|
|
|
50886
50910
|
// Use of this source code is governed by a BSD-style
|
|
50887
50911
|
// license that can be found in the LICENSE file.
|
|
50888
50912
|
// https://github.com/clappr/clappr-plugins/blob/ffaa9d27005fa5a8a7c243ffc47eb5655b84b371/LICENSE
|
|
50889
|
-
const T$
|
|
50913
|
+
const T$5 = 'plugins.spinner';
|
|
50890
50914
|
/**
|
|
50891
50915
|
* Custom events emitted by the plugin
|
|
50892
50916
|
* @public
|
|
@@ -50956,18 +50980,18 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
50956
50980
|
this.hasBuffering = false;
|
|
50957
50981
|
}
|
|
50958
50982
|
onPlay() {
|
|
50959
|
-
trace(`${T$
|
|
50983
|
+
trace(`${T$5} onPlay`);
|
|
50960
50984
|
this._hide();
|
|
50961
50985
|
}
|
|
50962
50986
|
onStop() {
|
|
50963
|
-
trace(`${T$
|
|
50987
|
+
trace(`${T$5} onStop`, {
|
|
50964
50988
|
hasFatalError: this.hasFatalError,
|
|
50965
50989
|
});
|
|
50966
50990
|
this._hide();
|
|
50967
50991
|
}
|
|
50968
50992
|
onError(e) {
|
|
50969
50993
|
this.hasFatalError = e.code === PlaybackErrorCode.MediaSourceUnavailable;
|
|
50970
|
-
trace(`${T$
|
|
50994
|
+
trace(`${T$5} onError`, {
|
|
50971
50995
|
e,
|
|
50972
50996
|
hasFatalError: this.hasFatalError,
|
|
50973
50997
|
error: e.code,
|
|
@@ -50982,7 +51006,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
50982
51006
|
* @param delay - The delay in milliseconds before the spinner is shown.
|
|
50983
51007
|
*/
|
|
50984
51008
|
show(delay = 300) {
|
|
50985
|
-
trace(`${T$
|
|
51009
|
+
trace(`${T$5} show`);
|
|
50986
51010
|
this.userShown = true;
|
|
50987
51011
|
this._show(delay);
|
|
50988
51012
|
}
|
|
@@ -51002,7 +51026,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
51002
51026
|
}
|
|
51003
51027
|
}
|
|
51004
51028
|
_hide() {
|
|
51005
|
-
trace(`${T$
|
|
51029
|
+
trace(`${T$5} _hide`, {
|
|
51006
51030
|
userShown: this.userShown,
|
|
51007
51031
|
});
|
|
51008
51032
|
if (this.userShown) {
|
|
@@ -51019,7 +51043,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
51019
51043
|
* @internal
|
|
51020
51044
|
*/
|
|
51021
51045
|
render() {
|
|
51022
|
-
trace(`${T$
|
|
51046
|
+
trace(`${T$5} render`, {
|
|
51023
51047
|
buffering: this.container.buffering,
|
|
51024
51048
|
});
|
|
51025
51049
|
this.$el.html(this.template());
|
|
@@ -51037,7 +51061,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
51037
51061
|
}
|
|
51038
51062
|
}
|
|
51039
51063
|
|
|
51040
|
-
const T$
|
|
51064
|
+
const T$4 = 'plugins.source_controller';
|
|
51041
51065
|
const INITIAL_RETRY_DELAY = 1000;
|
|
51042
51066
|
const MAX_RETRY_DELAY = 5000;
|
|
51043
51067
|
const RETRY_DELAY_BLUR = 500;
|
|
@@ -51179,11 +51203,11 @@ class SourceController extends CorePlugin {
|
|
|
51179
51203
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
51180
51204
|
}
|
|
51181
51205
|
onCoreReady() {
|
|
51182
|
-
trace(`${T$
|
|
51206
|
+
trace(`${T$4} onCoreReady`);
|
|
51183
51207
|
this.core.getPlugin('error_screen')?.disable(); // TODO test
|
|
51184
51208
|
}
|
|
51185
51209
|
onActiveContainerChanged() {
|
|
51186
|
-
trace(`${T$
|
|
51210
|
+
trace(`${T$4} onActiveContainerChanged`, {
|
|
51187
51211
|
retrying: this.active,
|
|
51188
51212
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
51189
51213
|
});
|
|
@@ -51204,7 +51228,7 @@ class SourceController extends CorePlugin {
|
|
|
51204
51228
|
}
|
|
51205
51229
|
bindContainerEventListeners() {
|
|
51206
51230
|
this.core.activePlayback.on(Events$1.PLAYBACK_ERROR, (error) => {
|
|
51207
|
-
trace(`${T$
|
|
51231
|
+
trace(`${T$4} on PLAYBACK_ERROR`, {
|
|
51208
51232
|
error: {
|
|
51209
51233
|
code: error?.code,
|
|
51210
51234
|
description: error?.description,
|
|
@@ -51225,7 +51249,7 @@ class SourceController extends CorePlugin {
|
|
|
51225
51249
|
}
|
|
51226
51250
|
});
|
|
51227
51251
|
this.core.activePlayback.on(Events$1.PLAYBACK_PLAY, () => {
|
|
51228
|
-
trace(`${T$
|
|
51252
|
+
trace(`${T$4} on PLAYBACK_PLAY`, {
|
|
51229
51253
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
51230
51254
|
retrying: this.active,
|
|
51231
51255
|
});
|
|
@@ -51241,7 +51265,7 @@ class SourceController extends CorePlugin {
|
|
|
51241
51265
|
this.sourcesDelay = {};
|
|
51242
51266
|
}
|
|
51243
51267
|
retryPlayback() {
|
|
51244
|
-
trace(`${T$
|
|
51268
|
+
trace(`${T$4} retryPlayback enter`, {
|
|
51245
51269
|
currentSourceIndex: this.currentSourceIndex,
|
|
51246
51270
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
51247
51271
|
});
|
|
@@ -51249,20 +51273,20 @@ class SourceController extends CorePlugin {
|
|
|
51249
51273
|
this.switching = true;
|
|
51250
51274
|
this.core.activeContainer?.getPlugin('spinner')?.show(0);
|
|
51251
51275
|
this.getNextMediaSource().then((nextSource) => {
|
|
51252
|
-
trace(`${T$
|
|
51276
|
+
trace(`${T$4} retryPlayback syncing...`, {
|
|
51253
51277
|
nextSource,
|
|
51254
51278
|
});
|
|
51255
51279
|
const rnd = RETRY_DELAY_BLUR * Math.random();
|
|
51256
51280
|
this.sync(() => {
|
|
51257
|
-
trace(`${T$
|
|
51281
|
+
trace(`${T$4} retryPlayback loading...`);
|
|
51258
51282
|
this.switching = false;
|
|
51259
51283
|
this.core.load(nextSource.source, nextSource.mimeType);
|
|
51260
|
-
trace(`${T$
|
|
51284
|
+
trace(`${T$4} retryPlayback loaded`, {
|
|
51261
51285
|
nextSource,
|
|
51262
51286
|
});
|
|
51263
51287
|
setTimeout(() => {
|
|
51264
51288
|
this.core.activePlayback.play();
|
|
51265
|
-
trace(`${T$
|
|
51289
|
+
trace(`${T$4} retryPlayback playing`);
|
|
51266
51290
|
}, rnd);
|
|
51267
51291
|
});
|
|
51268
51292
|
});
|
|
@@ -51295,7 +51319,7 @@ const stringHTML = "<div class=\"cc-line\" id=\"cc-line\">\n <p></p>\n</div>\n"
|
|
|
51295
51319
|
|
|
51296
51320
|
const VERSION = '2.19.14';
|
|
51297
51321
|
const LOCAL_STORAGE_CC_ID = 'gplayer.plugins.cc.selected';
|
|
51298
|
-
const T$
|
|
51322
|
+
const T$3 = 'plugins.cc';
|
|
51299
51323
|
/**
|
|
51300
51324
|
* `PLUGIN` that provides a UI to select the subtitles when available.
|
|
51301
51325
|
* @beta
|
|
@@ -51378,14 +51402,14 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51378
51402
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
|
|
51379
51403
|
}
|
|
51380
51404
|
onCoreReady() {
|
|
51381
|
-
trace(`${T$
|
|
51405
|
+
trace(`${T$3} onCoreReady`);
|
|
51382
51406
|
const mediaControl = this.core.getPlugin('media_control');
|
|
51383
51407
|
assert(mediaControl, 'media_control plugin is required');
|
|
51384
51408
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.render);
|
|
51385
51409
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.hideMenu);
|
|
51386
51410
|
}
|
|
51387
51411
|
onContainerChanged() {
|
|
51388
|
-
trace(`${T$
|
|
51412
|
+
trace(`${T$3} onContainerChanged`);
|
|
51389
51413
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_FULLSCREEN, this.playerResize);
|
|
51390
51414
|
this.listenTo(this.core.activeContainer, 'container:advertisement:start', this.onStartAd);
|
|
51391
51415
|
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_SUBTITLE_AVAILABLE, this.onSubtitleAvailable);
|
|
@@ -51405,11 +51429,11 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51405
51429
|
});
|
|
51406
51430
|
}
|
|
51407
51431
|
onSubtitleAvailable() {
|
|
51408
|
-
trace(`${T$
|
|
51432
|
+
trace(`${T$3} onSubtitleAvailable`);
|
|
51409
51433
|
this.applyTracks();
|
|
51410
51434
|
}
|
|
51411
51435
|
onSubtitleChanged({ id }) {
|
|
51412
|
-
trace(`${T$
|
|
51436
|
+
trace(`${T$3} onSubtitleChanged`, { id });
|
|
51413
51437
|
if (id === -1) {
|
|
51414
51438
|
this.clearSubtitleText();
|
|
51415
51439
|
}
|
|
@@ -51459,7 +51483,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51459
51483
|
this.stopListening(this.core.activeContainer, 'container:advertisement:finish', this.onFinishAd);
|
|
51460
51484
|
}
|
|
51461
51485
|
playerResize() {
|
|
51462
|
-
trace(`${T$
|
|
51486
|
+
trace(`${T$3} playerResize`);
|
|
51463
51487
|
const shouldShow = this.core.activeContainer &&
|
|
51464
51488
|
isFullscreen(this.core.activeContainer.el) &&
|
|
51465
51489
|
this.track &&
|
|
@@ -51533,7 +51557,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51533
51557
|
this.$line = $(ClosedCaptions.templateString());
|
|
51534
51558
|
this.resizeFont();
|
|
51535
51559
|
this.core.activeContainer.$el.append(this.$line);
|
|
51536
|
-
mediaControl.
|
|
51560
|
+
mediaControl.mount('cc', this.$el);
|
|
51537
51561
|
this.updateSelection();
|
|
51538
51562
|
this.renderIcon();
|
|
51539
51563
|
return this;
|
|
@@ -51549,7 +51573,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51549
51573
|
}
|
|
51550
51574
|
onItemSelect(event) {
|
|
51551
51575
|
const id = event.target.dataset.ccSelect ?? '-1';
|
|
51552
|
-
trace(`${T$
|
|
51576
|
+
trace(`${T$3} onItemSelect`, { id });
|
|
51553
51577
|
localStorage.setItem(LOCAL_STORAGE_CC_ID, id);
|
|
51554
51578
|
this.selectItem(this.findById(Number(id)));
|
|
51555
51579
|
return false;
|
|
@@ -51569,7 +51593,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51569
51593
|
this.$('[data-cc] ul').hide();
|
|
51570
51594
|
}
|
|
51571
51595
|
toggleMenu() {
|
|
51572
|
-
trace(`${T$
|
|
51596
|
+
trace(`${T$3} toggleMenu`);
|
|
51573
51597
|
this.$('[data-cc] ul').toggle();
|
|
51574
51598
|
}
|
|
51575
51599
|
itemElement(id) {
|
|
@@ -51616,7 +51640,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51616
51640
|
.removeClass('current')
|
|
51617
51641
|
.find('a')
|
|
51618
51642
|
.removeClass('gcore-skin-active');
|
|
51619
|
-
trace(`${T$
|
|
51643
|
+
trace(`${T$3} highlightCurrentSubtitles`, {
|
|
51620
51644
|
track: this.track?.id,
|
|
51621
51645
|
});
|
|
51622
51646
|
const currentLevelElement = this.itemElement(this.track ? this.track.id : -1);
|
|
@@ -51634,7 +51658,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
51634
51658
|
// An example implementation of client side performancestatistics
|
|
51635
51659
|
const WATCH_CUTOFF = 5;
|
|
51636
51660
|
const STALL_MEASURE_PERIOD = 10;
|
|
51637
|
-
const T$
|
|
51661
|
+
const T$2 = 'plugins.telemetry';
|
|
51638
51662
|
/**
|
|
51639
51663
|
* Telemetry event type
|
|
51640
51664
|
* @beta
|
|
@@ -51744,7 +51768,7 @@ class Telemetry extends ContainerPlugin {
|
|
|
51744
51768
|
}
|
|
51745
51769
|
onReady() {
|
|
51746
51770
|
this.sendInit();
|
|
51747
|
-
trace(`${T$
|
|
51771
|
+
trace(`${T$2} onReady`, {
|
|
51748
51772
|
autoPlay: this.options.autoPlay,
|
|
51749
51773
|
});
|
|
51750
51774
|
if (this.options.autoPlay) {
|
|
@@ -51925,7 +51949,7 @@ const parseSRT = /*@__PURE__*/getDefaultExportFromCjs$1(parseSrtExports);
|
|
|
51925
51949
|
|
|
51926
51950
|
const pluginHtml = "<div class=\"thumbnails-text\"></div>\n<% if (backdropHeight) { %>\n <div class=\"backdrop\" style=\"height: <%= backdropHeight %>px;\">\n <div class=\"carousel\"></div>\n </div>\n<% }; %>\n<% if (spotlightHeight) { %>\n <div class=\"spotlight\" style=\"height: <%= spotlightHeight %>px;\">\n </div>\n<% }; %>\n";
|
|
51927
51951
|
|
|
51928
|
-
const T = 'plugins.thumbnails';
|
|
51952
|
+
const T$1 = 'plugins.thumbnails';
|
|
51929
51953
|
/**
|
|
51930
51954
|
* `PLUGIN` that displays the thumbnails of the video when available.
|
|
51931
51955
|
* @beta
|
|
@@ -52230,7 +52254,7 @@ class Thumbnails extends UICorePlugin {
|
|
|
52230
52254
|
// calculate how far along the carousel should currently be slid
|
|
52231
52255
|
// depending on where the user is hovering on the progress bar
|
|
52232
52256
|
_updateCarousel() {
|
|
52233
|
-
trace(`${T} _updateCarousel`, {
|
|
52257
|
+
trace(`${T$1} _updateCarousel`, {
|
|
52234
52258
|
backdropHeight: this._getOptions().backdropHeight,
|
|
52235
52259
|
});
|
|
52236
52260
|
if (!this._getOptions().backdropHeight) {
|
|
@@ -52289,7 +52313,7 @@ class Thumbnails extends UICorePlugin {
|
|
|
52289
52313
|
}
|
|
52290
52314
|
}
|
|
52291
52315
|
_updateSpotlightThumb() {
|
|
52292
|
-
trace(`${T} _updateSpotlightThumb`, {
|
|
52316
|
+
trace(`${T$1} _updateSpotlightThumb`, {
|
|
52293
52317
|
spotlightHeight: this._getOptions().spotlightHeight,
|
|
52294
52318
|
});
|
|
52295
52319
|
if (!this._getOptions().spotlightHeight) {
|
|
@@ -52334,7 +52358,7 @@ class Thumbnails extends UICorePlugin {
|
|
|
52334
52358
|
return 0;
|
|
52335
52359
|
}
|
|
52336
52360
|
_renderPlugin() {
|
|
52337
|
-
trace(`${T} _renderPlugin`, {
|
|
52361
|
+
trace(`${T$1} _renderPlugin`, {
|
|
52338
52362
|
show: this._show,
|
|
52339
52363
|
thumbsLoaded: this._thumbsLoaded,
|
|
52340
52364
|
thumbs: this._thumbs.length,
|
|
@@ -52352,7 +52376,7 @@ class Thumbnails extends UICorePlugin {
|
|
|
52352
52376
|
}
|
|
52353
52377
|
}
|
|
52354
52378
|
_createElements() {
|
|
52355
|
-
trace(`${T} _createElements`);
|
|
52379
|
+
trace(`${T$1} _createElements`);
|
|
52356
52380
|
this.$el.html(Thumbnails.template({
|
|
52357
52381
|
backdropHeight: this._getOptions().backdropHeight,
|
|
52358
52382
|
spotlightHeight: this._getOptions().spotlightHeight,
|
|
@@ -52375,100 +52399,101 @@ var VolumeFadeEvents;
|
|
|
52375
52399
|
(function (VolumeFadeEvents) {
|
|
52376
52400
|
VolumeFadeEvents["FADE"] = "core:volume:fade";
|
|
52377
52401
|
})(VolumeFadeEvents || (VolumeFadeEvents = {}));
|
|
52402
|
+
const T = 'plugins.volume_fade';
|
|
52403
|
+
const DEFAULT_DURATION = 600;
|
|
52378
52404
|
/**
|
|
52379
52405
|
* `PLUGIN` that applies fade effect to the player's volume change.
|
|
52380
52406
|
* @beta
|
|
52407
|
+
*
|
|
52408
|
+
* @remarks
|
|
52409
|
+
* Depends on {@link MediaControl} plugin.
|
|
52410
|
+
* Configuration options - {@link VolumeFadeSettings}
|
|
52381
52411
|
*/
|
|
52382
52412
|
class VolumeFade extends UICorePlugin {
|
|
52383
|
-
|
|
52384
|
-
|
|
52385
|
-
|
|
52386
|
-
interval = null;
|
|
52413
|
+
activeVolume = 0;
|
|
52414
|
+
duration = 0;
|
|
52415
|
+
timerId = null;
|
|
52387
52416
|
/**
|
|
52388
52417
|
* @internal
|
|
52389
52418
|
*/
|
|
52390
52419
|
get name() {
|
|
52391
52420
|
return 'volume_fade';
|
|
52392
52421
|
}
|
|
52422
|
+
constructor(core) {
|
|
52423
|
+
super(core);
|
|
52424
|
+
if (typeof this.options.volumeFade?.level === 'number') {
|
|
52425
|
+
this.activeVolume = this.options.volumeFade.level;
|
|
52426
|
+
}
|
|
52427
|
+
}
|
|
52393
52428
|
/**
|
|
52394
52429
|
* @internal
|
|
52395
52430
|
*/
|
|
52396
52431
|
bindEvents() {
|
|
52397
|
-
// TODO on container changed
|
|
52398
52432
|
this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
52399
|
-
if (this.core.mediaControl) {
|
|
52400
|
-
this.listenTo(this.core.mediaControl, 'mediacontrol:volume:user', this._onUserChangeVolume);
|
|
52401
|
-
}
|
|
52402
|
-
// this.listenTo(this.core, 'core:volume:config', this._onVolumeConfig);
|
|
52403
|
-
}
|
|
52404
|
-
unBindEvents() {
|
|
52405
|
-
this.core.$el.off('mouseleave.volume');
|
|
52406
|
-
this.core.$el.off('mouseenter.volume');
|
|
52407
|
-
}
|
|
52408
|
-
_onUserChangeVolume(volume) {
|
|
52409
|
-
this._aboveBorderVolume = volume;
|
|
52410
|
-
}
|
|
52411
|
-
_onVolumeConfig(value) {
|
|
52412
|
-
this._aboveBorderVolume = value;
|
|
52413
|
-
this.container?.setVolume(0);
|
|
52414
52433
|
}
|
|
52415
52434
|
onCoreReady() {
|
|
52416
|
-
this.
|
|
52417
|
-
|
|
52418
|
-
if (this.core && this.core.$el) {
|
|
52419
|
-
// TODO find out why options.playerElement instead of this.core.$el or this.container.$el
|
|
52420
|
-
$(this.options.playerElement).on('mouseenter.volume', () => {
|
|
52421
|
-
this.onEnter();
|
|
52422
|
-
});
|
|
52423
|
-
$(this.options.playerElement).on('mouseleave.volume', () => {
|
|
52424
|
-
this.onLeave();
|
|
52425
|
-
});
|
|
52426
|
-
}
|
|
52427
|
-
if (!this._aboveBorderVolume) {
|
|
52428
|
-
this._aboveBorderVolume = this.container?.volume && !isNaN(this.container.volume) ? this.container.volume : 80;
|
|
52429
|
-
}
|
|
52430
|
-
if (this.options.mute || Browser.isMobile) {
|
|
52435
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
52436
|
+
if (Browser.isMobile) {
|
|
52431
52437
|
this.destroy();
|
|
52432
52438
|
return;
|
|
52433
52439
|
}
|
|
52434
|
-
|
|
52435
|
-
|
|
52440
|
+
if (mediaControl) {
|
|
52441
|
+
this.listenTo(mediaControl, ExtendedEvents.MEDIACONTROL_VOLUME, this.onVolumeChange);
|
|
52442
|
+
}
|
|
52443
|
+
$(this.core.$el).on('mouseenter', () => this.onEnter());
|
|
52444
|
+
$(this.core.$el).on('mouseleave', () => this.onLeave());
|
|
52445
|
+
if (!this.activeVolume) {
|
|
52446
|
+
this.activeVolume =
|
|
52447
|
+
this.core.activeContainer?.volume &&
|
|
52448
|
+
!isNaN(this.core.activeContainer.volume)
|
|
52449
|
+
? this.core.activeContainer.volume
|
|
52450
|
+
: 80;
|
|
52451
|
+
}
|
|
52452
|
+
this.duration = this.options.volumeFade?.duration || DEFAULT_DURATION;
|
|
52453
|
+
// TODO check if mute must be respected
|
|
52454
|
+
this.core.activeContainer?.setVolume(this.activeVolume);
|
|
52455
|
+
this.core.activePlayback.volume(0);
|
|
52456
|
+
}
|
|
52457
|
+
onVolumeChange(volume) {
|
|
52458
|
+
trace(`${T} onVolumeChange`, { volume });
|
|
52459
|
+
this.activeVolume = volume;
|
|
52436
52460
|
}
|
|
52437
52461
|
onEnter() {
|
|
52438
|
-
|
|
52462
|
+
trace(`${T} onEnter`);
|
|
52463
|
+
this.fade(this.duration, 1);
|
|
52439
52464
|
}
|
|
52440
|
-
|
|
52441
|
-
|
|
52465
|
+
onLeave() {
|
|
52466
|
+
trace(`${T} onLeave`);
|
|
52467
|
+
this.fade(this.duration, 0);
|
|
52468
|
+
}
|
|
52469
|
+
fade(duration, to) {
|
|
52470
|
+
this.stopFade();
|
|
52442
52471
|
const start = new Date().getTime();
|
|
52443
|
-
|
|
52444
|
-
|
|
52445
|
-
|
|
52446
|
-
|
|
52447
|
-
|
|
52448
|
-
const
|
|
52472
|
+
const from = 1 - to;
|
|
52473
|
+
this.timerId = setInterval(() => {
|
|
52474
|
+
const delta = new Date().getTime() - start;
|
|
52475
|
+
const progress = Math.min(1, delta / duration);
|
|
52476
|
+
const normVol = progress * to + (1 - progress) * from;
|
|
52477
|
+
const volume = normVol * this.activeVolume;
|
|
52478
|
+
this.core.activePlayback.volume(volume);
|
|
52449
52479
|
try {
|
|
52450
|
-
this.
|
|
52451
|
-
this.core.trigger(VolumeFadeEvents.FADE, progress * this._aboveBorderVolume);
|
|
52480
|
+
this.core.trigger(VolumeFadeEvents.FADE, volume);
|
|
52452
52481
|
}
|
|
52453
52482
|
catch (error) {
|
|
52454
|
-
// LogManager.exception(error);
|
|
52455
52483
|
reportError(error);
|
|
52456
|
-
this.clearCurrentInterval();
|
|
52457
52484
|
}
|
|
52458
|
-
if (progress >= 1
|
|
52459
|
-
this.
|
|
52485
|
+
if (progress >= 1) {
|
|
52486
|
+
this.stopFade();
|
|
52460
52487
|
}
|
|
52461
52488
|
}, 10);
|
|
52462
52489
|
}
|
|
52463
|
-
|
|
52464
|
-
|
|
52465
|
-
|
|
52466
|
-
this.
|
|
52490
|
+
stopFade() {
|
|
52491
|
+
trace(`${T} stopFade`);
|
|
52492
|
+
if (this.timerId !== null) {
|
|
52493
|
+
clearInterval(this.timerId);
|
|
52494
|
+
this.timerId = null;
|
|
52467
52495
|
}
|
|
52468
52496
|
}
|
|
52469
|
-
onLeave() {
|
|
52470
|
-
this.numberTo(this.delay, 1);
|
|
52471
|
-
}
|
|
52472
52497
|
}
|
|
52473
52498
|
|
|
52474
|
-
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 };
|
|
52499
|
+
export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, NerdStats as ClapprNerdStats, ClapprStats, ClapprStatsChronograph, ClapprStatsCounter, ClapprStatsEvents, ClickToPause, Clips, ClosedCaptions, ContextMenu, DvrControls, ErrorScreen, ExtendedEvents, 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 };
|