@gcorevideo/player 2.20.7 → 2.20.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +54 -25
- package/dist/index.css +1184 -1184
- package/dist/index.js +298 -267
- package/dist/player.d.ts +178 -126
- package/dist/plugins/index.css +841 -841
- package/dist/plugins/index.js +192 -192
- package/docs/api/player.bottomgear.md +14 -0
- package/docs/api/player.bottomgear.refresh.md +20 -0
- package/docs/api/player.clapprnerdstats.md +1 -1
- package/docs/api/player.clapprstats.exportmetrics.md +1 -1
- package/docs/api/player.clapprstats.md +1 -15
- package/docs/api/player.clapprstats.setupdatemetrics.md +2 -0
- package/docs/api/player.clipsplugin.md +1 -1
- package/docs/api/player.clipspluginsettings.md +5 -2
- package/docs/api/player.clipspluginsettings.text.md +3 -0
- package/docs/api/{player.errorscreen.bindevents.md → player.containerpluginconstructor.md} +7 -6
- package/docs/api/{player.errorscreen.render.md → player.corepluginconstructor.md} +7 -6
- package/docs/api/player.errordesc.md +28 -0
- package/docs/api/player.errorscreen.md +1 -220
- package/docs/api/{player.errorscreen.hide.md → player.errorscreenpluginsettings.md} +7 -7
- package/docs/api/player.levelselector.md +3 -9
- package/docs/api/player.levelselectorpluginsettings.labels.md +24 -0
- package/docs/api/player.levelselectorpluginsettings.md +79 -0
- package/docs/api/player.levelselectorpluginsettings.restrictresolution.md +16 -0
- package/docs/api/player.md +93 -16
- package/docs/api/{player.errorscreen.container.md → player.mediacontrol.currentseekpos.md} +3 -3
- package/docs/api/player.mediacontrol.disable.md +1 -1
- package/docs/api/player.mediacontrol.md +23 -2
- package/docs/api/{player.gearevents.md → player.mediacontrolevents.md} +4 -4
- package/docs/api/player.multicamera.md +1 -29
- package/docs/api/player.playbackerror.md +19 -0
- package/docs/api/{player.errorscreen.supportedversion.md → player.playbackerror.ui.md} +7 -4
- package/docs/api/player.playbackerrorcode.md +3 -3
- package/docs/api/{player.errorscreen.show.md → player.playbackrate._constructor_.md} +7 -11
- package/docs/api/player.playbackrate.md +35 -2
- package/docs/api/player.player.registerplugin.md +2 -2
- package/docs/api/player.player.unregisterplugin.md +2 -2
- package/docs/api/player.playerpluginconstructor.md +17 -0
- package/docs/api/player.share.attributes.md +3 -0
- package/docs/api/player.share.bindevents.md +3 -0
- package/docs/api/player.share.canshowshare.md +3 -0
- package/docs/api/player.share.events.md +3 -0
- package/docs/api/player.share.hideshare.md +3 -0
- package/docs/api/player.share.initializeicons.md +3 -0
- package/docs/api/player.share.md +40 -1
- package/docs/api/player.share.name.md +3 -0
- package/docs/api/player.share.onshareembedclick.md +3 -0
- package/docs/api/player.share.onsharefb.md +3 -0
- package/docs/api/player.share.onsharehide.md +3 -0
- package/docs/api/player.share.onsharelinkclick.md +3 -0
- package/docs/api/player.share.onshareshow.md +3 -0
- package/docs/api/player.share.onsharetw.md +3 -0
- package/docs/api/player.share.render.md +3 -0
- package/docs/api/player.share.showshare.md +3 -0
- package/docs/api/player.share.supportedversion.md +3 -0
- package/docs/api/player.share.template.md +3 -0
- package/docs/api/player.share.unbindevents.md +3 -0
- package/docs/api/player.skiptime.attributes.md +3 -0
- package/docs/api/player.skiptime.bindevents.md +3 -0
- package/docs/api/player.skiptime.container.md +3 -0
- package/docs/api/player.skiptime.events.md +3 -0
- package/docs/api/player.skiptime.handlerewindclicks.md +3 -0
- package/docs/api/player.skiptime.md +30 -1
- package/docs/api/player.skiptime.name.md +3 -0
- package/docs/api/player.skiptime.render.md +3 -0
- package/docs/api/player.skiptime.setback.md +3 -0
- package/docs/api/player.skiptime.setforward.md +3 -0
- package/docs/api/player.skiptime.setmidclick.md +3 -0
- package/docs/api/player.skiptime.supportedversion.md +3 -0
- package/docs/api/player.skiptime.template.md +3 -0
- package/docs/api/player.skiptime.togglefullscreen.md +3 -0
- package/docs/api/player.spinnerevents.md +4 -1
- package/docs/api/player.spinnerthreebounce.hide.md +1 -1
- package/docs/api/player.spinnerthreebounce.md +7 -5
- package/docs/api/player.spinnerthreebounce.show.md +40 -2
- package/docs/api/player.telemetry.md +1 -1
- package/docs/api/player.telemetrypluginsettings.md +1 -1
- package/docs/api/{player.errorscreen.unbindevents.md → player.telemetrysendfn.md} +6 -6
- package/lib/Player.d.ts +13 -4
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +17 -12
- package/lib/index.core.d.ts +0 -1
- package/lib/index.core.d.ts.map +1 -1
- package/lib/index.core.js +0 -1
- package/lib/index.plugins.d.ts +0 -1
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +0 -1
- package/lib/playback/BasePlayback.d.ts +5 -0
- package/lib/playback/BasePlayback.d.ts.map +1 -1
- package/lib/playback/BasePlayback.js +8 -0
- package/lib/playback/HTML5Video.d.ts +4 -0
- package/lib/playback/HTML5Video.d.ts.map +1 -0
- package/lib/playback/HTML5Video.js +3 -0
- package/lib/playback/dash-playback/DashPlayback.d.ts +1 -0
- package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
- package/lib/playback/dash-playback/DashPlayback.js +6 -2
- package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
- package/lib/playback/hls-playback/HlsPlayback.js +1 -1
- package/lib/playback/index.d.ts.map +1 -1
- package/lib/playback/index.js +2 -0
- package/lib/playback/types.d.ts +9 -0
- package/lib/playback/types.d.ts.map +1 -0
- package/lib/playback/types.js +9 -0
- package/lib/plugins/bottom-gear/BottomGear.d.ts +7 -12
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +5 -14
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +1 -1
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +3 -3
- package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.d.ts.map +1 -1
- package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.js +8 -8
- package/lib/plugins/clappr-stats/ClapprStats.d.ts +4 -5
- package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
- package/lib/plugins/clappr-stats/ClapprStats.js +4 -3
- package/lib/plugins/clips/Clips.d.ts +3 -2
- package/lib/plugins/clips/Clips.d.ts.map +1 -1
- package/lib/plugins/clips/Clips.js +1 -1
- package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.d.ts +4 -3
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.js +30 -18
- package/lib/plugins/error-screen/ErrorScreen.d.ts +12 -1
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
- package/lib/plugins/error-screen/ErrorScreen.js +1 -1
- package/lib/plugins/index.d.ts +0 -1
- package/lib/plugins/index.d.ts.map +1 -1
- package/lib/plugins/index.js +0 -1
- package/lib/plugins/kibo/index.d.ts +0 -3
- package/lib/plugins/kibo/index.d.ts.map +1 -1
- package/lib/plugins/kibo/index.js +0 -3
- package/lib/plugins/level-selector/LevelSelector.d.ts +8 -4
- package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
- package/lib/plugins/level-selector/LevelSelector.js +16 -7
- package/lib/plugins/media-control/MediaControl.d.ts +5 -4
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +8 -6
- package/lib/plugins/multi-camera/MultiCamera.d.ts +3 -11
- package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
- package/lib/plugins/multi-camera/MultiCamera.js +1 -1
- package/lib/plugins/playback-rate/PlaybackRate.d.ts +11 -10
- package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
- package/lib/plugins/playback-rate/PlaybackRate.js +83 -91
- package/lib/plugins/poster/Poster.js +2 -2
- package/lib/plugins/share/Share.d.ts +2 -1
- package/lib/plugins/share/Share.d.ts.map +1 -1
- package/lib/plugins/share/Share.js +2 -1
- package/lib/plugins/skip-time/SkipTime.d.ts +2 -1
- package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -1
- package/lib/plugins/skip-time/SkipTime.js +2 -1
- package/lib/plugins/source-controller/SourceController.js +3 -3
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +6 -3
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +6 -3
- package/lib/plugins/telemetry/Telemetry.d.ts +2 -3
- package/lib/plugins/telemetry/Telemetry.d.ts.map +1 -1
- package/lib/plugins/telemetry/Telemetry.js +1 -1
- package/lib/plugins/vast-ads/VastAds.d.ts.map +1 -1
- package/lib/plugins/vast-ads/VastAds.js +3 -3
- package/lib/plugins/vast-ads/roll.d.ts +1 -1
- package/lib/plugins/vast-ads/roll.d.ts.map +1 -1
- package/lib/plugins/vast-ads/rollmanager.d.ts +1 -1
- package/lib/plugins/vast-ads/rollmanager.d.ts.map +1 -1
- package/lib/plugins/vast-ads/rollmanager.js +2 -2
- package/lib/types.d.ts +21 -5
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/types.d.ts +0 -6
- package/lib/utils/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Player.ts +18 -16
- package/src/index.core.ts +0 -1
- package/src/index.plugins.ts +0 -1
- package/src/playback/BasePlayback.ts +12 -4
- package/src/playback/HTML5Video.ts +3 -0
- package/src/playback/dash-playback/DashPlayback.ts +15 -11
- package/src/playback/hls-playback/HlsPlayback.ts +7 -11
- package/src/playback/index.ts +2 -1
- package/src/playback/types.ts +9 -0
- package/src/plugins/audio-selector/AudioSelector.ts +1 -1
- package/src/plugins/big-mute-button/BigMuteButton.ts +1 -1
- package/src/plugins/bottom-gear/BottomGear.ts +7 -16
- package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +5 -5
- package/src/plugins/clappr-nerd-stats/speedtest/Speedtest.ts +184 -187
- package/src/plugins/clappr-stats/ClapprStats.ts +5 -4
- package/src/plugins/clips/Clips.ts +4 -3
- package/src/plugins/context-menu/ContextMenu.ts +0 -2
- package/src/plugins/dvr-controls/DvrControls.ts +90 -56
- package/src/plugins/error-screen/ErrorScreen.ts +12 -1
- package/src/plugins/favicon/Favicon.ts +1 -1
- package/src/plugins/index.ts +0 -1
- package/src/plugins/kibo/index.ts +0 -3
- package/src/plugins/level-selector/LevelSelector.ts +24 -10
- package/src/plugins/logo/Logo.ts +1 -1
- package/src/plugins/media-control/MediaControl.ts +13 -10
- package/src/plugins/multi-camera/MultiCamera.ts +4 -4
- package/src/plugins/playback-rate/PlaybackRate.ts +90 -106
- package/src/plugins/poster/Poster.ts +3 -3
- package/src/plugins/seek-time/SeekTime.ts +1 -1
- package/src/plugins/share/Share.ts +2 -1
- package/src/plugins/skip-time/SkipTime.ts +2 -1
- package/src/plugins/source-controller/SourceController.ts +3 -3
- package/src/plugins/source-controller/__tests__/SourceController.test.ts +2 -2
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +6 -3
- package/src/plugins/subtitles/Subtitles.ts +1 -1
- package/src/plugins/telemetry/Telemetry.ts +2 -2
- package/src/plugins/thumbnails/Thumbnails.ts +1 -1
- package/src/plugins/vast-ads/VastAds.ts +5 -4
- package/src/plugins/vast-ads/roll.ts +2 -1
- package/src/plugins/vast-ads/rollmanager.ts +3 -3
- package/src/types.ts +24 -5
- package/src/utils/types.ts +0 -8
- package/temp/player.api.json +540 -576
- package/tsconfig.tsbuildinfo +1 -1
- package/assets/playback-rate/playback-rate-selector.ejs +0 -9
- package/docs/api/player.clapprstats.onbitrate.md +0 -52
- package/docs/api/player.errorscreen.attributes.md +0 -17
- package/docs/api/player.errorscreen.name.md +0 -14
- package/docs/api/player.errorscreen.template.md +0 -14
- package/docs/api/player.multicamera.getcameraslist.md +0 -18
- package/docs/api/player.multicamera.getcurrentcamera.md +0 -18
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UICorePlugin } from '@clappr/core';
|
|
1
|
+
import { UICorePlugin, Core } from '@clappr/core';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* PLUGIN that allows changing the playback speed of the video.
|
|
4
4
|
* @beta
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
@@ -10,12 +10,12 @@ import { UICorePlugin } from '@clappr/core';
|
|
|
10
10
|
*
|
|
11
11
|
* - {@link BottomGear | bottom_gear}
|
|
12
12
|
*
|
|
13
|
-
* It renders a button in the gear menu, which opens a dropdown with the
|
|
13
|
+
* It renders a button in the gear menu, which opens a dropdown with the options to change the playback rate.
|
|
14
14
|
*/
|
|
15
15
|
export declare class PlaybackRate extends UICorePlugin {
|
|
16
|
-
private currentPlayback;
|
|
17
16
|
private playbackRates;
|
|
18
17
|
private prevSelectedRate;
|
|
18
|
+
private rendered;
|
|
19
19
|
private selectedRate;
|
|
20
20
|
/**
|
|
21
21
|
* @internal
|
|
@@ -27,9 +27,9 @@ export declare class PlaybackRate extends UICorePlugin {
|
|
|
27
27
|
get supportedVersion(): {
|
|
28
28
|
min: string;
|
|
29
29
|
};
|
|
30
|
-
private static readonly template;
|
|
31
30
|
private static readonly buttonTemplate;
|
|
32
31
|
private static readonly listTemplate;
|
|
32
|
+
constructor(core: Core);
|
|
33
33
|
/**
|
|
34
34
|
* @internal
|
|
35
35
|
*/
|
|
@@ -49,12 +49,13 @@ export declare class PlaybackRate extends UICorePlugin {
|
|
|
49
49
|
* @internal
|
|
50
50
|
*/
|
|
51
51
|
bindEvents(): void;
|
|
52
|
-
private
|
|
52
|
+
private onCoreReady;
|
|
53
|
+
private onActiveContainerChange;
|
|
54
|
+
private onGearRendered;
|
|
55
|
+
private onDvrStateChanged;
|
|
53
56
|
private allRateElements;
|
|
54
57
|
private rateElement;
|
|
55
|
-
private
|
|
56
|
-
private updateLiveStatus;
|
|
57
|
-
private reload;
|
|
58
|
+
private onPlaybackRateChange;
|
|
58
59
|
private shouldRender;
|
|
59
60
|
/**
|
|
60
61
|
* @internal
|
|
@@ -63,11 +64,11 @@ export declare class PlaybackRate extends UICorePlugin {
|
|
|
63
64
|
private onStartAd;
|
|
64
65
|
private onFinishAd;
|
|
65
66
|
private onPlay;
|
|
67
|
+
private resetPlaybackRate;
|
|
66
68
|
private onStop;
|
|
67
69
|
private onRateSelect;
|
|
68
70
|
private onShowMenu;
|
|
69
71
|
private goBack;
|
|
70
|
-
private updatePlaybackRate;
|
|
71
72
|
private setSelectedRate;
|
|
72
73
|
private getTitle;
|
|
73
74
|
private highlightCurrentRate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaybackRate.d.ts","sourceRoot":"","sources":["../../../src/plugins/playback-rate/PlaybackRate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAsB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"PlaybackRate.d.ts","sourceRoot":"","sources":["../../../src/plugins/playback-rate/PlaybackRate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAsB,IAAI,EAAE,MAAM,cAAc,CAAC;AAoC9E;;;;;;;;;;;;GAYG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,CAAC,aAAa,CAAgD;IAGrE,OAAO,CAAC,gBAAgB,CAAqB;IAE7C,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,YAAY,CAAiC;IAErD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAwB;IAE9D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAsB;gBAE9C,IAAI,EAAE,IAAI;IAMtB;;OAEG;IACH,IAAa,UAAU;;;MAKtB;IAED;;OAEG;IACH,IAAa,MAAM;;;;MAMlB;IAED;;OAEG;IACM,UAAU;IAKnB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,uBAAuB;IAO/B,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,YAAY;IAYpB;;OAEG;IACM,MAAM;IA6Bf,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,MAAM;IAGd,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,oBAAoB;CAS7B"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Events, UICorePlugin, Playback, template } from '@clappr/core';
|
|
2
|
+
import { trace } from '@gcorevideo/utils';
|
|
3
|
+
import assert from 'assert';
|
|
2
4
|
import { CLAPPR_VERSION } from '../../build.js';
|
|
3
|
-
import pluginHtml from '../../../assets/playback-rate/playback-rate-selector.ejs';
|
|
4
5
|
import buttonHtml from '../../../assets/playback-rate/button.ejs';
|
|
5
6
|
import listHtml from '../../../assets/playback-rate/list.ejs';
|
|
6
7
|
import speedIcon from '../../../assets/icons/new/speed.svg';
|
|
7
8
|
import arrowRightIcon from '../../../assets/icons/new/arrow-right.svg';
|
|
8
9
|
import arrowLeftIcon from '../../../assets/icons/new/arrow-left.svg';
|
|
9
10
|
import checkIcon from '../../../assets/icons/new/check.svg';
|
|
11
|
+
import { PlaybackEvents } from '../../playback/types.js';
|
|
12
|
+
import { MediaControlEvents } from '../media-control/MediaControl.js';
|
|
10
13
|
const DEFAULT_PLAYBACK_RATES = [
|
|
11
14
|
{ value: '0.5', label: '0.5x' },
|
|
12
15
|
{ value: '0.75', label: '0.75x' },
|
|
@@ -17,10 +20,9 @@ const DEFAULT_PLAYBACK_RATES = [
|
|
|
17
20
|
{ value: '2.0', label: '2x' }
|
|
18
21
|
];
|
|
19
22
|
const DEFAULT_PLAYBACK_RATE = '1.0';
|
|
20
|
-
|
|
21
|
-
const MEDIACONTROL_PLAYBACKRATE = 'playbackRate';
|
|
23
|
+
const T = 'plugins.playback_rate';
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
25
|
+
* PLUGIN that allows changing the playback speed of the video.
|
|
24
26
|
* @beta
|
|
25
27
|
*
|
|
26
28
|
* @remarks
|
|
@@ -30,12 +32,13 @@ const MEDIACONTROL_PLAYBACKRATE = 'playbackRate';
|
|
|
30
32
|
*
|
|
31
33
|
* - {@link BottomGear | bottom_gear}
|
|
32
34
|
*
|
|
33
|
-
* It renders a button in the gear menu, which opens a dropdown with the
|
|
35
|
+
* It renders a button in the gear menu, which opens a dropdown with the options to change the playback rate.
|
|
34
36
|
*/
|
|
35
37
|
export class PlaybackRate extends UICorePlugin {
|
|
36
|
-
currentPlayback = null;
|
|
37
38
|
playbackRates = DEFAULT_PLAYBACK_RATES;
|
|
39
|
+
// Saved when an ad starts to restore after it finishes
|
|
38
40
|
prevSelectedRate;
|
|
41
|
+
rendered = false;
|
|
39
42
|
selectedRate = DEFAULT_PLAYBACK_RATE;
|
|
40
43
|
/**
|
|
41
44
|
* @internal
|
|
@@ -49,9 +52,13 @@ export class PlaybackRate extends UICorePlugin {
|
|
|
49
52
|
get supportedVersion() {
|
|
50
53
|
return { min: CLAPPR_VERSION };
|
|
51
54
|
}
|
|
52
|
-
static template = template(pluginHtml);
|
|
53
55
|
static buttonTemplate = template(buttonHtml);
|
|
54
56
|
static listTemplate = template(listHtml);
|
|
57
|
+
constructor(core) {
|
|
58
|
+
super(core);
|
|
59
|
+
this.playbackRates = core.options.playbackRate?.options || DEFAULT_PLAYBACK_RATES;
|
|
60
|
+
this.selectedRate = core.options.playbackRate?.defaultValue || DEFAULT_PLAYBACK_RATE;
|
|
61
|
+
}
|
|
55
62
|
/**
|
|
56
63
|
* @internal
|
|
57
64
|
*/
|
|
@@ -75,27 +82,36 @@ export class PlaybackRate extends UICorePlugin {
|
|
|
75
82
|
* @internal
|
|
76
83
|
*/
|
|
77
84
|
bindEvents() {
|
|
78
|
-
this.listenTo(this.core,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
this.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
this.listenTo(this.core, Events.CORE_READY, this.onCoreReady);
|
|
86
|
+
this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChange);
|
|
87
|
+
}
|
|
88
|
+
onCoreReady() {
|
|
89
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
90
|
+
assert(mediaControl, 'media_control plugin is required');
|
|
91
|
+
const gear = this.core.getPlugin('bottom_gear');
|
|
92
|
+
assert(gear, 'bottom_gear plugin is required');
|
|
93
|
+
this.listenTo(mediaControl, MediaControlEvents.MEDIACONTROL_GEAR_RENDERED, this.onGearRendered);
|
|
94
|
+
}
|
|
95
|
+
onActiveContainerChange() {
|
|
96
|
+
this.listenTo(this.core.activePlayback, Events.PLAYBACK_STOP, this.onStop);
|
|
97
|
+
this.listenTo(this.core.activePlayback, Events.PLAYBACK_PLAY, this.onPlay);
|
|
98
|
+
this.listenTo(this.core.activePlayback, PlaybackEvents.PLAYBACK_RATE_CHANGED, this.onPlaybackRateChange);
|
|
99
|
+
this.listenTo(this.core.activeContainer, Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.onDvrStateChanged);
|
|
100
|
+
}
|
|
101
|
+
onGearRendered() {
|
|
102
|
+
trace(`${T} onGearRendered`, {
|
|
103
|
+
rendered: this.rendered,
|
|
104
|
+
});
|
|
105
|
+
this.rendered = false;
|
|
106
|
+
this.render();
|
|
93
107
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
108
|
+
onDvrStateChanged(dvrEnabled) {
|
|
109
|
+
trace(`${T} onDvrStateChanged`, {
|
|
110
|
+
dvrEnabled,
|
|
111
|
+
});
|
|
112
|
+
if (dvrEnabled) {
|
|
113
|
+
this.render();
|
|
114
|
+
}
|
|
99
115
|
}
|
|
100
116
|
allRateElements() {
|
|
101
117
|
return this.$('ul.gear-sub-menu li');
|
|
@@ -103,68 +119,53 @@ export class PlaybackRate extends UICorePlugin {
|
|
|
103
119
|
rateElement(rate = "1") {
|
|
104
120
|
return this.$(`ul.gear-sub-menu a[data-rate="${rate}"]`).parent();
|
|
105
121
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this.core.mediaControl.$el.addClass('dvr');
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
this.updatePlaybackRate(DEFAULT_PLAYBACK_RATE);
|
|
118
|
-
this.core.mediaControl.$playbackRate.addClass('playbackrate-enable');
|
|
119
|
-
this.core.mediaControl.$el.removeClass('dvr');
|
|
122
|
+
onPlaybackRateChange(playbackRate) {
|
|
123
|
+
const selectedRate = parseInt(this.selectedRate, 10);
|
|
124
|
+
if (playbackRate !== selectedRate) {
|
|
125
|
+
trace(`${T} onPlaybackRateChange setting target rate`, {
|
|
126
|
+
playbackRate,
|
|
127
|
+
selectedRate,
|
|
128
|
+
});
|
|
129
|
+
this.core.activePlayback?.setPlaybackRate(selectedRate);
|
|
120
130
|
}
|
|
121
131
|
}
|
|
122
|
-
reload() {
|
|
123
|
-
this.unBindEvents();
|
|
124
|
-
this.bindEvents();
|
|
125
|
-
}
|
|
126
132
|
shouldRender() {
|
|
127
133
|
if (!this.core.activeContainer) {
|
|
128
134
|
return false;
|
|
129
135
|
}
|
|
130
|
-
this.
|
|
131
|
-
|
|
136
|
+
if (this.core.getPlaybackType() === Playback.LIVE && !this.core.activePlayback.dvrEnabled) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
return 'setPlaybackRate' in this.core.activePlayback;
|
|
132
140
|
}
|
|
133
141
|
/**
|
|
134
142
|
* @internal
|
|
135
143
|
*/
|
|
136
144
|
render() {
|
|
137
|
-
|
|
138
|
-
|
|
145
|
+
trace(`${T} render`, {
|
|
146
|
+
rendered: this.rendered,
|
|
147
|
+
shouldRender: this.shouldRender(),
|
|
148
|
+
});
|
|
149
|
+
if (!this.shouldRender()) {
|
|
139
150
|
return this;
|
|
140
151
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
this.playbackRates = cfg.options || DEFAULT_PLAYBACK_RATES;
|
|
144
|
-
}
|
|
145
|
-
if (!this.selectedRate) {
|
|
146
|
-
this.selectedRate = cfg.defaultValue || DEFAULT_PLAYBACK_RATE;
|
|
147
|
-
}
|
|
148
|
-
if (this.shouldRender()) {
|
|
149
|
-
const button = PlaybackRate.buttonTemplate({
|
|
150
|
-
title: this.getTitle(),
|
|
151
|
-
speedIcon,
|
|
152
|
-
arrowRightIcon,
|
|
153
|
-
});
|
|
154
|
-
this.$el.html(button);
|
|
155
|
-
// if (this.core.getPlaybackType() === Playback.LIVE) {
|
|
156
|
-
// this.core.mediaControl.$playbackRate.addClass('playbackrate-enable');
|
|
157
|
-
// }
|
|
158
|
-
// this.core.mediaControl.$playbackRate.append(this.el);
|
|
159
|
-
this.core.mediaControl.$el?.find('.gear-options-list [data-rate]').html(this.el);
|
|
160
|
-
// this.updateText();
|
|
152
|
+
if (this.rendered) {
|
|
153
|
+
return this;
|
|
161
154
|
}
|
|
155
|
+
const button = PlaybackRate.buttonTemplate({
|
|
156
|
+
title: this.getTitle(),
|
|
157
|
+
speedIcon,
|
|
158
|
+
arrowRightIcon,
|
|
159
|
+
});
|
|
160
|
+
this.$el.html(button);
|
|
161
|
+
this.core.getPlugin('bottom_gear')?.getElement('rate')?.html(this.el);
|
|
162
|
+
this.rendered = true;
|
|
162
163
|
return this;
|
|
163
164
|
}
|
|
164
165
|
onStartAd() {
|
|
165
166
|
this.prevSelectedRate = this.selectedRate;
|
|
166
|
-
this.
|
|
167
|
-
this.listenToOnce(this.
|
|
167
|
+
this.resetPlaybackRate();
|
|
168
|
+
this.listenToOnce(this.core.activePlayback, Events.PLAYBACK_PLAY, this.onFinishAd);
|
|
168
169
|
}
|
|
169
170
|
onFinishAd() {
|
|
170
171
|
if (this.prevSelectedRate) {
|
|
@@ -172,16 +173,16 @@ export class PlaybackRate extends UICorePlugin {
|
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
175
|
onPlay() {
|
|
175
|
-
if (!this.core.
|
|
176
|
-
|
|
177
|
-
this.updatePlaybackRate(DEFAULT_PLAYBACK_RATE);
|
|
178
|
-
this.core.mediaControl.$playbackRate.addClass('playbackrate-enable');
|
|
179
|
-
}
|
|
176
|
+
if (this.core.getPlaybackType() === Playback.LIVE && !this.core.activePlayback.dvrEnabled) {
|
|
177
|
+
this.resetPlaybackRate();
|
|
180
178
|
}
|
|
181
179
|
else {
|
|
182
180
|
this.setSelectedRate(this.selectedRate);
|
|
183
181
|
}
|
|
184
182
|
}
|
|
183
|
+
resetPlaybackRate() {
|
|
184
|
+
this.setSelectedRate(DEFAULT_PLAYBACK_RATE);
|
|
185
|
+
}
|
|
185
186
|
onStop() {
|
|
186
187
|
}
|
|
187
188
|
onRateSelect(event) {
|
|
@@ -199,30 +200,21 @@ export class PlaybackRate extends UICorePlugin {
|
|
|
199
200
|
arrowLeftIcon,
|
|
200
201
|
checkIcon,
|
|
201
202
|
}));
|
|
202
|
-
this.core.
|
|
203
|
+
this.core.getPlugin('bottom_gear')?.setContent(this.el);
|
|
203
204
|
this.highlightCurrentRate();
|
|
204
205
|
}
|
|
205
206
|
goBack() {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
this.setSelectedRate(rate);
|
|
207
|
+
setTimeout(() => {
|
|
208
|
+
this.core.getPlugin('bottom_gear').refresh();
|
|
209
|
+
}, 0);
|
|
210
210
|
}
|
|
211
211
|
setSelectedRate(rate) {
|
|
212
212
|
// Set <video playbackRate="..."
|
|
213
|
-
this.core
|
|
213
|
+
this.core.activePlayback?.setPlaybackRate(rate);
|
|
214
214
|
this.selectedRate = rate;
|
|
215
|
-
// TODO
|
|
216
|
-
// Player.player.trigger('playbackRateChanged', rate);
|
|
217
215
|
}
|
|
218
216
|
getTitle() {
|
|
219
|
-
|
|
220
|
-
this.playbackRates.forEach((r) => {
|
|
221
|
-
if (r.value === this.selectedRate) {
|
|
222
|
-
title = r.label;
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
return title;
|
|
217
|
+
return this.playbackRates.find((r) => r.value === this.selectedRate)?.label || this.selectedRate;
|
|
226
218
|
}
|
|
227
219
|
highlightCurrentRate() {
|
|
228
220
|
this.allRateElements().removeClass('current');
|
|
@@ -7,7 +7,7 @@ import { CLAPPR_VERSION } from '../../build.js';
|
|
|
7
7
|
import '../../../assets/poster/poster.scss';
|
|
8
8
|
import posterHTML from '../../../assets/poster/poster.ejs';
|
|
9
9
|
import playIcon from '../../../assets/icons/new/play.svg';
|
|
10
|
-
const T = 'plugins.
|
|
10
|
+
const T = 'plugins.poster';
|
|
11
11
|
/**
|
|
12
12
|
* Displays a poster image in the background and a big play button on top when playback is stopped
|
|
13
13
|
* @beta
|
|
@@ -45,7 +45,7 @@ export class Poster extends UIContainerPlugin {
|
|
|
45
45
|
* @internal
|
|
46
46
|
*/
|
|
47
47
|
get name() {
|
|
48
|
-
return '
|
|
48
|
+
return 'poster';
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* @internal
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { UICorePlugin } from '@clappr/core';
|
|
2
2
|
import '../../../assets/share/style.scss';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* PLUGIN that adds a share button to the media control UI.
|
|
5
|
+
* @beta
|
|
5
6
|
*/
|
|
6
7
|
export declare class Share extends UICorePlugin {
|
|
7
8
|
private hide;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Share.d.ts","sourceRoot":"","sources":["../../../src/plugins/share/Share.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAY,MAAM,cAAc,CAAC;AAKzE,OAAO,kCAAkC,CAAC;AAM1C
|
|
1
|
+
{"version":3,"file":"Share.d.ts","sourceRoot":"","sources":["../../../src/plugins/share/Share.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAY,MAAM,cAAc,CAAC;AAKzE,OAAO,kCAAkC,CAAC;AAM1C;;;GAGG;AACH,qBAAa,KAAM,SAAQ,YAAY;IACrC,OAAO,CAAC,IAAI,CAAS;IAErB,OAAO,CAAC,SAAS,CAA0B;IAE3C,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,IAAI,QAAQ,QAEX;IAED,IAAa,UAAU;;;MAKtB;IAED,IAAa,MAAM;;;;;;;MASlB;IAEQ,UAAU;IAQnB,YAAY;IAaZ,YAAY;IAIZ,OAAO,CAAC,OAAO;IASN,MAAM;IAgBf,SAAS;IAIT,SAAS;IAOT,eAAe;IASf,WAAW;IAIX,WAAW;IAIX,SAAS;IAQT,SAAS;IAQT,gBAAgB;IAIhB,iBAAiB;CAGlB"}
|
|
@@ -7,7 +7,8 @@ import closeIcon from '../../../assets/icons/old/close-share.svg';
|
|
|
7
7
|
import fbIcon from '../../../assets/icons/old/fb.svg';
|
|
8
8
|
import twIcon from '../../../assets/icons/old/twitter.svg';
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* PLUGIN that adds a share button to the media control UI.
|
|
11
|
+
* @beta
|
|
11
12
|
*/
|
|
12
13
|
export class Share extends UICorePlugin {
|
|
13
14
|
hide = false;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { UICorePlugin as UICorePluginOriginal } from '@clappr/core';
|
|
2
2
|
import '../../../assets/skip-time/style.scss';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* PLUGIN that adds skip controls to the media control UI.
|
|
5
|
+
* @beta
|
|
5
6
|
*/
|
|
6
7
|
export declare class SkipTime extends UICorePluginOriginal {
|
|
7
8
|
get name(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkipTime.d.ts","sourceRoot":"","sources":["../../../src/plugins/skip-time/SkipTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAuC,MAAM,cAAc,CAAC;AAKzG,OAAO,sCAAsC,CAAC;AAI9C
|
|
1
|
+
{"version":3,"file":"SkipTime.d.ts","sourceRoot":"","sources":["../../../src/plugins/skip-time/SkipTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAuC,MAAM,cAAc,CAAC;AAKzG,OAAO,sCAAsC,CAAC;AAI9C;;;GAGG;AACH,qBAAa,QAAS,SAAQ,oBAAoB;IAChD,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,IAAI,SAAS,QAEZ;IAED,IAAI,QAAQ,QAEX;IAED,IAAa,UAAU;;;MAKtB;IAED,OAAO,CAAC,QAAQ,CAAmB;IAEnC,IAAa,MAAM;;;;MAMlB;IAEQ,UAAU;IAQnB,OAAO;IAIP,kBAAkB;IA4BlB,WAAW;IAIX,UAAU;IAIV,gBAAgB;IAMP,MAAM;CAWhB"}
|
|
@@ -3,7 +3,8 @@ import { CLAPPR_VERSION } from '../../build.js';
|
|
|
3
3
|
import pluginHtml from '../../../assets/skip-time/skip-time.ejs';
|
|
4
4
|
import '../../../assets/skip-time/style.scss';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* PLUGIN that adds skip controls to the media control UI.
|
|
7
|
+
* @beta
|
|
7
8
|
*/
|
|
8
9
|
export class SkipTime extends UICorePluginOriginal {
|
|
9
10
|
get name() {
|
|
@@ -124,7 +124,7 @@ export class SourceController extends CorePlugin {
|
|
|
124
124
|
}
|
|
125
125
|
this.bindContainerEventListeners();
|
|
126
126
|
if (this.active) {
|
|
127
|
-
this.core.activeContainer?.getPlugin('
|
|
127
|
+
this.core.activeContainer?.getPlugin('poster')?.disable();
|
|
128
128
|
spinner?.show(0);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -145,7 +145,7 @@ export class SourceController extends CorePlugin {
|
|
|
145
145
|
}
|
|
146
146
|
switch (error.code) {
|
|
147
147
|
case PlaybackErrorCode.MediaSourceUnavailable:
|
|
148
|
-
this.core.activeContainer?.getPlugin('
|
|
148
|
+
this.core.activeContainer?.getPlugin('poster')?.disable();
|
|
149
149
|
this.retryPlayback();
|
|
150
150
|
break;
|
|
151
151
|
default:
|
|
@@ -159,7 +159,7 @@ export class SourceController extends CorePlugin {
|
|
|
159
159
|
});
|
|
160
160
|
if (this.active) {
|
|
161
161
|
this.reset();
|
|
162
|
-
this.core.activeContainer?.getPlugin('
|
|
162
|
+
this.core.activeContainer?.getPlugin('poster')?.enable();
|
|
163
163
|
this.core.activeContainer?.getPlugin('spinner')?.hide();
|
|
164
164
|
}
|
|
165
165
|
});
|
|
@@ -2,6 +2,7 @@ import { Container, UIContainerPlugin } from '@clappr/core';
|
|
|
2
2
|
import '../../../assets/spinner-three-bounce/spinner.scss';
|
|
3
3
|
/**
|
|
4
4
|
* Custom events emitted by the plugin
|
|
5
|
+
* @beta
|
|
5
6
|
*/
|
|
6
7
|
export declare enum SpinnerEvents {
|
|
7
8
|
/**
|
|
@@ -11,10 +12,12 @@ export declare enum SpinnerEvents {
|
|
|
11
12
|
SYNC = "plugins:spinner:sync"
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* PLUGIN that shows a pending operation indicator when playback is buffering or in a similar state
|
|
15
16
|
* @beta
|
|
16
17
|
* @remarks
|
|
17
|
-
*
|
|
18
|
+
* Events emitted- {@link SpinnerEvents}
|
|
19
|
+
* Other plugins can use {@link SpinnerThreeBounce.show | show} and {@link SpinnerThreeBounce.hide | hide} methods to
|
|
20
|
+
* implement custom pending/progress indication scenarios.
|
|
18
21
|
*/
|
|
19
22
|
export declare class SpinnerThreeBounce extends UIContainerPlugin {
|
|
20
23
|
private userShown;
|
|
@@ -48,7 +51,7 @@ export declare class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
48
51
|
/**
|
|
49
52
|
* Shows the spinner.
|
|
50
53
|
*
|
|
51
|
-
* When called, the spinner will not hide (due to its built-in logic) until {@link SpinnerThreeBounce
|
|
54
|
+
* When called, the spinner will not hide (due to its built-in logic) until {@link SpinnerThreeBounce.hide} is called
|
|
52
55
|
*/
|
|
53
56
|
show(delay?: number): void;
|
|
54
57
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpinnerThreeBounce.d.ts","sourceRoot":"","sources":["../../../src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,SAAS,EAET,iBAAiB,EAElB,MAAM,cAAc,CAAA;AAKrB,OAAO,mDAAmD,CAAA;AAM1D
|
|
1
|
+
{"version":3,"file":"SpinnerThreeBounce.d.ts","sourceRoot":"","sources":["../../../src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,SAAS,EAET,iBAAiB,EAElB,MAAM,cAAc,CAAA;AAKrB,OAAO,mDAAmD,CAAA;AAM1D;;;GAGG;AACH,oBAAY,aAAa;IACvB;;;OAGG;IACH,IAAI,yBAAyB;CAC9B;AAED;;;;;;;GAOG;AACH,qBAAa,kBAAmB,SAAQ,iBAAiB;IACvD,OAAO,CAAC,SAAS,CAAQ;IAEzB;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,IAAa,UAAU;;;MAKtB;IAED,OAAO,CAAC,WAAW,CAAuB;IAE1C,OAAO,CAAC,QAAQ,CAAwB;IAExC,OAAO,CAAC,aAAa,CAAQ;IAE7B,OAAO,CAAC,YAAY,CAAQ;gBAEhB,SAAS,EAAE,SAAS;IAmBhC,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,MAAM;IAUd,OAAO,CAAC,OAAO;IAef;;;;OAIG;IACH,IAAI,CAAC,KAAK,SAAM;IAMhB;;OAEG;IACH,IAAI;IAKJ,OAAO,CAAC,KAAK;IASb,OAAO,CAAC,KAAK;IAeb;;OAEG;IACM,MAAM;CAmBhB"}
|
|
@@ -10,6 +10,7 @@ import { CLAPPR_VERSION } from '../../build.js';
|
|
|
10
10
|
const T = 'plugins.spinner';
|
|
11
11
|
/**
|
|
12
12
|
* Custom events emitted by the plugin
|
|
13
|
+
* @beta
|
|
13
14
|
*/
|
|
14
15
|
export var SpinnerEvents;
|
|
15
16
|
(function (SpinnerEvents) {
|
|
@@ -20,10 +21,12 @@ export var SpinnerEvents;
|
|
|
20
21
|
SpinnerEvents["SYNC"] = "plugins:spinner:sync";
|
|
21
22
|
})(SpinnerEvents || (SpinnerEvents = {}));
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* PLUGIN that shows a pending operation indicator when playback is buffering or in a similar state
|
|
24
25
|
* @beta
|
|
25
26
|
* @remarks
|
|
26
|
-
*
|
|
27
|
+
* Events emitted- {@link SpinnerEvents}
|
|
28
|
+
* Other plugins can use {@link SpinnerThreeBounce.show | show} and {@link SpinnerThreeBounce.hide | hide} methods to
|
|
29
|
+
* implement custom pending/progress indication scenarios.
|
|
27
30
|
*/
|
|
28
31
|
export class SpinnerThreeBounce extends UIContainerPlugin {
|
|
29
32
|
userShown = false;
|
|
@@ -103,7 +106,7 @@ export class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
103
106
|
/**
|
|
104
107
|
* Shows the spinner.
|
|
105
108
|
*
|
|
106
|
-
* When called, the spinner will not hide (due to its built-in logic) until {@link SpinnerThreeBounce
|
|
109
|
+
* When called, the spinner will not hide (due to its built-in logic) until {@link SpinnerThreeBounce.hide} is called
|
|
107
110
|
*/
|
|
108
111
|
show(delay = 300) {
|
|
109
112
|
trace(`${T} show`);
|
|
@@ -57,7 +57,7 @@ export type TelemetryRecord = {
|
|
|
57
57
|
* @param data - The telemetry record to send.
|
|
58
58
|
* @beta
|
|
59
59
|
*/
|
|
60
|
-
type TelemetrySendFn = (data: TelemetryRecord) => void;
|
|
60
|
+
export type TelemetrySendFn = (data: TelemetryRecord) => void;
|
|
61
61
|
/**
|
|
62
62
|
* Plugin settings
|
|
63
63
|
* @beta
|
|
@@ -80,7 +80,7 @@ export declare enum TelemetryEvent {
|
|
|
80
80
|
Stall = 4
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
83
|
+
* PLUGIN that collects and reports the performance statistics.
|
|
84
84
|
* @beta
|
|
85
85
|
* @remarks
|
|
86
86
|
* This plugin is experimental and its API is likely to change.
|
|
@@ -149,5 +149,4 @@ export declare class Telemetry extends ContainerPlugin {
|
|
|
149
149
|
private onTimeUpdate;
|
|
150
150
|
private onStart;
|
|
151
151
|
}
|
|
152
|
-
export {};
|
|
153
152
|
//# sourceMappingURL=Telemetry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Telemetry.d.ts","sourceRoot":"","sources":["../../../src/plugins/telemetry/Telemetry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAU,MAAM,cAAc,CAAA;AAKjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAUlD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG,aAAa,GAAG,cAAc,GAAG,cAAc,CAAA;AAEjG;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,cAAc,CAAC,KAAK,CAAA;IAC3B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,EAAE,MA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{}));
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* PLUGIN that collects and reports the performance statistics.
|
|
22
22
|
* @beta
|
|
23
23
|
* @remarks
|
|
24
24
|
* This plugin is experimental and its API is likely to change.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VastAds.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/VastAds.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAIJ,QAAQ,EAER,YAAY,EAEb,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"VastAds.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/VastAds.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAIJ,QAAQ,EAER,YAAY,EAEb,MAAM,cAAc,CAAA;AAarB,OAAO,qCAAqC,CAAA;AAQ5C,qBAAa,OAAQ,SAAQ,YAAY;IACvC,OAAO,CAAC,mBAAmB,CAAiC;IAE5D,OAAO,CAAC,qBAAqB,CAAwC;IAErE,OAAO,CAAC,oBAAoB,CAAwC;IAEpE,OAAO,CAAC,eAAe,CAAI;IAE3B,OAAO,CAAC,mBAAmB,CAAI;IAE/B,OAAO,CAAC,UAAU,CAAyB;IAE3C,OAAO,CAAC,SAAS,CAAyB;IAE1C,OAAO,CAAC,eAAe,CAA2B;IAElD,OAAO,CAAC,gBAAgB,CAAI;IAE5B,OAAO,CAAC,YAAY,CAAY;IAEhC,OAAO,CAAC,YAAY,CAAQ;IAE5B,OAAO,CAAC,cAAc,CAAQ;IAE9B,OAAO,CAAC,aAAa,CAAuB;IAE5C,OAAO,CAAC,SAAS,CAAwB;IAEzC,OAAO,CAAC,cAAc,CAAQ;IAE9B,OAAO,CAAC,mBAAmB,CAA2B;IAEtD,OAAO,CAAC,aAAa,CAAiC;IAEtD,OAAO,CAAC,gBAAgB,CAAI;IAE5B,OAAO,CAAC,IAAI,CAA2B;IAEvC,OAAO,CAAC,OAAO,CAAK;IAEpB,OAAO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|
}
|
|
175
175
|
onPlaybackPlay() {
|
|
176
176
|
setTimeout(() => {
|
|
177
|
-
const posterPlugin = this.container?.getPlugin('
|
|
177
|
+
const posterPlugin = this.container?.getPlugin('poster');
|
|
178
178
|
posterPlugin?.enable();
|
|
179
179
|
posterPlugin?.$el.hide();
|
|
180
180
|
this._posterPlugin?.$playWrapper.show();
|
|
@@ -435,7 +435,7 @@ export class VastAds extends UICorePlugin {
|
|
|
435
435
|
this._pluginError('failed to get Clappr playback');
|
|
436
436
|
}
|
|
437
437
|
// Attempt to get poster plugin. (May interfere with media control)
|
|
438
|
-
this._posterPlugin = this._container?.getPlugin('
|
|
438
|
+
this._posterPlugin = this._container?.getPlugin('poster');
|
|
439
439
|
// Attempt to get click-to-pause plugin. (May interfere with advert click handling)
|
|
440
440
|
this._clickToPausePlugin = this._container?.getPlugin('click_to_pause_custom');
|
|
441
441
|
assert(this.playback, 'playback is not defined');
|
|
@@ -519,7 +519,7 @@ export class VastAds extends UICorePlugin {
|
|
|
519
519
|
}
|
|
520
520
|
adsPlaying() {
|
|
521
521
|
assert(this.container, 'container is not defined');
|
|
522
|
-
const poster = this.container.getPlugin('
|
|
522
|
+
const poster = this.container.getPlugin('poster');
|
|
523
523
|
poster && poster.disable();
|
|
524
524
|
try {
|
|
525
525
|
const logo = this.container.getPlugin('logo');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roll.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/roll.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,IAAI,EAAE,MAAM,EAAiB,MAAM,cAAc,CAAC;AAIzE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"roll.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/roll.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,IAAI,EAAE,MAAM,EAAiB,MAAM,cAAc,CAAC;AAIzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD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CAAC,UAAU;IA+BlB,iBAAiB;IAKjB,aAAa;IAUb,UAAU,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE;QAAE,GAAG,EAAE,GAAG,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,GAAG,CAAA;KAAE;IAwC7E,YAAY;IASZ,mBAAmB,CAAC,qBAAqB,EAAE,GAAG;IA+H9C,eAAe,CAAC,GAAG,EAAE,MAAM;IAS3B,cAAc,CAAC,EAAE,EAAE,GAAG;IAgCtB,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,SAAS;IAIjB,gBAAgB;IAkBhB,aAAa;IA+Cb,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE;IAMzB,SAAS,CAAC,GAAG,EAAE,MAAM;IAQrB,OAAO;CAWR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Core, Events } from '@clappr/core';
|
|
2
|
-
import { ZeptoResult } from '../../
|
|
2
|
+
import { ZeptoResult } from '../../types.js';
|
|
3
3
|
import { AdRollDesc, AdRollType } from './types.js';
|
|
4
4
|
type CoreOptions = Record<string, unknown>;
|
|
5
5
|
export default class RollManager extends Events {
|