@gcorevideo/player 2.22.20 → 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/level-selector/button.ejs +1 -1
- package/dist/core.js +1 -1
- package/dist/index.css +422 -422
- package/dist/index.js +225 -219
- package/dist/player.d.ts +25 -17
- package/dist/plugins/index.css +1346 -1346
- package/dist/plugins/index.js +63 -61
- package/docs/api/{player.bitratetrackrecord.md → player.clapprstatsbitratetrack.md} +3 -3
- package/docs/api/player.clapprstatsmetrics.md +2 -2
- package/docs/api/player.gearevents.md +1 -1
- package/docs/api/player.md +1 -1
- 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/lib/plugins/media-control/MediaControl.d.ts +3 -0
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +6 -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/package.json +1 -1
- package/src/plugins/level-selector/__tests__/__snapshots__/QualityLevels.test.ts.snap +1 -1
- package/src/plugins/media-control/MediaControl.ts +6 -1
- package/src/plugins/volume-fade/VolumeFade.ts +92 -75
- package/temp/player.api.json +32 -32
- package/tsconfig.tsbuildinfo +1 -1
package/dist/plugins/index.js
CHANGED
|
@@ -14476,6 +14476,10 @@ const LEFT_ORDER = [
|
|
|
14476
14476
|
'duration',
|
|
14477
14477
|
'dvr',
|
|
14478
14478
|
];
|
|
14479
|
+
var ExtendedEvents;
|
|
14480
|
+
(function (ExtendedEvents) {
|
|
14481
|
+
ExtendedEvents["MEDIACONTROL_VOLUME"] = "mediacontrol:volume";
|
|
14482
|
+
})(ExtendedEvents || (ExtendedEvents = {}));
|
|
14479
14483
|
const { Config, Fullscreen, formatTime: formatTime$1, extend, removeArrayItem } = Utils;
|
|
14480
14484
|
function orderByOrderPattern(arr, order) {
|
|
14481
14485
|
const arrWithoutDuplicates = [...new Set(arr)];
|
|
@@ -14953,14 +14957,15 @@ class MediaControl extends UICorePlugin {
|
|
|
14953
14957
|
// if the container is not ready etc
|
|
14954
14958
|
this.intendedVolume = value;
|
|
14955
14959
|
this.persistConfig && !isInitialVolume && Config.persist('volume', value);
|
|
14956
|
-
// TODO
|
|
14957
14960
|
const setWhenContainerReady = () => {
|
|
14958
14961
|
if (this.core.activeContainer && this.core.activeContainer.isReady) {
|
|
14959
14962
|
this.core.activeContainer.setVolume(value);
|
|
14963
|
+
this.trigger(ExtendedEvents.MEDIACONTROL_VOLUME, value);
|
|
14960
14964
|
}
|
|
14961
14965
|
else {
|
|
14962
14966
|
this.listenToOnce(this.core.activeContainer, Events.CONTAINER_READY, () => {
|
|
14963
14967
|
this.core.activeContainer.setVolume(value);
|
|
14968
|
+
this.trigger(ExtendedEvents.MEDIACONTROL_VOLUME, value);
|
|
14964
14969
|
});
|
|
14965
14970
|
}
|
|
14966
14971
|
};
|
|
@@ -16636,7 +16641,7 @@ class Poster extends UIContainerPlugin {
|
|
|
16636
16641
|
}
|
|
16637
16642
|
}
|
|
16638
16643
|
|
|
16639
|
-
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";
|
|
16644
|
+
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";
|
|
16640
16645
|
|
|
16641
16646
|
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";
|
|
16642
16647
|
|
|
@@ -18769,98 +18774,95 @@ var VolumeFadeEvents;
|
|
|
18769
18774
|
(function (VolumeFadeEvents) {
|
|
18770
18775
|
VolumeFadeEvents["FADE"] = "core:volume:fade";
|
|
18771
18776
|
})(VolumeFadeEvents || (VolumeFadeEvents = {}));
|
|
18777
|
+
const DEFAULT_DURATION = 600;
|
|
18772
18778
|
/**
|
|
18773
18779
|
* `PLUGIN` that applies fade effect to the player's volume change.
|
|
18774
18780
|
* @beta
|
|
18781
|
+
*
|
|
18782
|
+
* @remarks
|
|
18783
|
+
* Depends on {@link MediaControl} plugin.
|
|
18784
|
+
* Configuration options - {@link VolumeFadeSettings}
|
|
18775
18785
|
*/
|
|
18776
18786
|
class VolumeFade extends UICorePlugin {
|
|
18777
|
-
|
|
18778
|
-
|
|
18779
|
-
|
|
18780
|
-
interval = null;
|
|
18787
|
+
activeVolume = 0;
|
|
18788
|
+
duration = 0;
|
|
18789
|
+
timerId = null;
|
|
18781
18790
|
/**
|
|
18782
18791
|
* @internal
|
|
18783
18792
|
*/
|
|
18784
18793
|
get name() {
|
|
18785
18794
|
return 'volume_fade';
|
|
18786
18795
|
}
|
|
18796
|
+
constructor(core) {
|
|
18797
|
+
super(core);
|
|
18798
|
+
if (typeof this.options.volumeFade?.level === 'number') {
|
|
18799
|
+
this.activeVolume = this.options.volumeFade.level;
|
|
18800
|
+
}
|
|
18801
|
+
}
|
|
18787
18802
|
/**
|
|
18788
18803
|
* @internal
|
|
18789
18804
|
*/
|
|
18790
18805
|
bindEvents() {
|
|
18791
|
-
// TODO on container changed
|
|
18792
18806
|
this.listenTo(this.core, Events.CORE_READY, this.onCoreReady);
|
|
18793
|
-
if (this.core.mediaControl) {
|
|
18794
|
-
this.listenTo(this.core.mediaControl, 'mediacontrol:volume:user', this._onUserChangeVolume);
|
|
18795
|
-
}
|
|
18796
|
-
// this.listenTo(this.core, 'core:volume:config', this._onVolumeConfig);
|
|
18797
|
-
}
|
|
18798
|
-
unBindEvents() {
|
|
18799
|
-
this.core.$el.off('mouseleave.volume');
|
|
18800
|
-
this.core.$el.off('mouseenter.volume');
|
|
18801
|
-
}
|
|
18802
|
-
_onUserChangeVolume(volume) {
|
|
18803
|
-
this._aboveBorderVolume = volume;
|
|
18804
|
-
}
|
|
18805
|
-
_onVolumeConfig(value) {
|
|
18806
|
-
this._aboveBorderVolume = value;
|
|
18807
|
-
this.container?.setVolume(0);
|
|
18808
18807
|
}
|
|
18809
18808
|
onCoreReady() {
|
|
18810
|
-
this.
|
|
18811
|
-
|
|
18812
|
-
if (this.core && this.core.$el) {
|
|
18813
|
-
// TODO find out why options.playerElement instead of this.core.$el or this.container.$el
|
|
18814
|
-
$(this.options.playerElement).on('mouseenter.volume', () => {
|
|
18815
|
-
this.onEnter();
|
|
18816
|
-
});
|
|
18817
|
-
$(this.options.playerElement).on('mouseleave.volume', () => {
|
|
18818
|
-
this.onLeave();
|
|
18819
|
-
});
|
|
18820
|
-
}
|
|
18821
|
-
if (!this._aboveBorderVolume) {
|
|
18822
|
-
this._aboveBorderVolume = this.container?.volume && !isNaN(this.container.volume) ? this.container.volume : 80;
|
|
18823
|
-
}
|
|
18824
|
-
if (this.options.mute || Browser.isMobile) {
|
|
18809
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
18810
|
+
if (Browser.isMobile) {
|
|
18825
18811
|
this.destroy();
|
|
18826
18812
|
return;
|
|
18827
18813
|
}
|
|
18828
|
-
|
|
18829
|
-
|
|
18814
|
+
if (mediaControl) {
|
|
18815
|
+
this.listenTo(mediaControl, ExtendedEvents.MEDIACONTROL_VOLUME, this.onVolumeChange);
|
|
18816
|
+
}
|
|
18817
|
+
$(this.core.$el).on('mouseenter', () => this.onEnter());
|
|
18818
|
+
$(this.core.$el).on('mouseleave', () => this.onLeave());
|
|
18819
|
+
if (!this.activeVolume) {
|
|
18820
|
+
this.activeVolume =
|
|
18821
|
+
this.core.activeContainer?.volume &&
|
|
18822
|
+
!isNaN(this.core.activeContainer.volume)
|
|
18823
|
+
? this.core.activeContainer.volume
|
|
18824
|
+
: 80;
|
|
18825
|
+
}
|
|
18826
|
+
this.duration = this.options.volumeFade?.duration || DEFAULT_DURATION;
|
|
18827
|
+
// TODO check if mute must be respected
|
|
18828
|
+
this.core.activeContainer?.setVolume(this.activeVolume);
|
|
18829
|
+
this.core.activePlayback.volume(0);
|
|
18830
|
+
}
|
|
18831
|
+
onVolumeChange(volume) {
|
|
18832
|
+
this.activeVolume = volume;
|
|
18830
18833
|
}
|
|
18831
18834
|
onEnter() {
|
|
18832
|
-
this.
|
|
18835
|
+
this.fade(this.duration, 1);
|
|
18833
18836
|
}
|
|
18834
|
-
|
|
18835
|
-
this.
|
|
18837
|
+
onLeave() {
|
|
18838
|
+
this.fade(this.duration, 0);
|
|
18839
|
+
}
|
|
18840
|
+
fade(duration, to) {
|
|
18841
|
+
this.stopFade();
|
|
18836
18842
|
const start = new Date().getTime();
|
|
18837
|
-
|
|
18838
|
-
|
|
18839
|
-
|
|
18840
|
-
|
|
18841
|
-
|
|
18842
|
-
const
|
|
18843
|
+
const from = 1 - to;
|
|
18844
|
+
this.timerId = setInterval(() => {
|
|
18845
|
+
const delta = new Date().getTime() - start;
|
|
18846
|
+
const progress = Math.min(1, delta / duration);
|
|
18847
|
+
const normVol = progress * to + (1 - progress) * from;
|
|
18848
|
+
const volume = normVol * this.activeVolume;
|
|
18849
|
+
this.core.activePlayback.volume(volume);
|
|
18843
18850
|
try {
|
|
18844
|
-
this.
|
|
18845
|
-
this.core.trigger(VolumeFadeEvents.FADE, progress * this._aboveBorderVolume);
|
|
18851
|
+
this.core.trigger(VolumeFadeEvents.FADE, volume);
|
|
18846
18852
|
}
|
|
18847
18853
|
catch (error) {
|
|
18848
|
-
this.clearCurrentInterval();
|
|
18849
18854
|
}
|
|
18850
|
-
if (progress >= 1
|
|
18851
|
-
this.
|
|
18855
|
+
if (progress >= 1) {
|
|
18856
|
+
this.stopFade();
|
|
18852
18857
|
}
|
|
18853
18858
|
}, 10);
|
|
18854
18859
|
}
|
|
18855
|
-
|
|
18856
|
-
if (this.
|
|
18857
|
-
clearInterval(this.
|
|
18858
|
-
this.
|
|
18860
|
+
stopFade() {
|
|
18861
|
+
if (this.timerId !== null) {
|
|
18862
|
+
clearInterval(this.timerId);
|
|
18863
|
+
this.timerId = null;
|
|
18859
18864
|
}
|
|
18860
18865
|
}
|
|
18861
|
-
onLeave() {
|
|
18862
|
-
this.numberTo(this.delay, 1);
|
|
18863
|
-
}
|
|
18864
18866
|
}
|
|
18865
18867
|
|
|
18866
|
-
export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, NerdStats as ClapprNerdStats, ClapprStats, ClapprStatsChronograph, ClapprStatsCounter, ClapprStatsEvents, ClickToPause, Clips, ClosedCaptions, ContextMenu, DvrControls, ErrorScreen, Favicon, GearEvents, GoogleAnalytics, QualityLevels as LevelSelector, Logo, MediaControl, MultiCamera, NerdStats, PictureInPicture, PlaybackRate, Poster, QualityLevels, SeekTime, Share, SkipTime, SourceController, SpinnerThreeBounce as Spinner, SpinnerEvents, SpinnerThreeBounce, ClosedCaptions as Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents };
|
|
18868
|
+
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, Logo, MediaControl, MultiCamera, NerdStats, PictureInPicture, PlaybackRate, Poster, QualityLevels, SeekTime, Share, SkipTime, SourceController, SpinnerThreeBounce as Spinner, SpinnerEvents, SpinnerThreeBounce, ClosedCaptions as Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
2
|
|
|
3
|
-
[Home](./index.md) > [@gcorevideo/player](./player.md) > [
|
|
3
|
+
[Home](./index.md) > [@gcorevideo/player](./player.md) > [ClapprStatsBitrateTrack](./player.clapprstatsbitratetrack.md)
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## ClapprStatsBitrateTrack type
|
|
6
6
|
|
|
7
7
|
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
8
8
|
>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
**Signature:**
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
export type
|
|
14
|
+
export type ClapprStatsBitrateTrack = {
|
|
15
15
|
start: number;
|
|
16
16
|
end?: number;
|
|
17
17
|
time?: number;
|
|
@@ -35,7 +35,7 @@ export type ClapprStatsMetrics = {
|
|
|
35
35
|
extra: {
|
|
36
36
|
playbackName: string;
|
|
37
37
|
playbackType: string;
|
|
38
|
-
bitratesHistory:
|
|
38
|
+
bitratesHistory: ClapprStatsBitrateTrack[];
|
|
39
39
|
bitrateWeightedMean: number;
|
|
40
40
|
bitrateMostUsed: number;
|
|
41
41
|
buffersize: number;
|
|
@@ -48,5 +48,5 @@ export type ClapprStatsMetrics = {
|
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
```
|
|
51
|
-
**References:** [ClapprStatsCounter.Play](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.Pause](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.Error](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.Buffering](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.DecodedFrames](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.DroppedFrames](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.Fps](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.ChangeLevel](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.Seek](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.Fullscreen](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.DvrUsage](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsChronograph.Startup](./player.clapprstatschronograph.md)<!-- -->, [ClapprStatsChronograph.Watch](./player.clapprstatschronograph.md)<!-- -->, [ClapprStatsChronograph.Pause](./player.clapprstatschronograph.md)<!-- -->, [ClapprStatsChronograph.Buffering](./player.clapprstatschronograph.md)<!-- -->, [ClapprStatsChronograph.Session](./player.clapprstatschronograph.md)<!-- -->, [
|
|
51
|
+
**References:** [ClapprStatsCounter.Play](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.Pause](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.Error](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.Buffering](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.DecodedFrames](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.DroppedFrames](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.Fps](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.ChangeLevel](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.Seek](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.Fullscreen](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsCounter.DvrUsage](./player.clapprstatscounter.md)<!-- -->, [ClapprStatsChronograph.Startup](./player.clapprstatschronograph.md)<!-- -->, [ClapprStatsChronograph.Watch](./player.clapprstatschronograph.md)<!-- -->, [ClapprStatsChronograph.Pause](./player.clapprstatschronograph.md)<!-- -->, [ClapprStatsChronograph.Buffering](./player.clapprstatschronograph.md)<!-- -->, [ClapprStatsChronograph.Session](./player.clapprstatschronograph.md)<!-- -->, [ClapprStatsBitrateTrack](./player.clapprstatsbitratetrack.md)
|
|
52
52
|
|
package/docs/api/player.md
CHANGED
|
@@ -7,11 +7,6 @@
|
|
|
7
7
|
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
8
8
|
>
|
|
9
9
|
|
|
10
|
-
> Warning: This API is now obsolete.
|
|
11
|
-
>
|
|
12
|
-
> Use [MediaControl.putElement()](./player.mediacontrol.putelement.md) instead
|
|
13
|
-
>
|
|
14
|
-
|
|
15
10
|
Get a media control element DOM node
|
|
16
11
|
|
|
17
12
|
**Signature:**
|
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
8
8
|
>
|
|
9
9
|
|
|
10
|
+
> Warning: This API is now obsolete.
|
|
11
|
+
>
|
|
12
|
+
> Use [MediaControl.mount()](./player.mediacontrol.mount.md) instead
|
|
13
|
+
>
|
|
14
|
+
|
|
10
15
|
**Signature:**
|
|
11
16
|
|
|
12
17
|
```typescript
|
|
@@ -32,6 +32,9 @@ export type MediaControlSettings = {
|
|
|
32
32
|
default: MediaControlLayerElement[];
|
|
33
33
|
seekEnabled: boolean;
|
|
34
34
|
};
|
|
35
|
+
export declare enum ExtendedEvents {
|
|
36
|
+
MEDIACONTROL_VOLUME = "mediacontrol:volume"
|
|
37
|
+
}
|
|
35
38
|
/**
|
|
36
39
|
* `PLUGIN` that provides basic playback controls UI and a foundation for developing custom UI.
|
|
37
40
|
* @beta
|
|
@@ -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;AAI5C,OAAO,kDAAkD,CAAA;AAWzD;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAC/B,UAAU,GACV,UAAU,GACV,KAAK,GACL,WAAW,GACX,UAAU,GACV,UAAU,GACV,QAAQ,GACR,OAAO,CAAA;AAEX;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,kBAAkB,CAAA;AAErE;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAChC,aAAa,GACb,IAAI,GACJ,YAAY,GACZ,cAAc,GACd,MAAM,GACN,aAAa,GACb,KAAK,GACL,IAAI,CAAA;AAER;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B,uBAAuB,GACvB,wBAAwB,GACxB,wBAAwB,CAAA;AAY5B;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,uBAAuB,EAAE,CAAA;IAC/B,KAAK,EAAE,wBAAwB,EAAE,CAAA;IACjC,OAAO,EAAE,wBAAwB,EAAE,CAAA;IACnC,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA;
|
|
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;AAI5C,OAAO,kDAAkD,CAAA;AAWzD;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAC/B,UAAU,GACV,UAAU,GACV,KAAK,GACL,WAAW,GACX,UAAU,GACV,UAAU,GACV,QAAQ,GACR,OAAO,CAAA;AAEX;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,kBAAkB,CAAA;AAErE;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAChC,aAAa,GACb,IAAI,GACJ,YAAY,GACZ,cAAc,GACd,MAAM,GACN,aAAa,GACb,KAAK,GACL,IAAI,CAAA;AAER;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B,uBAAuB,GACvB,wBAAwB,GACxB,wBAAwB,CAAA;AAY5B;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,uBAAuB,EAAE,CAAA;IAC/B,KAAK,EAAE,wBAAwB,EAAE,CAAA;IACjC,OAAO,EAAE,wBAAwB,EAAE,CAAA;IACnC,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA;AAmCD,oBAAY,cAAc;IACxB,mBAAmB,wBAAwB;CAC5C;AAkBD;;;;;;;;;;;;;GAaG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAG5C,OAAO,CAAC,YAAY,CAAsB;IAE1C,OAAO,C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OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,SAAS;IAIjB;;OAEG;IACM,MAAM;IA6Ef,OAAO,CAAC,qBAAqB;IAiB7B,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,MAAM,CAAC,QAAQ;IAIvB,OAAO,CAAC,MAAM,CAAC,QAAQ;IAcvB;;OAEG;IACH,mBAAmB;IAMnB;;OAEG;IACH,qBAAqB;IAOrB,OAAO,CAAC,6BAA6B;IAQrC,OAAO,CAAC,kBAAkB;IAmB1B,OAAO,CAAC,iBAAiB;CAO1B"}
|
|
@@ -58,6 +58,10 @@ const LEFT_ORDER = [
|
|
|
58
58
|
'duration',
|
|
59
59
|
'dvr',
|
|
60
60
|
];
|
|
61
|
+
export var ExtendedEvents;
|
|
62
|
+
(function (ExtendedEvents) {
|
|
63
|
+
ExtendedEvents["MEDIACONTROL_VOLUME"] = "mediacontrol:volume";
|
|
64
|
+
})(ExtendedEvents || (ExtendedEvents = {}));
|
|
61
65
|
const { Config, Fullscreen, formatTime, extend, removeArrayItem } = Utils;
|
|
62
66
|
function orderByOrderPattern(arr, order) {
|
|
63
67
|
const arrWithoutDuplicates = [...new Set(arr)];
|
|
@@ -538,14 +542,15 @@ export class MediaControl extends UICorePlugin {
|
|
|
538
542
|
// if the container is not ready etc
|
|
539
543
|
this.intendedVolume = value;
|
|
540
544
|
this.persistConfig && !isInitialVolume && Config.persist('volume', value);
|
|
541
|
-
// TODO
|
|
542
545
|
const setWhenContainerReady = () => {
|
|
543
546
|
if (this.core.activeContainer && this.core.activeContainer.isReady) {
|
|
544
547
|
this.core.activeContainer.setVolume(value);
|
|
548
|
+
this.trigger(ExtendedEvents.MEDIACONTROL_VOLUME, value);
|
|
545
549
|
}
|
|
546
550
|
else {
|
|
547
551
|
this.listenToOnce(this.core.activeContainer, Events.CONTAINER_READY, () => {
|
|
548
552
|
this.core.activeContainer.setVolume(value);
|
|
553
|
+
this.trigger(ExtendedEvents.MEDIACONTROL_VOLUME, value);
|
|
549
554
|
});
|
|
550
555
|
}
|
|
551
556
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UICorePlugin } from '@clappr/core';
|
|
1
|
+
import { UICorePlugin, Core } from '@clappr/core';
|
|
2
2
|
/**
|
|
3
3
|
* Events emitted by the VolumeFade plugin.
|
|
4
4
|
* @beta
|
|
@@ -6,30 +6,45 @@ import { UICorePlugin } from '@clappr/core';
|
|
|
6
6
|
export declare enum VolumeFadeEvents {
|
|
7
7
|
FADE = "core:volume:fade"
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* @beta
|
|
11
|
+
*/
|
|
12
|
+
export type VolumeFadeSettings = {
|
|
13
|
+
/**
|
|
14
|
+
* Initial active volume level, effective until volume is changed via media control
|
|
15
|
+
*/
|
|
16
|
+
level?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Fade duration, ms
|
|
19
|
+
*/
|
|
20
|
+
duration?: number;
|
|
21
|
+
};
|
|
9
22
|
/**
|
|
10
23
|
* `PLUGIN` that applies fade effect to the player's volume change.
|
|
11
24
|
* @beta
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* Depends on {@link MediaControl} plugin.
|
|
28
|
+
* Configuration options - {@link VolumeFadeSettings}
|
|
12
29
|
*/
|
|
13
30
|
export declare class VolumeFade extends UICorePlugin {
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
private interval;
|
|
31
|
+
private activeVolume;
|
|
32
|
+
private duration;
|
|
33
|
+
private timerId;
|
|
18
34
|
/**
|
|
19
35
|
* @internal
|
|
20
36
|
*/
|
|
21
37
|
get name(): string;
|
|
38
|
+
constructor(core: Core);
|
|
22
39
|
/**
|
|
23
40
|
* @internal
|
|
24
41
|
*/
|
|
25
42
|
bindEvents(): void;
|
|
26
|
-
private unBindEvents;
|
|
27
|
-
private _onUserChangeVolume;
|
|
28
|
-
private _onVolumeConfig;
|
|
29
43
|
private onCoreReady;
|
|
44
|
+
private onVolumeChange;
|
|
30
45
|
private onEnter;
|
|
31
|
-
private numberTo;
|
|
32
|
-
private clearCurrentInterval;
|
|
33
46
|
private onLeave;
|
|
47
|
+
private fade;
|
|
48
|
+
private stopFade;
|
|
34
49
|
}
|
|
35
50
|
//# sourceMappingURL=VolumeFade.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VolumeFade.d.ts","sourceRoot":"","sources":["../../../src/plugins/volume-fade/VolumeFade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"VolumeFade.d.ts","sourceRoot":"","sources":["../../../src/plugins/volume-fade/VolumeFade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,IAAI,EAAE,MAAM,cAAc,CAAA;AAMrE;;;GAGG;AACH,oBAAY,gBAAgB;IAC1B,IAAI,qBAAqB;CAC1B;AAMD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;;;;GAOG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CAAC,YAAY,CAAI;IAExB,OAAO,CAAC,QAAQ,CAAI;IAEpB,OAAO,CAAC,OAAO,CAAuB;IAEtC;;OAEG;IACH,IAAI,IAAI,WAEP;gBAEW,IAAI,EAAE,IAAI;IAOtB;;OAEG;IACM,UAAU;IAInB,OAAO,CAAC,WAAW;IA6BnB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,IAAI;IAqBZ,OAAO,CAAC,QAAQ;CAOjB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UICorePlugin, Events, Browser, $ } from '@clappr/core';
|
|
2
|
-
import { reportError } from '@gcorevideo/utils';
|
|
2
|
+
import { reportError, trace } from '@gcorevideo/utils';
|
|
3
|
+
import { ExtendedEvents } from '../media-control/MediaControl.js';
|
|
3
4
|
/**
|
|
4
5
|
* Events emitted by the VolumeFade plugin.
|
|
5
6
|
* @beta
|
|
@@ -8,98 +9,99 @@ export var VolumeFadeEvents;
|
|
|
8
9
|
(function (VolumeFadeEvents) {
|
|
9
10
|
VolumeFadeEvents["FADE"] = "core:volume:fade";
|
|
10
11
|
})(VolumeFadeEvents || (VolumeFadeEvents = {}));
|
|
12
|
+
const T = 'plugins.volume_fade';
|
|
13
|
+
const DEFAULT_DURATION = 600;
|
|
11
14
|
/**
|
|
12
15
|
* `PLUGIN` that applies fade effect to the player's volume change.
|
|
13
16
|
* @beta
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Depends on {@link MediaControl} plugin.
|
|
20
|
+
* Configuration options - {@link VolumeFadeSettings}
|
|
14
21
|
*/
|
|
15
22
|
export class VolumeFade extends UICorePlugin {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
interval = null;
|
|
23
|
+
activeVolume = 0;
|
|
24
|
+
duration = 0;
|
|
25
|
+
timerId = null;
|
|
20
26
|
/**
|
|
21
27
|
* @internal
|
|
22
28
|
*/
|
|
23
29
|
get name() {
|
|
24
30
|
return 'volume_fade';
|
|
25
31
|
}
|
|
32
|
+
constructor(core) {
|
|
33
|
+
super(core);
|
|
34
|
+
if (typeof this.options.volumeFade?.level === 'number') {
|
|
35
|
+
this.activeVolume = this.options.volumeFade.level;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
26
38
|
/**
|
|
27
39
|
* @internal
|
|
28
40
|
*/
|
|
29
41
|
bindEvents() {
|
|
30
|
-
// TODO on container changed
|
|
31
42
|
this.listenTo(this.core, Events.CORE_READY, this.onCoreReady);
|
|
32
|
-
if (this.core.mediaControl) {
|
|
33
|
-
this.listenTo(this.core.mediaControl, 'mediacontrol:volume:user', this._onUserChangeVolume);
|
|
34
|
-
}
|
|
35
|
-
// this.listenTo(this.core, 'core:volume:config', this._onVolumeConfig);
|
|
36
|
-
}
|
|
37
|
-
unBindEvents() {
|
|
38
|
-
this.core.$el.off('mouseleave.volume');
|
|
39
|
-
this.core.$el.off('mouseenter.volume');
|
|
40
|
-
}
|
|
41
|
-
_onUserChangeVolume(volume) {
|
|
42
|
-
this._aboveBorderVolume = volume;
|
|
43
|
-
}
|
|
44
|
-
_onVolumeConfig(value) {
|
|
45
|
-
this._aboveBorderVolume = value;
|
|
46
|
-
this.container?.setVolume(0);
|
|
47
43
|
}
|
|
48
44
|
onCoreReady() {
|
|
49
|
-
this.
|
|
50
|
-
|
|
51
|
-
if (this.core && this.core.$el) {
|
|
52
|
-
// TODO find out why options.playerElement instead of this.core.$el or this.container.$el
|
|
53
|
-
$(this.options.playerElement).on('mouseenter.volume', () => {
|
|
54
|
-
this.onEnter();
|
|
55
|
-
});
|
|
56
|
-
$(this.options.playerElement).on('mouseleave.volume', () => {
|
|
57
|
-
this.onLeave();
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
if (!this._aboveBorderVolume) {
|
|
61
|
-
this._aboveBorderVolume = this.container?.volume && !isNaN(this.container.volume) ? this.container.volume : 80;
|
|
62
|
-
}
|
|
63
|
-
if (this.options.mute || Browser.isMobile) {
|
|
45
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
46
|
+
if (Browser.isMobile) {
|
|
64
47
|
this.destroy();
|
|
65
48
|
return;
|
|
66
49
|
}
|
|
67
|
-
|
|
68
|
-
|
|
50
|
+
if (mediaControl) {
|
|
51
|
+
this.listenTo(mediaControl, ExtendedEvents.MEDIACONTROL_VOLUME, this.onVolumeChange);
|
|
52
|
+
}
|
|
53
|
+
$(this.core.$el).on('mouseenter', () => this.onEnter());
|
|
54
|
+
$(this.core.$el).on('mouseleave', () => this.onLeave());
|
|
55
|
+
if (!this.activeVolume) {
|
|
56
|
+
this.activeVolume =
|
|
57
|
+
this.core.activeContainer?.volume &&
|
|
58
|
+
!isNaN(this.core.activeContainer.volume)
|
|
59
|
+
? this.core.activeContainer.volume
|
|
60
|
+
: 80;
|
|
61
|
+
}
|
|
62
|
+
this.duration = this.options.volumeFade?.duration || DEFAULT_DURATION;
|
|
63
|
+
// TODO check if mute must be respected
|
|
64
|
+
this.core.activeContainer?.setVolume(this.activeVolume);
|
|
65
|
+
this.core.activePlayback.volume(0);
|
|
66
|
+
}
|
|
67
|
+
onVolumeChange(volume) {
|
|
68
|
+
trace(`${T} onVolumeChange`, { volume });
|
|
69
|
+
this.activeVolume = volume;
|
|
69
70
|
}
|
|
70
71
|
onEnter() {
|
|
71
|
-
|
|
72
|
+
trace(`${T} onEnter`);
|
|
73
|
+
this.fade(this.duration, 1);
|
|
74
|
+
}
|
|
75
|
+
onLeave() {
|
|
76
|
+
trace(`${T} onLeave`);
|
|
77
|
+
this.fade(this.duration, 0);
|
|
72
78
|
}
|
|
73
|
-
|
|
74
|
-
this.
|
|
79
|
+
fade(duration, to) {
|
|
80
|
+
this.stopFade();
|
|
75
81
|
const start = new Date().getTime();
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
+
const from = 1 - to;
|
|
83
|
+
this.timerId = setInterval(() => {
|
|
84
|
+
const delta = new Date().getTime() - start;
|
|
85
|
+
const progress = Math.min(1, delta / duration);
|
|
86
|
+
const normVol = progress * to + (1 - progress) * from;
|
|
87
|
+
const volume = normVol * this.activeVolume;
|
|
88
|
+
this.core.activePlayback.volume(volume);
|
|
82
89
|
try {
|
|
83
|
-
this.
|
|
84
|
-
this.core.trigger(VolumeFadeEvents.FADE, progress * this._aboveBorderVolume);
|
|
90
|
+
this.core.trigger(VolumeFadeEvents.FADE, volume);
|
|
85
91
|
}
|
|
86
92
|
catch (error) {
|
|
87
|
-
// LogManager.exception(error);
|
|
88
93
|
reportError(error);
|
|
89
|
-
this.clearCurrentInterval();
|
|
90
94
|
}
|
|
91
|
-
if (progress >= 1
|
|
92
|
-
this.
|
|
95
|
+
if (progress >= 1) {
|
|
96
|
+
this.stopFade();
|
|
93
97
|
}
|
|
94
98
|
}, 10);
|
|
95
99
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
this.
|
|
100
|
+
stopFade() {
|
|
101
|
+
trace(`${T} stopFade`);
|
|
102
|
+
if (this.timerId !== null) {
|
|
103
|
+
clearInterval(this.timerId);
|
|
104
|
+
this.timerId = null;
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
|
-
onLeave() {
|
|
103
|
-
this.numberTo(this.delay, 1);
|
|
104
|
-
}
|
|
105
107
|
}
|
package/package.json
CHANGED
|
@@ -154,7 +154,7 @@ exports[`QualityLevels > options.restrictResolution > given vertical video forma
|
|
|
154
154
|
`;
|
|
155
155
|
|
|
156
156
|
exports[`QualityLevels > options.restrictResolution > initially > should render the restricted quality level label 1`] = `
|
|
157
|
-
"<button class="gplayer-lite-btn gcore-skin-text-color gear-option" aria-haspopup="menu">
|
|
157
|
+
"<button class="gplayer-lite-btn gcore-skin-text-color gear-option" aria-haspopup="menu" id="quality-levels">
|
|
158
158
|
<span class="gear-option_icon hidden">/assets/icons/new/hd.svg</span>
|
|
159
159
|
<span class="gear-option_label">quality</span>
|
|
160
160
|
<span class="gear-option_value">360p</span>
|
|
@@ -136,6 +136,10 @@ const LEFT_ORDER = [
|
|
|
136
136
|
'dvr',
|
|
137
137
|
]
|
|
138
138
|
|
|
139
|
+
export enum ExtendedEvents {
|
|
140
|
+
MEDIACONTROL_VOLUME = 'mediacontrol:volume',
|
|
141
|
+
}
|
|
142
|
+
|
|
139
143
|
const { Config, Fullscreen, formatTime, extend, removeArrayItem } = Utils
|
|
140
144
|
|
|
141
145
|
function orderByOrderPattern(arr: string[], order: string[]): string[] {
|
|
@@ -793,16 +797,17 @@ export class MediaControl extends UICorePlugin {
|
|
|
793
797
|
// if the container is not ready etc
|
|
794
798
|
this.intendedVolume = value
|
|
795
799
|
this.persistConfig && !isInitialVolume && Config.persist('volume', value)
|
|
796
|
-
// TODO
|
|
797
800
|
const setWhenContainerReady = () => {
|
|
798
801
|
if (this.core.activeContainer && this.core.activeContainer.isReady) {
|
|
799
802
|
this.core.activeContainer.setVolume(value)
|
|
803
|
+
this.trigger(ExtendedEvents.MEDIACONTROL_VOLUME, value)
|
|
800
804
|
} else {
|
|
801
805
|
this.listenToOnce(
|
|
802
806
|
this.core.activeContainer,
|
|
803
807
|
Events.CONTAINER_READY,
|
|
804
808
|
() => {
|
|
805
809
|
this.core.activeContainer.setVolume(value)
|
|
810
|
+
this.trigger(ExtendedEvents.MEDIACONTROL_VOLUME, value)
|
|
806
811
|
},
|
|
807
812
|
)
|
|
808
813
|
}
|