@gcorevideo/player 2.30.1 → 2.30.3
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-tracks/template.ejs +1 -1
- package/dist/core.js +1 -1
- package/dist/index.css +335 -335
- package/dist/index.embed.js +43 -13
- package/dist/index.js +69 -32
- package/lib/plugins/audio-selector/AudioTracks.d.ts +4 -0
- package/lib/plugins/audio-selector/AudioTracks.d.ts.map +1 -1
- package/lib/plugins/audio-selector/AudioTracks.js +42 -12
- package/lib/plugins/media-control/MediaControl.d.ts +1 -0
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +9 -1
- package/package.json +1 -1
- package/src/plugins/audio-selector/AudioTracks.ts +51 -16
- package/src/plugins/audio-selector/__tests__/__snapshots__/AudioTracks.test.ts.snap +9 -9
- package/src/plugins/media-control/MediaControl.ts +10 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/assets/vast-ads/style.scss +0 -112
- package/lib/plugins/vast-ads/VastAds.d.ts +0 -74
- package/lib/plugins/vast-ads/VastAds.d.ts.map +0 -1
- package/lib/plugins/vast-ads/VastAds.js +0 -693
- package/lib/plugins/vast-ads/loaderxml.d.ts +0 -32
- package/lib/plugins/vast-ads/loaderxml.d.ts.map +0 -1
- package/lib/plugins/vast-ads/loaderxml.js +0 -229
- package/lib/plugins/vast-ads/roll.d.ts +0 -60
- package/lib/plugins/vast-ads/roll.d.ts.map +0 -1
- package/lib/plugins/vast-ads/roll.js +0 -421
- package/lib/plugins/vast-ads/rollmanager.d.ts +0 -62
- package/lib/plugins/vast-ads/rollmanager.d.ts.map +0 -1
- package/lib/plugins/vast-ads/rollmanager.js +0 -357
- package/lib/plugins/vast-ads/sctemanager.d.ts +0 -18
- package/lib/plugins/vast-ads/sctemanager.d.ts.map +0 -1
- package/lib/plugins/vast-ads/sctemanager.js +0 -117
- package/lib/plugins/vast-ads/types.d.ts +0 -12
- package/lib/plugins/vast-ads/types.d.ts.map +0 -1
- package/lib/plugins/vast-ads/types.js +0 -1
- package/lib/plugins/vast-ads/urlhandler.d.ts +0 -4
- package/lib/plugins/vast-ads/urlhandler.d.ts.map +0 -1
- package/lib/plugins/vast-ads/urlhandler.js +0 -30
- package/lib/plugins/vast-ads/xmlhttprequest.d.ts +0 -6
- package/lib/plugins/vast-ads/xmlhttprequest.d.ts.map +0 -1
- package/lib/plugins/vast-ads/xmlhttprequest.js +0 -40
- package/lib/plugins/vast-ads/xmlmerge.d.ts +0 -12
- package/lib/plugins/vast-ads/xmlmerge.d.ts.map +0 -1
- package/lib/plugins/vast-ads/xmlmerge.js +0 -83
- package/src/plugins/vast-ads/VastAds.ts +0 -919
- package/src/plugins/vast-ads/loaderxml.ts +0 -301
- package/src/plugins/vast-ads/roll.ts +0 -590
- package/src/plugins/vast-ads/rollmanager.ts +0 -447
- package/src/plugins/vast-ads/sctemanager.ts +0 -152
- package/src/plugins/vast-ads/types.ts +0 -20
- package/src/plugins/vast-ads/urlhandler.ts +0 -42
- package/src/plugins/vast-ads/xmlhttprequest.ts +0 -49
- package/src/plugins/vast-ads/xmlmerge.ts +0 -106
package/dist/index.embed.js
CHANGED
|
@@ -51401,7 +51401,7 @@ function insertStyle(css) {
|
|
|
51401
51401
|
|
|
51402
51402
|
insertStyle("@import \"https://fonts.googleapis.com/css?family=Roboto\";\n:root {\n --theme-background-color: rgb(0 0 0 / 70%);\n --theme-text-color: rgb(255 255 255 / 100%);\n --theme-foreground-color: rgb(201 201 201 / 100%);\n --theme-hover-color: rgb(255 255 255 / 100%);\n}\n\n.gcore-skin-bg-color {\n background-color: var(--theme-background-color) !important;\n}\n\n.gcore-skin-text-color {\n color: var(--theme-text-color) !important;\n}\n\n.gcore-skin-text-color svg {\n fill: var(--theme-text-color) !important;\n}\n\n.gcore-skin-text-color svg path {\n fill: var(--theme-text-color) !important;\n}\n\n.gcore-skin-border-textarea-color {\n border-color: var(--theme-text-color) !important;\n}\n\n.gcore-skin-button-color {\n color: var(--theme-foreground-color) !important;\n}\n.gcore-skin-button-color svg {\n fill: var(--theme-foreground-color) !important;\n}\n.gcore-skin-button-color svg path {\n fill: var(--theme-foreground-color) !important;\n}\n.gcore-skin-button-color svg path.icon-hover {\n fill: var(--theme-foreground-color) !important;\n}\n.gcore-skin-button-color[data-fullscreen] svg {\n stroke: var(--theme-foreground-color) !important;\n}\n.gcore-skin-button-color[data-fullscreen] svg path {\n stroke: var(--theme-foreground-color) !important;\n}\n\n.gcore-skin-main-color {\n background-color: var(--theme-foreground-color);\n}\n\n.gcore-skin-border-color {\n border-color: var(--theme-foreground-color) !important;\n}\n\n.gcore-skin-button-color:hover {\n color: var(--theme-hover-color) !important;\n}\n\n.gcore-skin-button-color:hover svg {\n fill: var(--theme-hover-color) !important;\n}\n\n.gcore-skin-button-color:hover svg path {\n fill: var(--theme-hover-color) !important;\n}\n\n.gcore-skin-border-color:hover {\n border-color: var(--theme-hover-color) !important;\n}\n\n.gcore-skin-button-with-bg-color:hover svg path.icon-hover {\n fill: var(--theme-hover-color) !important;\n}\n\n.gcore-skin-active {\n color: var(--theme-hover-color) !important;\n}\n\n.gcore-skin-active svg {\n fill: var(--theme-hover-color) !important;\n}\n\n.gcore-skin-active svg path {\n fill: var(--theme-hover-color) !important;\n}\n\n* {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n user-select: none;\n}\n\n.player-poster {\n background-size: contain !important;\n}\n\n.spinner-three-bounce > .gcore-skin-main-color {\n box-shadow: 4px 4px 9px 1px rgba(36, 61, 81, 0.51);\n}\n\n.gplayer-lite-btn {\n cursor: pointer;\n border: none;\n margin: 0;\n padding: 0;\n width: auto;\n overflow: visible;\n background: transparent;\n /* inherit font & color from ancestor */\n color: inherit;\n font: inherit;\n /* Normalize `line-height`. Cannot be changed from `normal` in Firefox 4+. */\n line-height: normal;\n /* Corrects font smoothing for webkit */\n -webkit-font-smoothing: inherit;\n -moz-osx-font-smoothing: inherit;\n /* Corrects inability to style clickable `input` types in iOS */\n appearance: none;\n /* Remove excess padding and border in Firefox 4+ */\n}\n.gplayer-lite-btn::-moz-focus-inner {\n border: 0;\n padding: 0;\n}");
|
|
51403
51403
|
|
|
51404
|
-
const pluginHtml$4 = "<button class='gcore-skin-button-color media-control-dd' id=\"gplayer-audiotracks-button\" aria-haspopup=\"menu\" aria-expanded=\"false\">\n <span class=\"media-control-dd__text\" id=\"gplayer-audiotracks-button-text\"><%= title %></span>\n <span class=\"media-control-dd__arrow\"><%= icon %></span>\n</button>\n<ul class=\"gcore-skin-bg-color menu media-control-dd__popup\" id=\"gplayer-audiotracks-menu\" role=\"menu\">\n <% for (const track of tracks) { %>\n <li>\n <a href=\"#\" class=\"gcore-skin-text-color\" data-item=\"<%= track.id %>\" role=\"menuitemradio\" aria-checked=\"<%= track.id === current %>\">\n <%= track.label %>\n </a>\n </li>\n <% }; %>\n</ul>\n";
|
|
51404
|
+
const pluginHtml$4 = "<button class='gcore-skin-button-color media-control-dd' id=\"gplayer-audiotracks-button\" aria-haspopup=\"menu\" aria-expanded=\"false\">\n <span class=\"media-control-dd__text\" id=\"gplayer-audiotracks-button-text\"><%= title %></span>\n <span class=\"media-control-dd__arrow\"><%= icon %></span>\n</button>\n<ul class=\"gcore-skin-bg-color menu media-control-dd__popup\" id=\"gplayer-audiotracks-menu\" role=\"menu\">\n <% for (const track of tracks) { %>\n <li>\n <a href=\"#\" class=\"gcore-skin-text-color\" data-item=\"<%= track.id %>\" role=\"menuitemradio\" aria-checked=\"<%= track.id === current %>\">\n <%= track.label || track.language %>\n </a>\n </li>\n <% }; %>\n</ul>\n";
|
|
51405
51405
|
|
|
51406
51406
|
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";
|
|
51407
51407
|
|
|
@@ -51861,6 +51861,8 @@ class MediaControl extends UICorePlugin {
|
|
|
51861
51861
|
metadataLoaded = false;
|
|
51862
51862
|
hasUpdate = false;
|
|
51863
51863
|
persistConfig;
|
|
51864
|
+
// Volume before muting, used to restore the volume when unmuting
|
|
51865
|
+
prevVolume = 0;
|
|
51864
51866
|
renderTimerId = null;
|
|
51865
51867
|
rendered = false;
|
|
51866
51868
|
settings = INITIAL_SETTINGS;
|
|
@@ -52355,7 +52357,12 @@ class MediaControl extends UICorePlugin {
|
|
|
52355
52357
|
return volumeFromUI;
|
|
52356
52358
|
}
|
|
52357
52359
|
toggleMute() {
|
|
52358
|
-
this.
|
|
52360
|
+
const nextVolume = this.muted ? (this.prevVolume === 0 ? 100 : this.prevVolume) : 0;
|
|
52361
|
+
if (this.muted) ;
|
|
52362
|
+
else {
|
|
52363
|
+
this.prevVolume = this.volume;
|
|
52364
|
+
}
|
|
52365
|
+
this.setVolume(nextVolume);
|
|
52359
52366
|
}
|
|
52360
52367
|
/**
|
|
52361
52368
|
* Set the volume
|
|
@@ -53055,7 +53062,6 @@ function mergeElements(a, b) {
|
|
|
53055
53062
|
}
|
|
53056
53063
|
|
|
53057
53064
|
const VERSION$6 = '2.22.4';
|
|
53058
|
-
// const T = 'plugins.audiotracks'
|
|
53059
53065
|
/**
|
|
53060
53066
|
* `PLUGIN` that makes possible to switch audio tracks via the media control UI.
|
|
53061
53067
|
* @public
|
|
@@ -53070,6 +53076,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
53070
53076
|
currentTrack = null;
|
|
53071
53077
|
open = false;
|
|
53072
53078
|
tracks = [];
|
|
53079
|
+
autoUpdateTimerId = null;
|
|
53073
53080
|
/**
|
|
53074
53081
|
* @internal
|
|
53075
53082
|
*/
|
|
@@ -53130,19 +53137,18 @@ class AudioTracks extends UICorePlugin {
|
|
|
53130
53137
|
onActiveContainerChanged() {
|
|
53131
53138
|
this.currentTrack = null;
|
|
53132
53139
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_AUDIO_AVAILABLE, (tracks) => {
|
|
53140
|
+
const currentTrackId = this.core.activeContainer.currentAudioTrack?.id ??
|
|
53141
|
+
this.core.activePlayback?.currentAudioTrack?.id;
|
|
53133
53142
|
this.currentTrack =
|
|
53134
|
-
tracks.find((track) => track.
|
|
53143
|
+
tracks.find((track) => track.id === currentTrackId) ??
|
|
53144
|
+
tracks.find((track) => track.kind === 'main') ??
|
|
53145
|
+
tracks[0] ??
|
|
53146
|
+
null;
|
|
53135
53147
|
this.tracks = tracks;
|
|
53136
53148
|
this.render();
|
|
53137
53149
|
this.mount();
|
|
53138
53150
|
});
|
|
53139
|
-
this.
|
|
53140
|
-
this.currentTrack = track;
|
|
53141
|
-
this.highlightCurrentTrack();
|
|
53142
|
-
this.buttonElement().removeClass('changing');
|
|
53143
|
-
this.updateText();
|
|
53144
|
-
});
|
|
53145
|
-
// TODO test
|
|
53151
|
+
this.bindContainerAudioChanged();
|
|
53146
53152
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_CLICK, () => {
|
|
53147
53153
|
this.hideMenu();
|
|
53148
53154
|
});
|
|
@@ -53150,6 +53156,21 @@ class AudioTracks extends UICorePlugin {
|
|
|
53150
53156
|
this.clickaway(null);
|
|
53151
53157
|
});
|
|
53152
53158
|
}
|
|
53159
|
+
bindContainerAudioChanged() {
|
|
53160
|
+
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_AUDIO_CHANGED, (track) => {
|
|
53161
|
+
this.setCurrentTrack(track);
|
|
53162
|
+
});
|
|
53163
|
+
}
|
|
53164
|
+
setCurrentTrack(track) {
|
|
53165
|
+
if (this.autoUpdateTimerId) {
|
|
53166
|
+
clearTimeout(this.autoUpdateTimerId);
|
|
53167
|
+
this.autoUpdateTimerId = null;
|
|
53168
|
+
}
|
|
53169
|
+
this.currentTrack = track;
|
|
53170
|
+
this.highlightCurrentTrack();
|
|
53171
|
+
this.buttonElement().removeClass('changing');
|
|
53172
|
+
this.updateText();
|
|
53173
|
+
}
|
|
53153
53174
|
shouldRender() {
|
|
53154
53175
|
// Render is called from the parent class constructor so tracks aren't available
|
|
53155
53176
|
// Only care if we have at least 2 to choose from
|
|
@@ -53182,7 +53203,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
53182
53203
|
selectAudioTrack(id) {
|
|
53183
53204
|
this.startTrackSwitching();
|
|
53184
53205
|
this.core.activeContainer.switchAudioTrack(id);
|
|
53185
|
-
this.
|
|
53206
|
+
this.autoUpdateSelected(id);
|
|
53186
53207
|
}
|
|
53187
53208
|
hideMenu() {
|
|
53188
53209
|
this.open = false;
|
|
@@ -53233,7 +53254,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
53233
53254
|
if (!this.currentTrack) {
|
|
53234
53255
|
return;
|
|
53235
53256
|
}
|
|
53236
|
-
this.buttonElementText().text(this.
|
|
53257
|
+
this.buttonElementText().text(this.getTitle());
|
|
53237
53258
|
}
|
|
53238
53259
|
highlightCurrentTrack() {
|
|
53239
53260
|
this.trackElement().removeClass('current');
|
|
@@ -53254,6 +53275,15 @@ class AudioTracks extends UICorePlugin {
|
|
|
53254
53275
|
this.core.getPlugin('media_control')?.slot('audiotracks', this.$el);
|
|
53255
53276
|
}
|
|
53256
53277
|
}
|
|
53278
|
+
autoUpdateSelected(id) {
|
|
53279
|
+
if (this.autoUpdateTimerId) {
|
|
53280
|
+
clearTimeout(this.autoUpdateTimerId);
|
|
53281
|
+
}
|
|
53282
|
+
this.autoUpdateTimerId = setTimeout(() => {
|
|
53283
|
+
const track = this.tracks.find(t => t.id === id) ?? null;
|
|
53284
|
+
this.setCurrentTrack(track);
|
|
53285
|
+
}, 500);
|
|
53286
|
+
}
|
|
53257
53287
|
clickaway = mediaControlClickaway(() => this.hideMenu());
|
|
53258
53288
|
}
|
|
53259
53289
|
|
package/dist/index.js
CHANGED
|
@@ -12922,7 +12922,7 @@ var PlaybackEvents;
|
|
|
12922
12922
|
// https://github.com/clappr/clappr/blob/8752995ea439321ac7ca3cd35e8c64de7a3c3d17/LICENSE
|
|
12923
12923
|
const AUTO$1 = -1;
|
|
12924
12924
|
const { now: now$2 } = Utils;
|
|
12925
|
-
const T$
|
|
12925
|
+
const T$g = 'playback.dash';
|
|
12926
12926
|
class DashPlayback extends BasePlayback {
|
|
12927
12927
|
_levels = [];
|
|
12928
12928
|
_currentLevel = AUTO$1;
|
|
@@ -13199,7 +13199,7 @@ class DashPlayback extends BasePlayback {
|
|
|
13199
13199
|
this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
|
|
13200
13200
|
}
|
|
13201
13201
|
_onPlaybackError = (event) => {
|
|
13202
|
-
trace(`${T$
|
|
13202
|
+
trace(`${T$g} _onPlaybackError`, { type: event.type, code: event.error.code, message: event.error.message });
|
|
13203
13203
|
};
|
|
13204
13204
|
_onDASHJSSError = (event) => {
|
|
13205
13205
|
this._stopTimeUpdateTimer();
|
|
@@ -50141,7 +50141,7 @@ const { now } = Utils;
|
|
|
50141
50141
|
const AUTO = -1;
|
|
50142
50142
|
const DEFAULT_RECOVER_ATTEMPTS = 16;
|
|
50143
50143
|
Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
|
|
50144
|
-
const T$
|
|
50144
|
+
const T$f = 'playback.hls';
|
|
50145
50145
|
class HlsPlayback extends BasePlayback {
|
|
50146
50146
|
_currentFragment = null;
|
|
50147
50147
|
_currentLevel = null;
|
|
@@ -50473,7 +50473,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
50473
50473
|
}
|
|
50474
50474
|
else {
|
|
50475
50475
|
Log.error('hlsjs: failed to recover', { evt, data });
|
|
50476
|
-
trace(`${T$
|
|
50476
|
+
trace(`${T$f} _recover failed to recover`, {
|
|
50477
50477
|
type: data.type,
|
|
50478
50478
|
details: data.details,
|
|
50479
50479
|
});
|
|
@@ -50560,7 +50560,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
50560
50560
|
this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
|
|
50561
50561
|
}
|
|
50562
50562
|
_onHLSJSError(evt, data) {
|
|
50563
|
-
trace(`${T$
|
|
50563
|
+
trace(`${T$f} _onHLSJSError`, {
|
|
50564
50564
|
fatal: data.fatal,
|
|
50565
50565
|
type: data.type,
|
|
50566
50566
|
details: data.details,
|
|
@@ -50608,7 +50608,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
50608
50608
|
evt,
|
|
50609
50609
|
data,
|
|
50610
50610
|
});
|
|
50611
|
-
trace(`${T$
|
|
50611
|
+
trace(`${T$f} _onHLSJSError trying to recover from network error`, {
|
|
50612
50612
|
details: data.details,
|
|
50613
50613
|
});
|
|
50614
50614
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -50621,7 +50621,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
50621
50621
|
evt,
|
|
50622
50622
|
data,
|
|
50623
50623
|
});
|
|
50624
|
-
trace(`${T$
|
|
50624
|
+
trace(`${T$f} _onHLSJSError trying to recover from media error`, {
|
|
50625
50625
|
details: data.details,
|
|
50626
50626
|
});
|
|
50627
50627
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -50651,7 +50651,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
50651
50651
|
return;
|
|
50652
50652
|
}
|
|
50653
50653
|
Log.warn('hlsjs: non-fatal error occurred', { evt, data });
|
|
50654
|
-
trace(`${T$
|
|
50654
|
+
trace(`${T$f} _onHLSJSError non-fatal error occurred`, {
|
|
50655
50655
|
type: data.type,
|
|
50656
50656
|
details: data.details,
|
|
50657
50657
|
});
|
|
@@ -50984,7 +50984,7 @@ class HlsPlayback extends BasePlayback {
|
|
|
50984
50984
|
this.trigger(Events$1.PLAYBACK_AUDIO_AVAILABLE, data.audioTracks.map(toClapprTrack));
|
|
50985
50985
|
}
|
|
50986
50986
|
_onAudioTrackSwitched(_, data) {
|
|
50987
|
-
trace(`${T$
|
|
50987
|
+
trace(`${T$f} onAudioTrackSwitched`);
|
|
50988
50988
|
// @ts-ignore
|
|
50989
50989
|
const track = this._hls.audioTracks[data.id];
|
|
50990
50990
|
this.trigger(Events$1.PLAYBACK_AUDIO_CHANGED, toClapprTrack(track));
|
|
@@ -51032,7 +51032,7 @@ function toClapprTrack(t) {
|
|
|
51032
51032
|
};
|
|
51033
51033
|
}
|
|
51034
51034
|
|
|
51035
|
-
const T$
|
|
51035
|
+
const T$e = 'playback.html5_video';
|
|
51036
51036
|
const STALL_TIMEOUT = 15000;
|
|
51037
51037
|
class HTML5Video extends BasePlayback {
|
|
51038
51038
|
stallTimerId = null;
|
|
@@ -51133,7 +51133,7 @@ class HTML5Video extends BasePlayback {
|
|
|
51133
51133
|
switchAudioTrack(id) {
|
|
51134
51134
|
const tracks = this.el.audioTracks;
|
|
51135
51135
|
const supported = !!tracks;
|
|
51136
|
-
trace(`${T$
|
|
51136
|
+
trace(`${T$e} switchAudioTrack`, {
|
|
51137
51137
|
supported,
|
|
51138
51138
|
});
|
|
51139
51139
|
if (supported) {
|
|
@@ -51152,7 +51152,7 @@ function registerPlaybacks() {
|
|
|
51152
51152
|
Loader.registerPlayback(DashPlayback);
|
|
51153
51153
|
}
|
|
51154
51154
|
|
|
51155
|
-
const T$
|
|
51155
|
+
const T$d = 'gplayer';
|
|
51156
51156
|
const DEFAULT_OPTIONS = {
|
|
51157
51157
|
autoPlay: false,
|
|
51158
51158
|
debug: 'none',
|
|
@@ -51499,7 +51499,7 @@ class Player {
|
|
|
51499
51499
|
}
|
|
51500
51500
|
}
|
|
51501
51501
|
triggerAutoPlay() {
|
|
51502
|
-
trace(`${T$
|
|
51502
|
+
trace(`${T$d} triggerAutoPlay`);
|
|
51503
51503
|
setTimeout(() => {
|
|
51504
51504
|
this.player?.play({
|
|
51505
51505
|
autoPlay: true,
|
|
@@ -51517,7 +51517,7 @@ class Player {
|
|
|
51517
51517
|
// TODO test
|
|
51518
51518
|
events = {
|
|
51519
51519
|
onReady: () => {
|
|
51520
|
-
trace(`${T$
|
|
51520
|
+
trace(`${T$d} onReady`, {
|
|
51521
51521
|
ready: this.ready,
|
|
51522
51522
|
});
|
|
51523
51523
|
if (this.ready) {
|
|
@@ -51551,7 +51551,7 @@ class Player {
|
|
|
51551
51551
|
buildCoreOptions(rootNode) {
|
|
51552
51552
|
const sources = this.buildMediaSourcesList();
|
|
51553
51553
|
const source = sources[0];
|
|
51554
|
-
trace(`${T$
|
|
51554
|
+
trace(`${T$d} buildCoreOptions`, {
|
|
51555
51555
|
source,
|
|
51556
51556
|
sources,
|
|
51557
51557
|
});
|
|
@@ -51628,7 +51628,7 @@ class Player {
|
|
|
51628
51628
|
}
|
|
51629
51629
|
}
|
|
51630
51630
|
|
|
51631
|
-
var version$1 = "2.30.
|
|
51631
|
+
var version$1 = "2.30.3";
|
|
51632
51632
|
|
|
51633
51633
|
var packages = {
|
|
51634
51634
|
"node_modules/@clappr/core": {
|
|
@@ -51652,7 +51652,7 @@ function version() {
|
|
|
51652
51652
|
};
|
|
51653
51653
|
}
|
|
51654
51654
|
|
|
51655
|
-
const pluginHtml$6 = "<button class='gcore-skin-button-color media-control-dd' id=\"gplayer-audiotracks-button\" aria-haspopup=\"menu\" aria-expanded=\"false\">\n <span class=\"media-control-dd__text\" id=\"gplayer-audiotracks-button-text\"><%= title %></span>\n <span class=\"media-control-dd__arrow\"><%= icon %></span>\n</button>\n<ul class=\"gcore-skin-bg-color menu media-control-dd__popup\" id=\"gplayer-audiotracks-menu\" role=\"menu\">\n <% for (const track of tracks) { %>\n <li>\n <a href=\"#\" class=\"gcore-skin-text-color\" data-item=\"<%= track.id %>\" role=\"menuitemradio\" aria-checked=\"<%= track.id === current %>\">\n <%= track.label %>\n </a>\n </li>\n <% }; %>\n</ul>\n";
|
|
51655
|
+
const pluginHtml$6 = "<button class='gcore-skin-button-color media-control-dd' id=\"gplayer-audiotracks-button\" aria-haspopup=\"menu\" aria-expanded=\"false\">\n <span class=\"media-control-dd__text\" id=\"gplayer-audiotracks-button-text\"><%= title %></span>\n <span class=\"media-control-dd__arrow\"><%= icon %></span>\n</button>\n<ul class=\"gcore-skin-bg-color menu media-control-dd__popup\" id=\"gplayer-audiotracks-menu\" role=\"menu\">\n <% for (const track of tracks) { %>\n <li>\n <a href=\"#\" class=\"gcore-skin-text-color\" data-item=\"<%= track.id %>\" role=\"menuitemradio\" aria-checked=\"<%= track.id === current %>\">\n <%= track.label || track.language %>\n </a>\n </li>\n <% }; %>\n</ul>\n";
|
|
51656
51656
|
|
|
51657
51657
|
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";
|
|
51658
51658
|
|
|
@@ -52061,7 +52061,7 @@ const INITIAL_SETTINGS = {
|
|
|
52061
52061
|
default: [],
|
|
52062
52062
|
seekEnabled: false,
|
|
52063
52063
|
};
|
|
52064
|
-
const T$
|
|
52064
|
+
const T$c = 'plugins.media_control';
|
|
52065
52065
|
/**
|
|
52066
52066
|
* Extended events for the {@link MediaControl} plugin
|
|
52067
52067
|
* @public
|
|
@@ -52111,6 +52111,8 @@ class MediaControl extends UICorePlugin {
|
|
|
52111
52111
|
metadataLoaded = false;
|
|
52112
52112
|
hasUpdate = false;
|
|
52113
52113
|
persistConfig;
|
|
52114
|
+
// Volume before muting, used to restore the volume when unmuting
|
|
52115
|
+
prevVolume = 0;
|
|
52114
52116
|
renderTimerId = null;
|
|
52115
52117
|
rendered = false;
|
|
52116
52118
|
settings = INITIAL_SETTINGS;
|
|
@@ -52354,7 +52356,7 @@ class MediaControl extends UICorePlugin {
|
|
|
52354
52356
|
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
52355
52357
|
*/
|
|
52356
52358
|
enable() {
|
|
52357
|
-
trace(`${T$
|
|
52359
|
+
trace(`${T$c} enable`, {
|
|
52358
52360
|
chromeless: this.options.chromeless,
|
|
52359
52361
|
userDisabled: this.userDisabled,
|
|
52360
52362
|
});
|
|
@@ -52511,7 +52513,7 @@ class MediaControl extends UICorePlugin {
|
|
|
52511
52513
|
this.$el.removeClass('w370');
|
|
52512
52514
|
this.$el.removeClass('w270');
|
|
52513
52515
|
this.verticalVolume = false;
|
|
52514
|
-
trace(`${T$
|
|
52516
|
+
trace(`${T$c} playerResize`, {
|
|
52515
52517
|
size,
|
|
52516
52518
|
width: this.container.$el.width(),
|
|
52517
52519
|
height: this.container.$el.height(),
|
|
@@ -52609,7 +52611,12 @@ class MediaControl extends UICorePlugin {
|
|
|
52609
52611
|
return volumeFromUI;
|
|
52610
52612
|
}
|
|
52611
52613
|
toggleMute() {
|
|
52612
|
-
this.
|
|
52614
|
+
const nextVolume = this.muted ? (this.prevVolume === 0 ? 100 : this.prevVolume) : 0;
|
|
52615
|
+
if (this.muted) ;
|
|
52616
|
+
else {
|
|
52617
|
+
this.prevVolume = this.volume;
|
|
52618
|
+
}
|
|
52619
|
+
this.setVolume(nextVolume);
|
|
52613
52620
|
}
|
|
52614
52621
|
/**
|
|
52615
52622
|
* Set the volume
|
|
@@ -53309,7 +53316,7 @@ function mergeElements(a, b) {
|
|
|
53309
53316
|
}
|
|
53310
53317
|
|
|
53311
53318
|
const VERSION$7 = '2.22.4';
|
|
53312
|
-
|
|
53319
|
+
const T$b = 'plugins.audiotracks';
|
|
53313
53320
|
/**
|
|
53314
53321
|
* `PLUGIN` that makes possible to switch audio tracks via the media control UI.
|
|
53315
53322
|
* @public
|
|
@@ -53324,6 +53331,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
53324
53331
|
currentTrack = null;
|
|
53325
53332
|
open = false;
|
|
53326
53333
|
tracks = [];
|
|
53334
|
+
autoUpdateTimerId = null;
|
|
53327
53335
|
/**
|
|
53328
53336
|
* @internal
|
|
53329
53337
|
*/
|
|
@@ -53384,19 +53392,21 @@ class AudioTracks extends UICorePlugin {
|
|
|
53384
53392
|
onActiveContainerChanged() {
|
|
53385
53393
|
this.currentTrack = null;
|
|
53386
53394
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_AUDIO_AVAILABLE, (tracks) => {
|
|
53395
|
+
trace(`${T$b} on Events.CONTAINER_AUDIO_AVAILABLE`, {
|
|
53396
|
+
tracks,
|
|
53397
|
+
});
|
|
53398
|
+
const currentTrackId = this.core.activeContainer.currentAudioTrack?.id ??
|
|
53399
|
+
this.core.activePlayback?.currentAudioTrack?.id;
|
|
53387
53400
|
this.currentTrack =
|
|
53388
|
-
tracks.find((track) => track.
|
|
53401
|
+
tracks.find((track) => track.id === currentTrackId) ??
|
|
53402
|
+
tracks.find((track) => track.kind === 'main') ??
|
|
53403
|
+
tracks[0] ??
|
|
53404
|
+
null;
|
|
53389
53405
|
this.tracks = tracks;
|
|
53390
53406
|
this.render();
|
|
53391
53407
|
this.mount();
|
|
53392
53408
|
});
|
|
53393
|
-
this.
|
|
53394
|
-
this.currentTrack = track;
|
|
53395
|
-
this.highlightCurrentTrack();
|
|
53396
|
-
this.buttonElement().removeClass('changing');
|
|
53397
|
-
this.updateText();
|
|
53398
|
-
});
|
|
53399
|
-
// TODO test
|
|
53409
|
+
this.bindContainerAudioChanged();
|
|
53400
53410
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_CLICK, () => {
|
|
53401
53411
|
this.hideMenu();
|
|
53402
53412
|
});
|
|
@@ -53404,6 +53414,24 @@ class AudioTracks extends UICorePlugin {
|
|
|
53404
53414
|
this.clickaway(null);
|
|
53405
53415
|
});
|
|
53406
53416
|
}
|
|
53417
|
+
bindContainerAudioChanged() {
|
|
53418
|
+
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_AUDIO_CHANGED, (track) => {
|
|
53419
|
+
trace(`${T$b} on Events.CONTAINER_AUDIO_CHANGED`, {
|
|
53420
|
+
track,
|
|
53421
|
+
});
|
|
53422
|
+
this.setCurrentTrack(track);
|
|
53423
|
+
});
|
|
53424
|
+
}
|
|
53425
|
+
setCurrentTrack(track) {
|
|
53426
|
+
if (this.autoUpdateTimerId) {
|
|
53427
|
+
clearTimeout(this.autoUpdateTimerId);
|
|
53428
|
+
this.autoUpdateTimerId = null;
|
|
53429
|
+
}
|
|
53430
|
+
this.currentTrack = track;
|
|
53431
|
+
this.highlightCurrentTrack();
|
|
53432
|
+
this.buttonElement().removeClass('changing');
|
|
53433
|
+
this.updateText();
|
|
53434
|
+
}
|
|
53407
53435
|
shouldRender() {
|
|
53408
53436
|
// Render is called from the parent class constructor so tracks aren't available
|
|
53409
53437
|
// Only care if we have at least 2 to choose from
|
|
@@ -53436,7 +53464,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
53436
53464
|
selectAudioTrack(id) {
|
|
53437
53465
|
this.startTrackSwitching();
|
|
53438
53466
|
this.core.activeContainer.switchAudioTrack(id);
|
|
53439
|
-
this.
|
|
53467
|
+
this.autoUpdateSelected(id);
|
|
53440
53468
|
}
|
|
53441
53469
|
hideMenu() {
|
|
53442
53470
|
this.open = false;
|
|
@@ -53487,7 +53515,7 @@ class AudioTracks extends UICorePlugin {
|
|
|
53487
53515
|
if (!this.currentTrack) {
|
|
53488
53516
|
return;
|
|
53489
53517
|
}
|
|
53490
|
-
this.buttonElementText().text(this.
|
|
53518
|
+
this.buttonElementText().text(this.getTitle());
|
|
53491
53519
|
}
|
|
53492
53520
|
highlightCurrentTrack() {
|
|
53493
53521
|
this.trackElement().removeClass('current');
|
|
@@ -53508,6 +53536,15 @@ class AudioTracks extends UICorePlugin {
|
|
|
53508
53536
|
this.core.getPlugin('media_control')?.slot('audiotracks', this.$el);
|
|
53509
53537
|
}
|
|
53510
53538
|
}
|
|
53539
|
+
autoUpdateSelected(id) {
|
|
53540
|
+
if (this.autoUpdateTimerId) {
|
|
53541
|
+
clearTimeout(this.autoUpdateTimerId);
|
|
53542
|
+
}
|
|
53543
|
+
this.autoUpdateTimerId = setTimeout(() => {
|
|
53544
|
+
const track = this.tracks.find(t => t.id === id) ?? null;
|
|
53545
|
+
this.setCurrentTrack(track);
|
|
53546
|
+
}, 500);
|
|
53547
|
+
}
|
|
53511
53548
|
clickaway = mediaControlClickaway(() => this.hideMenu());
|
|
53512
53549
|
}
|
|
53513
53550
|
|
|
@@ -13,6 +13,7 @@ export declare class AudioTracks extends UICorePlugin {
|
|
|
13
13
|
private currentTrack;
|
|
14
14
|
private open;
|
|
15
15
|
private tracks;
|
|
16
|
+
private autoUpdateTimerId;
|
|
16
17
|
/**
|
|
17
18
|
* @internal
|
|
18
19
|
*/
|
|
@@ -47,6 +48,8 @@ export declare class AudioTracks extends UICorePlugin {
|
|
|
47
48
|
bindEvents(): void;
|
|
48
49
|
private onCoreReady;
|
|
49
50
|
private onActiveContainerChanged;
|
|
51
|
+
private bindContainerAudioChanged;
|
|
52
|
+
private setCurrentTrack;
|
|
50
53
|
private shouldRender;
|
|
51
54
|
/**
|
|
52
55
|
* @internal
|
|
@@ -65,6 +68,7 @@ export declare class AudioTracks extends UICorePlugin {
|
|
|
65
68
|
private updateText;
|
|
66
69
|
private highlightCurrentTrack;
|
|
67
70
|
private mount;
|
|
71
|
+
private autoUpdateSelected;
|
|
68
72
|
private clickaway;
|
|
69
73
|
}
|
|
70
74
|
//# sourceMappingURL=AudioTracks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioTracks.d.ts","sourceRoot":"","sources":["../../../src/plugins/audio-selector/AudioTracks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAY,MAAM,cAAc,CAAA;AAiB7D;;;;;;;;;GASG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,YAAY,CAA0B;IAE9C,OAAO,CAAC,IAAI,CAAQ;IAEpB,OAAO,CAAC,MAAM,CAAmB;IAEjC;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,MAAM,KAAK,OAAO,WAEjB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAEvD;;OAEG;IACH,IAAa,UAAU;;MAItB;IAED;;OAEG;IACH,IAAa,MAAM;;;MAKlB;IAED;;OAEG;IACM,UAAU;IASnB,OAAO,CAAC,WAAW;IAoBnB,OAAO,C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, UICorePlugin, template } from '@clappr/core';
|
|
2
2
|
import assert from 'assert';
|
|
3
|
-
|
|
3
|
+
import { trace } from '@gcorevideo/utils';
|
|
4
4
|
import { CLAPPR_VERSION } from '../../build.js';
|
|
5
5
|
import pluginHtml from '../../../assets/audio-tracks/template.ejs';
|
|
6
6
|
import audioArrow from '../../../assets/icons/old/quality-arrow.svg';
|
|
7
7
|
import { ExtendedEvents } from '../media-control/MediaControl.js';
|
|
8
8
|
import { mediaControlClickaway } from '../../utils/clickaway.js';
|
|
9
9
|
const VERSION = '2.22.4';
|
|
10
|
-
|
|
10
|
+
const T = 'plugins.audiotracks';
|
|
11
11
|
/**
|
|
12
12
|
* `PLUGIN` that makes possible to switch audio tracks via the media control UI.
|
|
13
13
|
* @public
|
|
@@ -22,6 +22,7 @@ export class AudioTracks extends UICorePlugin {
|
|
|
22
22
|
currentTrack = null;
|
|
23
23
|
open = false;
|
|
24
24
|
tracks = [];
|
|
25
|
+
autoUpdateTimerId = null;
|
|
25
26
|
/**
|
|
26
27
|
* @internal
|
|
27
28
|
*/
|
|
@@ -82,19 +83,21 @@ export class AudioTracks extends UICorePlugin {
|
|
|
82
83
|
onActiveContainerChanged() {
|
|
83
84
|
this.currentTrack = null;
|
|
84
85
|
this.listenTo(this.core.activeContainer, Events.CONTAINER_AUDIO_AVAILABLE, (tracks) => {
|
|
86
|
+
trace(`${T} on Events.CONTAINER_AUDIO_AVAILABLE`, {
|
|
87
|
+
tracks,
|
|
88
|
+
});
|
|
89
|
+
const currentTrackId = this.core.activeContainer.currentAudioTrack?.id ??
|
|
90
|
+
this.core.activePlayback?.currentAudioTrack?.id;
|
|
85
91
|
this.currentTrack =
|
|
86
|
-
tracks.find((track) => track.
|
|
92
|
+
tracks.find((track) => track.id === currentTrackId) ??
|
|
93
|
+
tracks.find((track) => track.kind === 'main') ??
|
|
94
|
+
tracks[0] ??
|
|
95
|
+
null;
|
|
87
96
|
this.tracks = tracks;
|
|
88
97
|
this.render();
|
|
89
98
|
this.mount();
|
|
90
99
|
});
|
|
91
|
-
this.
|
|
92
|
-
this.currentTrack = track;
|
|
93
|
-
this.highlightCurrentTrack();
|
|
94
|
-
this.buttonElement().removeClass('changing');
|
|
95
|
-
this.updateText();
|
|
96
|
-
});
|
|
97
|
-
// TODO test
|
|
100
|
+
this.bindContainerAudioChanged();
|
|
98
101
|
this.listenTo(this.core.activeContainer, Events.CONTAINER_CLICK, () => {
|
|
99
102
|
this.hideMenu();
|
|
100
103
|
});
|
|
@@ -102,6 +105,24 @@ export class AudioTracks extends UICorePlugin {
|
|
|
102
105
|
this.clickaway(null);
|
|
103
106
|
});
|
|
104
107
|
}
|
|
108
|
+
bindContainerAudioChanged() {
|
|
109
|
+
this.listenTo(this.core.activeContainer, Events.CONTAINER_AUDIO_CHANGED, (track) => {
|
|
110
|
+
trace(`${T} on Events.CONTAINER_AUDIO_CHANGED`, {
|
|
111
|
+
track,
|
|
112
|
+
});
|
|
113
|
+
this.setCurrentTrack(track);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
setCurrentTrack(track) {
|
|
117
|
+
if (this.autoUpdateTimerId) {
|
|
118
|
+
clearTimeout(this.autoUpdateTimerId);
|
|
119
|
+
this.autoUpdateTimerId = null;
|
|
120
|
+
}
|
|
121
|
+
this.currentTrack = track;
|
|
122
|
+
this.highlightCurrentTrack();
|
|
123
|
+
this.buttonElement().removeClass('changing');
|
|
124
|
+
this.updateText();
|
|
125
|
+
}
|
|
105
126
|
shouldRender() {
|
|
106
127
|
// Render is called from the parent class constructor so tracks aren't available
|
|
107
128
|
// Only care if we have at least 2 to choose from
|
|
@@ -134,7 +155,7 @@ export class AudioTracks extends UICorePlugin {
|
|
|
134
155
|
selectAudioTrack(id) {
|
|
135
156
|
this.startTrackSwitching();
|
|
136
157
|
this.core.activeContainer.switchAudioTrack(id);
|
|
137
|
-
this.
|
|
158
|
+
this.autoUpdateSelected(id);
|
|
138
159
|
}
|
|
139
160
|
hideMenu() {
|
|
140
161
|
this.open = false;
|
|
@@ -185,7 +206,7 @@ export class AudioTracks extends UICorePlugin {
|
|
|
185
206
|
if (!this.currentTrack) {
|
|
186
207
|
return;
|
|
187
208
|
}
|
|
188
|
-
this.buttonElementText().text(this.
|
|
209
|
+
this.buttonElementText().text(this.getTitle());
|
|
189
210
|
}
|
|
190
211
|
highlightCurrentTrack() {
|
|
191
212
|
this.trackElement().removeClass('current');
|
|
@@ -206,5 +227,14 @@ export class AudioTracks extends UICorePlugin {
|
|
|
206
227
|
this.core.getPlugin('media_control')?.slot('audiotracks', this.$el);
|
|
207
228
|
}
|
|
208
229
|
}
|
|
230
|
+
autoUpdateSelected(id) {
|
|
231
|
+
if (this.autoUpdateTimerId) {
|
|
232
|
+
clearTimeout(this.autoUpdateTimerId);
|
|
233
|
+
}
|
|
234
|
+
this.autoUpdateTimerId = setTimeout(() => {
|
|
235
|
+
const track = this.tracks.find(t => t.id === id) ?? null;
|
|
236
|
+
this.setCurrentTrack(track);
|
|
237
|
+
}, 500);
|
|
238
|
+
}
|
|
209
239
|
clickaway = mediaControlClickaway(() => this.hideMenu());
|
|
210
240
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaControl.d.ts","sourceRoot":"","sources":["../../../src/plugins/media-control/MediaControl.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,YAAY,EAMZ,IAAI,EACL,MAAM,cAAc,CAAA;AASrB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAM5C,OAAO,kDAAkD,CAAA;AA0BzD;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GACnC,UAAU,GACV,YAAY,GACZ,cAAc,GACd,WAAW,GACX,UAAU,GACV,UAAU,GACV,SAAS,GACT,QAAQ,CAAA;AAEZ;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAClC,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,QAAQ,GACR,SAAS,CAAA;AAEb;;;;;;;GAOG;AACH,MAAM,M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AAQ;IAIvB,OAAO,CAAC,MAAM,CAAC,QAAQ;IAevB,OAAO,CAAC,6BAA6B;IAQrC,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,SAAS,CAA0D;CAC5E"}
|
|
@@ -101,6 +101,8 @@ export class MediaControl extends UICorePlugin {
|
|
|
101
101
|
metadataLoaded = false;
|
|
102
102
|
hasUpdate = false;
|
|
103
103
|
persistConfig;
|
|
104
|
+
// Volume before muting, used to restore the volume when unmuting
|
|
105
|
+
prevVolume = 0;
|
|
104
106
|
renderTimerId = null;
|
|
105
107
|
rendered = false;
|
|
106
108
|
settings = INITIAL_SETTINGS;
|
|
@@ -599,7 +601,13 @@ export class MediaControl extends UICorePlugin {
|
|
|
599
601
|
return volumeFromUI;
|
|
600
602
|
}
|
|
601
603
|
toggleMute() {
|
|
602
|
-
this.
|
|
604
|
+
const nextVolume = this.muted ? (this.prevVolume === 0 ? 100 : this.prevVolume) : 0;
|
|
605
|
+
if (this.muted) {
|
|
606
|
+
}
|
|
607
|
+
else {
|
|
608
|
+
this.prevVolume = this.volume;
|
|
609
|
+
}
|
|
610
|
+
this.setVolume(nextVolume);
|
|
603
611
|
}
|
|
604
612
|
/**
|
|
605
613
|
* Set the volume
|