@gcorevideo/player 2.24.2 → 2.24.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/big-mute-button/big-mute-button.ejs +2 -2
- package/dist/core.js +1 -1
- package/dist/index.css +1382 -1382
- package/dist/index.js +121 -109
- package/dist/player.d.ts +72 -21
- package/docs/api/player.bigmutebutton.md +13 -1
- package/docs/api/player.clapprstatssettings.md +51 -4
- package/docs/api/player.clapprstatssettings.runeach.md +16 -0
- package/docs/api/player.clipspluginsettings.md +1 -1
- package/docs/api/player.clipspluginsettings.text.md +1 -1
- package/docs/api/player.cmcdconfig.exportids.md +4 -0
- package/docs/api/player.cmcdconfig.md +19 -105
- package/docs/api/{player.cmcdconfig.version.md → player.cmcdconfigoptions.contentid.md} +5 -3
- package/docs/api/player.cmcdconfigoptions.md +79 -0
- package/docs/api/{player.cmcdconfigpluginsettings.md → player.cmcdconfigoptions.sessionid.md} +4 -6
- package/docs/api/player.extendedevents.md +9 -0
- package/docs/api/player.md +37 -31
- package/docs/api/player.mediacontrol.getavailableheight.md +24 -0
- package/docs/api/player.mediacontrol.md +14 -0
- package/docs/api/{player.cmcdconfig.name.md → player.posterpluginsettings.custom.md} +4 -3
- package/docs/api/player.posterpluginsettings.md +108 -7
- package/docs/api/player.posterpluginsettings.showfornoop.md +16 -0
- package/docs/api/player.posterpluginsettings.showonvideoend.md +16 -0
- package/docs/api/{player.cmcdconfig.bindevents.md → player.posterpluginsettings.url.md} +4 -7
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts +15 -13
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
- package/lib/plugins/big-mute-button/BigMuteButton.js +68 -83
- package/lib/plugins/clappr-stats/ClapprStats.d.ts +6 -2
- package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
- package/lib/plugins/clips/Clips.d.ts +1 -1
- package/lib/plugins/clips/Clips.d.ts.map +1 -1
- package/lib/plugins/clips/Clips.js +2 -1
- package/lib/plugins/cmcd-config/CmcdConfig.d.ts +34 -11
- package/lib/plugins/cmcd-config/CmcdConfig.d.ts.map +1 -1
- package/lib/plugins/cmcd-config/CmcdConfig.js +28 -18
- package/lib/plugins/media-control/MediaControl.d.ts +4 -0
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +5 -0
- package/lib/plugins/poster/Poster.d.ts +7 -3
- package/lib/plugins/poster/Poster.d.ts.map +1 -1
- package/lib/plugins/source-controller/SourceController.d.ts +1 -0
- package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
- package/lib/plugins/source-controller/SourceController.js +20 -9
- package/lib/testUtils.d.ts +1 -0
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +1 -0
- package/package.json +1 -1
- package/src/plugins/big-mute-button/BigMuteButton.ts +75 -110
- package/src/plugins/big-mute-button/__tests__/BigMuteButton.test.ts +38 -0
- package/src/plugins/big-mute-button/__tests__/__snapshots__/BigMuteButton.test.ts.snap +8 -0
- package/src/plugins/clappr-stats/ClapprStats.ts +5 -1
- package/src/plugins/clips/Clips.ts +3 -2
- package/src/plugins/cmcd-config/CmcdConfig.ts +33 -27
- package/src/plugins/media-control/MediaControl.ts +5 -0
- package/src/plugins/poster/Poster.ts +6 -2
- package/src/plugins/source-controller/SourceController.ts +25 -9
- package/src/plugins/source-controller/__tests__/SourceController.test.ts +28 -8
- package/src/testUtils.ts +1 -0
- package/temp/player.api.json +229 -154
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.cmcdconfig.supportedversion.md +0 -14
|
@@ -2,15 +2,116 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@gcorevideo/player](./player.md) > [PosterPluginSettings](./player.posterpluginsettings.md)
|
|
4
4
|
|
|
5
|
-
## PosterPluginSettings
|
|
5
|
+
## PosterPluginSettings interface
|
|
6
|
+
|
|
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
|
+
>
|
|
9
|
+
|
|
10
|
+
Config options for the [Poster](./player.poster.md) plugin
|
|
6
11
|
|
|
7
12
|
**Signature:**
|
|
8
13
|
|
|
9
14
|
```typescript
|
|
10
|
-
export
|
|
11
|
-
custom?: string;
|
|
12
|
-
showForNoOp?: boolean;
|
|
13
|
-
url?: string;
|
|
14
|
-
showOnVideoEnd?: boolean;
|
|
15
|
-
};
|
|
15
|
+
export interface PosterPluginSettings
|
|
16
16
|
```
|
|
17
|
+
|
|
18
|
+
## Properties
|
|
19
|
+
|
|
20
|
+
<table><thead><tr><th>
|
|
21
|
+
|
|
22
|
+
Property
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
</th><th>
|
|
26
|
+
|
|
27
|
+
Modifiers
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
</th><th>
|
|
31
|
+
|
|
32
|
+
Type
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
</th><th>
|
|
36
|
+
|
|
37
|
+
Description
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
</th></tr></thead>
|
|
41
|
+
<tbody><tr><td>
|
|
42
|
+
|
|
43
|
+
[custom?](./player.posterpluginsettings.custom.md)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
</td><td>
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
</td><td>
|
|
50
|
+
|
|
51
|
+
string
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
</td><td>
|
|
55
|
+
|
|
56
|
+
**_(BETA)_** _(Optional)_ Custom CSS background
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
</td></tr>
|
|
60
|
+
<tr><td>
|
|
61
|
+
|
|
62
|
+
[showForNoOp?](./player.posterpluginsettings.showfornoop.md)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
</td><td>
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
</td><td>
|
|
69
|
+
|
|
70
|
+
boolean
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
</td><td>
|
|
74
|
+
|
|
75
|
+
**_(BETA)_** _(Optional)_ Whether to show the poster image when the playback is noop (i.e., when there is no appropriate video playback engine for current media sources set or the media sources are not set at all)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
</td></tr>
|
|
79
|
+
<tr><td>
|
|
80
|
+
|
|
81
|
+
[showOnVideoEnd?](./player.posterpluginsettings.showonvideoend.md)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
</td><td>
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
</td><td>
|
|
88
|
+
|
|
89
|
+
boolean
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
</td><td>
|
|
93
|
+
|
|
94
|
+
**_(BETA)_** _(Optional)_ Whether to show the poster after playback has ended, by default `true`
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
</td></tr>
|
|
98
|
+
<tr><td>
|
|
99
|
+
|
|
100
|
+
[url?](./player.posterpluginsettings.url.md)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
</td><td>
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
</td><td>
|
|
107
|
+
|
|
108
|
+
string
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
</td><td>
|
|
112
|
+
|
|
113
|
+
**_(BETA)_** _(Optional)_ Poster image URL
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
</td></tr>
|
|
117
|
+
</tbody></table>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@gcorevideo/player](./player.md) > [PosterPluginSettings](./player.posterpluginsettings.md) > [showForNoOp](./player.posterpluginsettings.showfornoop.md)
|
|
4
|
+
|
|
5
|
+
## PosterPluginSettings.showForNoOp property
|
|
6
|
+
|
|
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
|
+
>
|
|
9
|
+
|
|
10
|
+
Whether to show the poster image when the playback is noop (i.e., when there is no appropriate video playback engine for current media sources set or the media sources are not set at all)
|
|
11
|
+
|
|
12
|
+
**Signature:**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
showForNoOp?: boolean;
|
|
16
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@gcorevideo/player](./player.md) > [PosterPluginSettings](./player.posterpluginsettings.md) > [showOnVideoEnd](./player.posterpluginsettings.showonvideoend.md)
|
|
4
|
+
|
|
5
|
+
## PosterPluginSettings.showOnVideoEnd property
|
|
6
|
+
|
|
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
|
+
>
|
|
9
|
+
|
|
10
|
+
Whether to show the poster after playback has ended, by default `true`
|
|
11
|
+
|
|
12
|
+
**Signature:**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
showOnVideoEnd?: boolean;
|
|
16
|
+
```
|
|
@@ -1,19 +1,16 @@
|
|
|
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) > [PosterPluginSettings](./player.posterpluginsettings.md) > [url](./player.posterpluginsettings.url.md)
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## PosterPluginSettings.url property
|
|
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
|
>
|
|
9
9
|
|
|
10
|
+
Poster image URL
|
|
10
11
|
|
|
11
12
|
**Signature:**
|
|
12
13
|
|
|
13
14
|
```typescript
|
|
14
|
-
|
|
15
|
+
url?: string;
|
|
15
16
|
```
|
|
16
|
-
**Returns:**
|
|
17
|
-
|
|
18
|
-
void
|
|
19
|
-
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { UICorePlugin } from '@clappr/core';
|
|
2
2
|
import '../../../assets/big-mute-button/big-mute-button.scss';
|
|
3
3
|
/**
|
|
4
|
-
* `PLUGIN` that displays a big mute button over the video when it's muted.
|
|
5
|
-
* Once pressed, it unmutes the video.
|
|
4
|
+
* `PLUGIN` that displays a big mute button over the video when it's being played muted.
|
|
6
5
|
* @beta
|
|
6
|
+
* @remarks
|
|
7
|
+
* When pressed, it unmutes the video.
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { BigMuteButton } from '@gcorevideo/player'
|
|
11
|
+
* Player.registerPlugin(BigMuteButton)
|
|
12
|
+
* ```
|
|
7
13
|
*/
|
|
8
14
|
export declare class BigMuteButton extends UICorePlugin {
|
|
9
|
-
private
|
|
15
|
+
private hidden;
|
|
10
16
|
private _adIsPlaying;
|
|
11
|
-
private $bigMuteBtnContainer;
|
|
12
|
-
private $bigMuteButton;
|
|
13
17
|
/**
|
|
14
18
|
* @internal
|
|
15
19
|
*/
|
|
@@ -25,28 +29,26 @@ export declare class BigMuteButton extends UICorePlugin {
|
|
|
25
29
|
* @internal
|
|
26
30
|
*/
|
|
27
31
|
get events(): {
|
|
28
|
-
|
|
29
|
-
'click .big-mute-icon-wrapper': string;
|
|
32
|
+
click: string;
|
|
30
33
|
};
|
|
31
34
|
/**
|
|
32
35
|
* @internal
|
|
33
36
|
*/
|
|
34
37
|
bindEvents(): void;
|
|
35
38
|
private onCoreReady;
|
|
39
|
+
private onContainerChanged;
|
|
40
|
+
private onPlay;
|
|
36
41
|
private onContainerVolume;
|
|
37
|
-
private onContainerStart;
|
|
38
42
|
private onPlaybackEnded;
|
|
39
|
-
private mediaControlRendered;
|
|
40
43
|
private onStartAd;
|
|
41
44
|
private onFinishAd;
|
|
42
|
-
private shouldRender;
|
|
43
45
|
/**
|
|
44
46
|
* @internal
|
|
45
47
|
*/
|
|
46
48
|
render(): this;
|
|
47
|
-
private
|
|
48
|
-
private
|
|
49
|
-
private
|
|
49
|
+
private mount;
|
|
50
|
+
private hide;
|
|
51
|
+
private show;
|
|
50
52
|
private clicked;
|
|
51
53
|
}
|
|
52
54
|
//# sourceMappingURL=BigMuteButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BigMuteButton.d.ts","sourceRoot":"","sources":["../../../src/plugins/big-mute-button/BigMuteButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAS,MAAM,cAAc,CAAA;AAQpE,OAAO,sDAAsD,CAAA;AAM7D
|
|
1
|
+
{"version":3,"file":"BigMuteButton.d.ts","sourceRoot":"","sources":["../../../src/plugins/big-mute-button/BigMuteButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAS,MAAM,cAAc,CAAA;AAQpE,OAAO,sDAAsD,CAAA;AAM7D;;;;;;;;;;GAUG;AACH,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,CAAC,MAAM,CAAQ;IAGtB,OAAO,CAAC,YAAY,CAAQ;IAE5B;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAyB;IAEzD;;OAEG;IACH,IAAa,MAAM;;MAIlB;IAED;;OAEG;IACM,UAAU;IAOnB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,kBAAkB;IAuB1B,OAAO,CAAC,MAAM;IAgBd,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,UAAU;IAKlB;;OAEG;IACM,MAAM;IAWf,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,OAAO;CAkBhB"}
|
|
@@ -2,20 +2,25 @@ import { Events, template, UICorePlugin, Utils } from '@clappr/core';
|
|
|
2
2
|
import { trace } from '@gcorevideo/utils';
|
|
3
3
|
import { CLAPPR_VERSION } from '../../build.js';
|
|
4
4
|
import volumeMuteIcon from '../../../assets/icons/new/volume-off.svg';
|
|
5
|
-
import
|
|
5
|
+
import templateHtml from '../../../assets/big-mute-button/big-mute-button.ejs';
|
|
6
6
|
import '../../../assets/big-mute-button/big-mute-button.scss';
|
|
7
7
|
const T = 'plugins.big_mute_button';
|
|
8
8
|
// TODO rewrite as a container plugin
|
|
9
9
|
/**
|
|
10
|
-
* `PLUGIN` that displays a big mute button over the video when it's muted.
|
|
11
|
-
* Once pressed, it unmutes the video.
|
|
10
|
+
* `PLUGIN` that displays a big mute button over the video when it's being played muted.
|
|
12
11
|
* @beta
|
|
12
|
+
* @remarks
|
|
13
|
+
* When pressed, it unmutes the video.
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { BigMuteButton } from '@gcorevideo/player'
|
|
17
|
+
* Player.registerPlugin(BigMuteButton)
|
|
18
|
+
* ```
|
|
13
19
|
*/
|
|
14
20
|
export class BigMuteButton extends UICorePlugin {
|
|
15
|
-
|
|
21
|
+
hidden = false;
|
|
22
|
+
// TODO get back to the ads-related logic later
|
|
16
23
|
_adIsPlaying = false;
|
|
17
|
-
$bigMuteBtnContainer = null;
|
|
18
|
-
$bigMuteButton = null;
|
|
19
24
|
/**
|
|
20
25
|
* @internal
|
|
21
26
|
*/
|
|
@@ -28,14 +33,13 @@ export class BigMuteButton extends UICorePlugin {
|
|
|
28
33
|
get supportedVersion() {
|
|
29
34
|
return { min: CLAPPR_VERSION };
|
|
30
35
|
}
|
|
31
|
-
static template = template(
|
|
36
|
+
static template = template(templateHtml);
|
|
32
37
|
/**
|
|
33
38
|
* @internal
|
|
34
39
|
*/
|
|
35
40
|
get events() {
|
|
36
41
|
return {
|
|
37
|
-
'click
|
|
38
|
-
'click .big-mute-icon-wrapper': 'destroyBigMuteBtn',
|
|
42
|
+
'click': 'clicked',
|
|
39
43
|
};
|
|
40
44
|
}
|
|
41
45
|
/**
|
|
@@ -43,110 +47,91 @@ export class BigMuteButton extends UICorePlugin {
|
|
|
43
47
|
*/
|
|
44
48
|
bindEvents() {
|
|
45
49
|
this.listenTo(this.core, Events.CORE_READY, this.onCoreReady);
|
|
50
|
+
this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
|
|
46
51
|
this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
|
|
47
52
|
this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
|
|
48
|
-
trace(`${T} bindEvents`, {
|
|
49
|
-
mediacontrol: !!this.core.mediaControl,
|
|
50
|
-
});
|
|
51
|
-
// TOOD use core.getPlugin('media_control')
|
|
52
|
-
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.mediaControlRendered);
|
|
53
53
|
}
|
|
54
54
|
onCoreReady() {
|
|
55
|
+
}
|
|
56
|
+
onContainerChanged() {
|
|
55
57
|
this.listenTo(this.core.activeContainer, Events.CONTAINER_VOLUME, this.onContainerVolume);
|
|
56
|
-
this.listenTo(
|
|
58
|
+
// this.listenTo(
|
|
59
|
+
// this.core.activeContainer,
|
|
60
|
+
// Events.CONTAINER_READY,
|
|
61
|
+
// this.onContainerReady,
|
|
62
|
+
// )
|
|
57
63
|
this.listenTo(this.core.activePlayback, Events.PLAYBACK_ENDED, this.onPlaybackEnded);
|
|
64
|
+
this.listenTo(this.core.activeContainer, Events.CONTAINER_PLAY, this.onPlay);
|
|
58
65
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
onPlay(_, { autoPlay }) {
|
|
67
|
+
const container = this.core.activeContainer;
|
|
68
|
+
const { volume } = container;
|
|
69
|
+
const { wasMuted } = this.options;
|
|
70
|
+
trace(`${T} onPlay`, {
|
|
71
|
+
autoPlay,
|
|
72
|
+
wasMuted,
|
|
73
|
+
volume,
|
|
74
|
+
});
|
|
75
|
+
if (autoPlay && !wasMuted && volume === 0) {
|
|
76
|
+
this.mount();
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.destroy();
|
|
62
80
|
}
|
|
63
81
|
}
|
|
64
|
-
|
|
65
|
-
if (
|
|
66
|
-
this.
|
|
82
|
+
onContainerVolume(value) {
|
|
83
|
+
if (value !== 0) {
|
|
84
|
+
this.destroy();
|
|
67
85
|
}
|
|
68
86
|
}
|
|
69
87
|
onPlaybackEnded() {
|
|
70
|
-
this.
|
|
71
|
-
}
|
|
72
|
-
mediaControlRendered() {
|
|
73
|
-
const container = this.core.activeContainer;
|
|
74
|
-
trace(`${T} mediaControlRendered`, {
|
|
75
|
-
container: !!container,
|
|
76
|
-
});
|
|
77
|
-
if (container) {
|
|
78
|
-
this.listenTo(container.playback, Events.PLAYBACK_PLAY, () => {
|
|
79
|
-
trace(`${T} PLAYBACK_PLAY`);
|
|
80
|
-
this.render();
|
|
81
|
-
});
|
|
82
|
-
}
|
|
88
|
+
this.hide();
|
|
83
89
|
}
|
|
84
90
|
onStartAd() {
|
|
85
91
|
this._adIsPlaying = true;
|
|
86
|
-
|
|
87
|
-
this.$bigMuteBtnContainer.addClass('hide');
|
|
88
|
-
}
|
|
92
|
+
this.hide();
|
|
89
93
|
}
|
|
90
94
|
onFinishAd() {
|
|
91
95
|
this._adIsPlaying = false;
|
|
92
|
-
|
|
93
|
-
this.$bigMuteBtnContainer.removeClass('hide');
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
shouldRender() {
|
|
97
|
-
const container = this.core.activeContainer;
|
|
98
|
-
if (!container) {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
const { autoPlay, wasMuted } = this.options;
|
|
102
|
-
const volume = container.volume;
|
|
103
|
-
trace(`${T} shouldRender`, {
|
|
104
|
-
autoPlay,
|
|
105
|
-
wasMuted,
|
|
106
|
-
volume,
|
|
107
|
-
});
|
|
108
|
-
return autoPlay && !wasMuted && volume === 0;
|
|
96
|
+
this.show();
|
|
109
97
|
}
|
|
110
98
|
/**
|
|
111
99
|
* @internal
|
|
112
100
|
*/
|
|
113
101
|
render() {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
this.$bigMuteBtnContainer = this.$el.find('.big-mute-icon-wrapper[data-big-mute]');
|
|
120
|
-
this._adIsPlaying && this.$bigMuteBtnContainer.addClass('hide');
|
|
121
|
-
this.$bigMuteButton = this.$bigMuteBtnContainer.find('.big-mute-icon');
|
|
122
|
-
this.$bigMuteButton.append(volumeMuteIcon);
|
|
123
|
-
const container = this.core.activeContainer;
|
|
124
|
-
container.$el.append(this.$el.get(0));
|
|
125
|
-
}
|
|
102
|
+
trace(`${T} render`);
|
|
103
|
+
this.$el.html(BigMuteButton.template());
|
|
104
|
+
this.$el.find('#gplayer-big-mute-icon').append(volumeMuteIcon);
|
|
105
|
+
// TODO
|
|
106
|
+
// this._adIsPlaying && this.hide()
|
|
126
107
|
return this;
|
|
127
108
|
}
|
|
128
|
-
|
|
129
|
-
this.
|
|
130
|
-
this
|
|
109
|
+
mount() {
|
|
110
|
+
this.core.activeContainer.$el.append(this.$el);
|
|
111
|
+
this.show();
|
|
131
112
|
}
|
|
132
|
-
|
|
133
|
-
this.
|
|
134
|
-
|
|
135
|
-
this.$bigMuteBtnContainer.removeClass('hide');
|
|
136
|
-
}
|
|
113
|
+
hide() {
|
|
114
|
+
this.hidden = true;
|
|
115
|
+
this.$el.find('#gplayer-big-mute-button')?.addClass('hide');
|
|
137
116
|
}
|
|
138
|
-
|
|
139
|
-
this.
|
|
140
|
-
|
|
141
|
-
e.stopPropagation();
|
|
142
|
-
}
|
|
143
|
-
this.destroy();
|
|
117
|
+
show() {
|
|
118
|
+
this.hidden = false;
|
|
119
|
+
this.$el.find('#gplayer-big-mute-button')?.removeClass('hide');
|
|
144
120
|
}
|
|
145
121
|
clicked(e) {
|
|
122
|
+
trace(`${T} clicked`);
|
|
123
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
124
|
+
// TODO delegate to media_control plugin
|
|
146
125
|
const localVolume = Utils.Config.restore('volume');
|
|
147
126
|
const volume = !isNaN(localVolume) ? localVolume : 100;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
127
|
+
const unmuted = volume === 0 ? 100 : volume;
|
|
128
|
+
if (mediaControl) {
|
|
129
|
+
mediaControl.setVolume(unmuted);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
this.core.activeContainer.setVolume(unmuted);
|
|
133
|
+
}
|
|
134
|
+
e.stopPropagation?.();
|
|
135
|
+
this.destroy();
|
|
151
136
|
}
|
|
152
137
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { Container, ContainerPlugin } from '@clappr/core';
|
|
2
2
|
import type { ClapprStatsMetrics } from './types.js';
|
|
3
3
|
export * from './types.js';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Config options for the {@link ClapprStats} plugin
|
|
6
|
+
* @beta
|
|
7
|
+
*/
|
|
8
|
+
export interface ClapprStatsSettings {
|
|
5
9
|
/**
|
|
6
10
|
* The interval in milliseconds of periodic measurements.
|
|
7
11
|
* The plugin will emit a {@link ClapprStatsEvents.REPORT} event with the collected metrics at the specified interval.
|
|
8
12
|
*/
|
|
9
13
|
runEach?: number;
|
|
10
|
-
}
|
|
14
|
+
}
|
|
11
15
|
/**
|
|
12
16
|
* `PLUGIN` that measures data about playback, which can be useful for analyzing performance and UX.
|
|
13
17
|
* @beta
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClapprStats.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-stats/ClapprStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAwB,MAAM,cAAc,CAAA;AAU/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAMpD,cAAc,YAAY,CAAA;AAM1B,MAAM,
|
|
1
|
+
{"version":3,"file":"ClapprStats.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-stats/ClapprStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAwB,MAAM,cAAc,CAAA;AAU/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAMpD,cAAc,YAAY,CAAA;AAM1B;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,eAAe;IAC9C,OAAO,CAAC,OAAO,CAAuB;IAEtC,OAAO,CAAC,sBAAsB,CAAI;IAElC,OAAO,CAAC,OAAO,CAAmC;IAElD,OAAO,CAAC,MAAM,CAMb;IAED,OAAO,CAAC,OAAO,CAAQ;IAEvB;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED,OAAO,KAAK,YAAY,GAEvB;IAED,OAAO,KAAK,YAAY,GAEvB;IAED,OAAO,CAAC,GAAG;IASX,OAAO,CAAC,GAAG;IAIX,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,IAAI;gBAIA,SAAS,EAAE,SAAS;IAKhC;;OAEG;IACM,UAAU;IAqDnB;;OAEG;IACM,OAAO;IAKhB;;;OAGG;IACH,aAAa;IAIb,YAAY;IAIZ,OAAO,CAAC,SAAS;IAkBjB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,OAAO;IAgBf,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,YAAY;IA8BpB,OAAO,CAAC,6BAA6B;IAOrC,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,QAAQ;IAgBhB,OAAO,CAAC,YAAY;IAuBpB,OAAO,CAAC,uBAAuB;IAO/B,OAAO,CAAC,aAAa;CA0BtB"}
|
|
@@ -7,7 +7,7 @@ import '../../../assets/clips/clips.scss';
|
|
|
7
7
|
*/
|
|
8
8
|
export interface ClipsPluginSettings {
|
|
9
9
|
/**
|
|
10
|
-
* The compiled text of the clips description, one clip per line in format
|
|
10
|
+
* The compiled text of the clips description, one clip per line in format:
|
|
11
11
|
* `HH:MM:SS text` or `MM:SS text` or `SS text`
|
|
12
12
|
*/
|
|
13
13
|
text: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clips.d.ts","sourceRoot":"","sources":["../../../src/plugins/clips/Clips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAe,MAAM,cAAc,CAAA;AAI3E,OAAO,EAAgB,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,kCAAkC,CAAA;AAOzC;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAKD;;;;;;;;;;;GAWG;AACH,qBAAa,KAAM,SAAQ,YAAY;IACrC,OAAO,CAAC,QAAQ,CAAgC;IAEhD,OAAO,CAAC,KAAK,CAAiB;IAE9B,OAAO,CAAC,YAAY,CAAuB;IAE3C,OAAO,CAAC,OAAO,CAA2B;IAE1C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAEtD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAa,UAAU;;MAItB;IAED,IAAI,OAAO,WAEV;IAED,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACM,UAAU;IAUV,MAAM;IAUN,OAAO;IAQP,OAAO;IAQP,MAAM;IAKf;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"Clips.d.ts","sourceRoot":"","sources":["../../../src/plugins/clips/Clips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAe,MAAM,cAAc,CAAA;AAI3E,OAAO,EAAgB,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,kCAAkC,CAAA;AAOzC;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAKD;;;;;;;;;;;GAWG;AACH,qBAAa,KAAM,SAAQ,YAAY;IACrC,OAAO,CAAC,QAAQ,CAAgC;IAEhD,OAAO,CAAC,KAAK,CAAiB;IAE9B,OAAO,CAAC,YAAY,CAAuB;IAE3C,OAAO,CAAC,OAAO,CAA2B;IAE1C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAEtD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAa,UAAU;;MAItB;IAED,IAAI,OAAO,WAEV;IAED,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACM,UAAU;IAUV,MAAM;IAUN,OAAO;IAQP,OAAO;IAQP,MAAM;IAKf;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS;IAK5C,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,kBAAkB;IAsB1B,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,WAAW;CAOpB"}
|
|
@@ -86,7 +86,8 @@ export class Clips extends UICorePlugin {
|
|
|
86
86
|
* @returns The text of the clip at the given time
|
|
87
87
|
*/
|
|
88
88
|
getText(time) {
|
|
89
|
-
return this.clips.find((clip) => clip.start <= time && clip.end >= time)
|
|
89
|
+
return this.clips.find((clip) => clip.start <= time && clip.end >= time)
|
|
90
|
+
?.text;
|
|
90
91
|
}
|
|
91
92
|
onCoreReady() {
|
|
92
93
|
trace(`${T} onCoreReady`);
|
|
@@ -1,45 +1,68 @@
|
|
|
1
1
|
import { Core, CorePlugin } from '@clappr/core';
|
|
2
2
|
/**
|
|
3
|
+
* Config options for the {@link CmcdConfig} plugin
|
|
3
4
|
* @beta
|
|
4
5
|
*/
|
|
5
|
-
export
|
|
6
|
+
export interface CmcdConfigOptions {
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* `sid` value. If ommitted, a random UUID will be generated
|
|
8
9
|
*/
|
|
9
|
-
sessionId
|
|
10
|
+
sessionId?: string;
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* `cid` value.
|
|
12
13
|
* If ommitted, the pathname part of the first source URL will be used
|
|
13
14
|
*/
|
|
14
15
|
contentId?: string;
|
|
15
|
-
}
|
|
16
|
+
}
|
|
16
17
|
/**
|
|
17
|
-
* A `PLUGIN` that configures CMCD for playback
|
|
18
|
+
* A `PLUGIN` that configures {@link https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf | CMCD} for playback
|
|
18
19
|
* @beta
|
|
19
20
|
* @remarks
|
|
20
|
-
* Configuration options
|
|
21
|
-
*
|
|
21
|
+
* Configuration options - {@link CmcdConfigOptions}.
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { CmcdConfig } from '@gcorevideo/player'
|
|
25
|
+
* Player.registerPlugin(CmcdConfig)
|
|
26
|
+
*
|
|
27
|
+
* const player = new Player({
|
|
28
|
+
* source: 'https://example.com/video.mp4',
|
|
29
|
+
* cmcd: {
|
|
30
|
+
* sessionId: '1234567890',
|
|
31
|
+
* contentId: 'f572d396fae9206628714fb2ce00f72e94f2258f',
|
|
32
|
+
* },
|
|
33
|
+
* })
|
|
34
|
+
* ```
|
|
22
35
|
*/
|
|
23
36
|
export declare class CmcdConfig extends CorePlugin {
|
|
24
37
|
private sid;
|
|
25
38
|
private cid;
|
|
26
39
|
/**
|
|
27
|
-
* @
|
|
40
|
+
* @internal
|
|
28
41
|
*/
|
|
29
42
|
get name(): string;
|
|
43
|
+
/**
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
30
46
|
get version(): string;
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
31
50
|
get supportedVersion(): string;
|
|
32
51
|
constructor(core: Core);
|
|
33
52
|
/**
|
|
34
|
-
* @
|
|
53
|
+
* @internal
|
|
35
54
|
*/
|
|
36
55
|
bindEvents(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Returns the current `sid` and `cid` values.
|
|
58
|
+
* Useful when the auto-generated values need to be known.
|
|
59
|
+
* @returns `sid` and `cid` values
|
|
60
|
+
*/
|
|
37
61
|
exportIds(): {
|
|
38
62
|
sid: string;
|
|
39
63
|
cid: string;
|
|
40
64
|
};
|
|
41
65
|
private updateSettings;
|
|
42
|
-
private updateHlsjsSettings;
|
|
43
66
|
private generateContentId;
|
|
44
67
|
}
|
|
45
68
|
//# sourceMappingURL=CmcdConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CmcdConfig.d.ts","sourceRoot":"","sources":["../../../src/plugins/cmcd-config/CmcdConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,IAAI,EAAE,UAAU,EAAU,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"CmcdConfig.d.ts","sourceRoot":"","sources":["../../../src/plugins/cmcd-config/CmcdConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,IAAI,EAAE,UAAU,EAAU,MAAM,cAAc,CAAA;AA4BrE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAID;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,UAAW,SAAQ,UAAU;IACxC,OAAO,CAAC,GAAG,CAAQ;IAEnB,OAAO,CAAC,GAAG,CAAK;IAEhB;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,OAAO,WAEV;IAED;;OAEG;IACH,IAAI,gBAAgB,WAEnB;gBAEW,IAAI,EAAE,IAAI;IAMtB;;OAEG;IACM,UAAU;IAMnB;;;;OAIG;IACH,SAAS,IAAI;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;YAO3B,cAAc;IA8B5B,OAAO,CAAC,iBAAiB;CAK1B"}
|