@gcorevideo/player 2.16.17 → 2.18.0
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/README.md +68 -19
- package/dist/index.js +272 -125
- package/dist/player.d.ts +230 -73
- package/docs/api/index.md +1 -1
- package/docs/api/player.containersize.md +19 -0
- package/docs/api/player.dashsettings.md +2 -0
- package/docs/api/player.errorlevel.md +1 -0
- package/docs/api/player.langtag.md +6 -0
- package/docs/api/player.md +59 -24
- package/docs/api/player.mediatransport.md +1 -0
- package/docs/api/player.playbackerror.code.md +2 -0
- package/docs/api/player.playbackerror.description.md +2 -0
- package/docs/api/player.playbackerror.level.md +2 -0
- package/docs/api/player.playbackerror.md +43 -4
- package/docs/api/player.playbackerror.message.md +2 -0
- package/docs/api/player.playbackerror.origin.md +21 -0
- package/docs/api/player.playbackerror.scope.md +16 -0
- package/docs/api/player.playbackerrorcode.md +8 -7
- package/docs/api/player.playbackmodule.md +1 -0
- package/docs/api/player.player.attachto.md +26 -0
- package/docs/api/player.player.configure.md +6 -2
- package/docs/api/player.player.destroy.md +1 -1
- package/docs/api/player.player.getcurrenttime.md +6 -2
- package/docs/api/player.player.getduration.md +4 -0
- package/docs/api/player.player.getvolume.md +22 -0
- package/docs/api/player.player.isdvrenabled.md +20 -0
- package/docs/api/player.player.isdvrinuse.md +24 -0
- package/docs/api/player.player.isplaying.md +20 -0
- package/docs/api/player.player.md +76 -8
- package/docs/api/player.player.mute.md +1 -1
- package/docs/api/player.player.off.md +5 -5
- package/docs/api/player.player.on.md +5 -5
- package/docs/api/player.player.registerplugin.md +14 -1
- package/docs/api/player.player.resize.md +6 -5
- package/docs/api/player.player.seek.md +1 -1
- package/docs/api/player.player.setvolume.md +56 -0
- package/docs/api/player.player.unmute.md +1 -1
- package/docs/api/player.player.unregisterplugin.md +2 -2
- package/docs/api/player.playercomponenttype.md +16 -0
- package/docs/api/player.playerdebugsettings.md +1 -1
- package/docs/api/player.playerdebugtag.md +1 -0
- package/docs/api/player.playerevent.md +96 -0
- package/docs/api/player.playereventhandler.md +3 -2
- package/docs/api/player.playereventparams.md +20 -0
- package/docs/api/player.playermediasourcedesc.md +1 -1
- package/docs/api/player.playermediasourcedesc.mimetype.md +1 -1
- package/docs/api/player.qualitylevel.bitrate.md +16 -0
- package/docs/api/player.qualitylevel.height.md +16 -0
- package/docs/api/player.qualitylevel.level.md +16 -0
- package/docs/api/player.qualitylevel.md +104 -7
- package/docs/api/player.qualitylevel.width.md +16 -0
- package/docs/api/player.timeposition.current.md +16 -0
- package/docs/api/player.timeposition.md +65 -7
- package/docs/api/player.timeposition.total.md +16 -0
- package/docs/api/player.timevalue.md +1 -1
- package/docs/api/player.translationsettings.md +7 -1
- package/docs/api/player.transportpreference.md +1 -0
- package/lib/Player.d.ts +107 -26
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +161 -77
- package/lib/index.d.ts +2 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -3
- package/lib/internal.types.d.ts +3 -5
- package/lib/internal.types.d.ts.map +1 -1
- package/lib/playback/dash-playback/DashPlayback.d.ts +2 -0
- package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
- package/lib/playback/dash-playback/DashPlayback.js +37 -25
- package/lib/playback/hls-playback/HlsPlayback.d.ts +3 -0
- package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
- package/lib/playback/hls-playback/HlsPlayback.js +33 -18
- package/lib/playback.types.d.ts +65 -6
- package/lib/playback.types.d.ts.map +1 -1
- package/lib/playback.types.js +10 -0
- package/lib/types.d.ts +54 -5
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js +31 -2
- package/package.json +1 -1
- package/rollup.config.js +1 -1
- package/src/Player.ts +202 -91
- package/src/__tests__/Player.test.ts +9 -3
- package/src/index.ts +2 -3
- package/src/internal.types.ts +3 -2
- package/src/playback/dash-playback/DashPlayback.ts +64 -35
- package/src/playback/hls-playback/HlsPlayback.ts +46 -22
- package/src/playback.types.ts +65 -5
- package/src/types.ts +56 -6
- package/src/utils/__tests__/mediaSources.test.ts +8 -2
- package/temp/player.api.json +771 -106
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/DashPlayback-BRJzl8D8.js +0 -901
|
@@ -2,19 +2,116 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@gcorevideo/player](./player.md) > [QualityLevel](./player.qualitylevel.md)
|
|
4
4
|
|
|
5
|
-
## QualityLevel
|
|
5
|
+
## QualityLevel interface
|
|
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
|
+
A level of quality within a media source.
|
|
10
11
|
|
|
11
12
|
**Signature:**
|
|
12
13
|
|
|
13
14
|
```typescript
|
|
14
|
-
export
|
|
15
|
-
level: number;
|
|
16
|
-
width: number;
|
|
17
|
-
height: number;
|
|
18
|
-
bitrate: number;
|
|
19
|
-
};
|
|
15
|
+
export interface QualityLevel
|
|
20
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
|
+
[bitrate](./player.qualitylevel.bitrate.md)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
</td><td>
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
</td><td>
|
|
50
|
+
|
|
51
|
+
number
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
</td><td>
|
|
55
|
+
|
|
56
|
+
**_(BETA)_** Bitrate of the video, bps.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
</td></tr>
|
|
60
|
+
<tr><td>
|
|
61
|
+
|
|
62
|
+
[height](./player.qualitylevel.height.md)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
</td><td>
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
</td><td>
|
|
69
|
+
|
|
70
|
+
number
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
</td><td>
|
|
74
|
+
|
|
75
|
+
**_(BETA)_** Height of the video, pixels.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
</td></tr>
|
|
79
|
+
<tr><td>
|
|
80
|
+
|
|
81
|
+
[level](./player.qualitylevel.level.md)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
</td><td>
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
</td><td>
|
|
88
|
+
|
|
89
|
+
number
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
</td><td>
|
|
93
|
+
|
|
94
|
+
**_(BETA)_** Zero-based index of the quality level.
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
</td></tr>
|
|
98
|
+
<tr><td>
|
|
99
|
+
|
|
100
|
+
[width](./player.qualitylevel.width.md)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
</td><td>
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
</td><td>
|
|
107
|
+
|
|
108
|
+
number
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
</td><td>
|
|
112
|
+
|
|
113
|
+
**_(BETA)_** Width of the video, pixels.
|
|
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) > [QualityLevel](./player.qualitylevel.md) > [width](./player.qualitylevel.width.md)
|
|
4
|
+
|
|
5
|
+
## QualityLevel.width 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
|
+
Width of the video, pixels.
|
|
11
|
+
|
|
12
|
+
**Signature:**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
width: number;
|
|
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) > [TimePosition](./player.timeposition.md) > [current](./player.timeposition.current.md)
|
|
4
|
+
|
|
5
|
+
## TimePosition.current 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
|
+
Current playback time, 0..duration, seconds.
|
|
11
|
+
|
|
12
|
+
**Signature:**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
current: TimeValue;
|
|
16
|
+
```
|
|
@@ -2,20 +2,78 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@gcorevideo/player](./player.md) > [TimePosition](./player.timeposition.md)
|
|
4
4
|
|
|
5
|
-
## TimePosition
|
|
5
|
+
## TimePosition interface
|
|
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
|
-
|
|
10
|
+
Current playback time and total duration of the media.
|
|
11
11
|
|
|
12
12
|
**Signature:**
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
|
-
export
|
|
16
|
-
current: TimeValue;
|
|
17
|
-
total: TimeValue;
|
|
18
|
-
};
|
|
15
|
+
export interface TimePosition
|
|
19
16
|
```
|
|
20
|
-
**References:** [TimeValue](./player.timevalue.md)
|
|
21
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
|
+
[current](./player.timeposition.current.md)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
</td><td>
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
</td><td>
|
|
50
|
+
|
|
51
|
+
[TimeValue](./player.timevalue.md)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
</td><td>
|
|
55
|
+
|
|
56
|
+
**_(BETA)_** Current playback time, 0..duration, seconds.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
</td></tr>
|
|
60
|
+
<tr><td>
|
|
61
|
+
|
|
62
|
+
[total](./player.timeposition.total.md)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
</td><td>
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
</td><td>
|
|
69
|
+
|
|
70
|
+
[TimeValue](./player.timevalue.md)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
</td><td>
|
|
74
|
+
|
|
75
|
+
**_(BETA)_** Total duration of the media, seconds.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
</td></tr>
|
|
79
|
+
</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) > [TimePosition](./player.timeposition.md) > [total](./player.timeposition.total.md)
|
|
4
|
+
|
|
5
|
+
## TimePosition.total 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
|
+
Total duration of the media, seconds.
|
|
11
|
+
|
|
12
|
+
**Signature:**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
total: TimeValue;
|
|
16
|
+
```
|
|
@@ -7,7 +7,7 @@
|
|
|
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
|
-
Playback time in seconds since the beginning of the stream (or a segment for the live streams)
|
|
10
|
+
Playback time in seconds since the beginning of the stream (or a segment for the live streams)
|
|
11
11
|
|
|
12
12
|
**Signature:**
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@
|
|
|
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
|
-
|
|
10
|
+
Localization strings for the player UI.
|
|
11
11
|
|
|
12
12
|
**Signature:**
|
|
13
13
|
|
|
@@ -16,6 +16,12 @@ export type TranslationSettings = Partial<Record<LangTag, Record<TranslationKey,
|
|
|
16
16
|
```
|
|
17
17
|
**References:** [LangTag](./player.langtag.md)<!-- -->, [TranslationKey](./player.translationkey.md)
|
|
18
18
|
|
|
19
|
+
## Remarks
|
|
20
|
+
|
|
21
|
+
The keys are language codes, and the values are objects with keys being the translation keys and values being the translations.
|
|
22
|
+
|
|
23
|
+
This dictionary is used to localize the player UI, including the error messages and is shared across all the player components (including the plugins).
|
|
24
|
+
|
|
19
25
|
## Example
|
|
20
26
|
|
|
21
27
|
|
package/lib/Player.d.ts
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
import type { PlayerPlugin } from './types.js';
|
|
1
|
+
import type { ContainerSize, PlayerPlugin } from './types.js';
|
|
2
2
|
import { PlayerConfig, PlayerEvent } from './types.js';
|
|
3
|
+
import { PlaybackError, TimePosition } from './playback.types.js';
|
|
3
4
|
/**
|
|
4
5
|
* @beta
|
|
5
6
|
*/
|
|
6
|
-
export type
|
|
7
|
+
export type PlayerEventParams<E extends PlayerEvent> = E extends PlayerEvent.Seek ? [number] : E extends PlayerEvent.VolumeUpdate ? [number] : E extends PlayerEvent.TimeUpdate ? [TimePosition] : E extends PlayerEvent.Resize ? [{
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}] : E extends PlayerEvent.Fullscreen ? [boolean] : E extends PlayerEvent.Error ? [PlaybackError] : [];
|
|
7
11
|
/**
|
|
12
|
+
* Type of a listener callback function for a player event.
|
|
13
|
+
* See the description of the event parameters in {@link PlayerEvent}.
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
export type PlayerEventHandler<E extends PlayerEvent> = (...args: PlayerEventParams<E>) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Module to perform the playback.
|
|
8
19
|
* @beta
|
|
9
20
|
*/
|
|
10
21
|
export type PlaybackModule = 'dash' | 'hls' | 'html5_video';
|
|
11
22
|
/**
|
|
12
23
|
* The main component to use in the application code.
|
|
24
|
+
* @beta
|
|
13
25
|
* @remarks
|
|
14
26
|
* The Player object provides very basic API to control playback.
|
|
15
27
|
* To build a sophisticated UI, use the plugins framework to tap into the Clappr core.
|
|
16
28
|
* {@link https://github.com/clappr/clappr/wiki/Architecture}
|
|
17
|
-
* @beta
|
|
18
29
|
*/
|
|
19
30
|
export declare class Player {
|
|
20
31
|
private config;
|
|
@@ -27,50 +38,95 @@ export declare class Player {
|
|
|
27
38
|
constructor(config: PlayerConfig);
|
|
28
39
|
/**
|
|
29
40
|
* Adds a listener to a player event
|
|
30
|
-
* @param event -
|
|
31
|
-
* @param handler -
|
|
41
|
+
* @param event - event type, see {@link PlayerEvent}
|
|
42
|
+
* @param handler - a callback function to handle the event
|
|
32
43
|
*/
|
|
33
|
-
on<
|
|
44
|
+
on<E extends PlayerEvent>(event: E, handler: PlayerEventHandler<E>): void;
|
|
34
45
|
/**
|
|
35
|
-
* Removes a
|
|
46
|
+
* Removes a previously added event listener
|
|
36
47
|
* @param event - See {@link PlayerEvent}
|
|
37
|
-
* @param handler -
|
|
48
|
+
* @param handler - a callback attached earlier to that event type
|
|
38
49
|
*/
|
|
39
|
-
off<
|
|
50
|
+
off<E extends PlayerEvent>(event: E, handler: PlayerEventHandler<E>): void;
|
|
40
51
|
/**
|
|
41
52
|
* Configures the player.
|
|
42
53
|
*
|
|
43
|
-
* Can be called multiple times. Each consequent call extends the previous configuration.
|
|
44
|
-
* After a reconfiguration, if something significant has changed, the must be reinitialized (i.e, a `.destroy()` followed by an `.init()` call).
|
|
45
|
-
*
|
|
46
54
|
* @param config - complete or partial configuration
|
|
55
|
+
* @remarks
|
|
56
|
+
* Can be called multiple times.
|
|
57
|
+
* Each consequent call extends the previous configuration with only the new keys overridden.
|
|
58
|
+
*
|
|
59
|
+
* After a reconfiguration, if something significant has changed, it might make sense reinitialize the player (i.e, a `.destroy()` followed by an `.init()` call).
|
|
47
60
|
*/
|
|
48
61
|
configure(config: Partial<PlayerConfig>): void;
|
|
49
62
|
/**
|
|
50
63
|
* Initializes the player at the given container element.
|
|
51
64
|
* @param playerElement - DOM element to host the player
|
|
65
|
+
* @remarks
|
|
66
|
+
* The player will be initialized and attached to the given element.
|
|
67
|
+
*
|
|
68
|
+
* All the core plugins will be initialized at this point.
|
|
69
|
+
*
|
|
70
|
+
* If no sources were configured, it will trigger an error.
|
|
71
|
+
*
|
|
72
|
+
* The player container will be initialized and then all the registered UI plugins.
|
|
73
|
+
*
|
|
74
|
+
* If the `autoPlay` option is set, then it will trigger playback immediately.
|
|
75
|
+
*
|
|
76
|
+
* It is an error to call this method twice. If you need to attache player to another DOM element,
|
|
77
|
+
* first call {@link Player.destroy} and then {@link Player.attachTo}.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* const player = new Player({
|
|
82
|
+
* sources: [{ source: 'https://example.com/a.mpd', mimeType: 'application/dash+xml' }],
|
|
83
|
+
* })
|
|
84
|
+
* document.addEventListener('DOMContentLoaded', () => {
|
|
85
|
+
* player.attachTo(document.getElementById('video-container'))
|
|
86
|
+
* })
|
|
87
|
+
* ```
|
|
52
88
|
*/
|
|
53
89
|
attachTo(playerElement: HTMLElement): void;
|
|
54
90
|
/**
|
|
55
|
-
* Destroys the player, releasing all resources and
|
|
91
|
+
* Destroys the player, releasing all resources and unmounting its UI from the DOM.
|
|
56
92
|
*/
|
|
57
93
|
destroy(): void;
|
|
58
94
|
/**
|
|
59
|
-
* Current playback time
|
|
60
|
-
*
|
|
95
|
+
* Current playback (time since the beginning of the stream), if appropriate.
|
|
96
|
+
*
|
|
97
|
+
* @returns Time in seconds
|
|
98
|
+
* @remarks
|
|
99
|
+
* For live streams, it returns the current time within the current segment.
|
|
61
100
|
*/
|
|
62
101
|
getCurrentTime(): number;
|
|
63
102
|
/**
|
|
64
103
|
* Duration of the current media in seconds, if appropriate.
|
|
65
|
-
*
|
|
104
|
+
*
|
|
105
|
+
* @returns Time in seconds
|
|
106
|
+
* @remarks
|
|
107
|
+
* For live streams, it returns the duration of the current segment.
|
|
66
108
|
*/
|
|
67
109
|
getDuration(): number;
|
|
68
110
|
/**
|
|
69
|
-
*
|
|
111
|
+
* Indicates whether DVR is enabled.
|
|
112
|
+
*/
|
|
113
|
+
isDvrEnabled(): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Indicates whether DVR is in use.
|
|
116
|
+
* @remarks
|
|
117
|
+
* DVR mode, if it is enabled, is triggered we a user seeks behind the live edge.
|
|
118
|
+
*/
|
|
119
|
+
isDvrInUse(): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Indicates the playing state.
|
|
122
|
+
*/
|
|
123
|
+
isPlaying(): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Mutes the sound of the video.
|
|
70
126
|
*/
|
|
71
127
|
mute(): void;
|
|
72
128
|
/**
|
|
73
|
-
* Unmutes the
|
|
129
|
+
* Unmutes the video sound.
|
|
74
130
|
*/
|
|
75
131
|
unmute(): void;
|
|
76
132
|
/**
|
|
@@ -84,37 +140,62 @@ export declare class Player {
|
|
|
84
140
|
/**
|
|
85
141
|
* Resizes the player container element and everything within it.
|
|
86
142
|
* @param newSize - new size of the player
|
|
143
|
+
* @remarks
|
|
144
|
+
* Use this method when the player itself does not detect properly the change in size of its container element.
|
|
145
|
+
* It can be a case for orientation change on some mobile devices.
|
|
87
146
|
*/
|
|
88
|
-
resize(newSize:
|
|
89
|
-
width: number;
|
|
90
|
-
height: number;
|
|
91
|
-
}): void;
|
|
147
|
+
resize(newSize: ContainerSize): void;
|
|
92
148
|
/**
|
|
93
149
|
* Seeks to the given time.
|
|
94
|
-
* @param time - time to seek to in seconds
|
|
150
|
+
* @param time - time to seek to in seconds (since the beginning of the stream)
|
|
95
151
|
*/
|
|
96
152
|
seek(time: number): void;
|
|
153
|
+
/**
|
|
154
|
+
* Gets the current volume of the media content being played.
|
|
155
|
+
* @returns a number between 0 and 1
|
|
156
|
+
*/
|
|
157
|
+
getVolume(): number;
|
|
158
|
+
/**
|
|
159
|
+
* Sets the current volume of the media content being played.
|
|
160
|
+
* @param volume - a number between 0 and 1
|
|
161
|
+
*/
|
|
162
|
+
setVolume(volume: number): void;
|
|
97
163
|
/**
|
|
98
164
|
* Stops playback.
|
|
99
165
|
*/
|
|
100
166
|
stop(): void;
|
|
101
167
|
/**
|
|
102
168
|
* Registers a plugin.
|
|
103
|
-
* @param plugin - plugin
|
|
169
|
+
* @param plugin - a plugin class
|
|
170
|
+
* @remarks
|
|
171
|
+
* Use this method to extend the player with custom behavior.
|
|
172
|
+
* The plugin class must inherit from one of the Clappr UIPlugin, UIContainerPlugin or CorePlugin classes.
|
|
173
|
+
* A core plugin will be initialized and attached to the player when the player is initialized.
|
|
174
|
+
* A UI plugin will be initialized and attached to the player container is initialized.
|
|
175
|
+
*
|
|
176
|
+
* @see {@link https://github.com/clappr/clappr/wiki/Architecture}
|
|
177
|
+
* @example
|
|
178
|
+
* ```ts
|
|
179
|
+
* import MyPlugin from './MyPlugin.js'
|
|
180
|
+
*
|
|
181
|
+
* Player.registerPlugin(MyPlugin)
|
|
182
|
+
* ```
|
|
104
183
|
*/
|
|
105
184
|
static registerPlugin(plugin: PlayerPlugin): void;
|
|
106
185
|
/**
|
|
107
|
-
* Unregisters a plugin.
|
|
108
|
-
* @param plugin - plugin
|
|
186
|
+
* Unregisters a plugin registered earlier with {@link Player.registerPlugin}.
|
|
187
|
+
* @param plugin - a plugin class
|
|
109
188
|
*/
|
|
110
189
|
static unregisterPlugin(plugin: PlayerPlugin): void;
|
|
111
190
|
private setConfig;
|
|
112
191
|
private initPlayer;
|
|
113
192
|
private tuneIn;
|
|
193
|
+
private safeTriggerEvent;
|
|
114
194
|
private events;
|
|
115
195
|
private buildCoreOptions;
|
|
116
196
|
private configurePlaybacks;
|
|
117
197
|
private buildMediaSourcesList;
|
|
118
198
|
private bindContainerEventListeners;
|
|
199
|
+
private bindSizeManagementListeners;
|
|
119
200
|
}
|
|
120
201
|
//# sourceMappingURL=Player.d.ts.map
|
package/lib/Player.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["../src/Player.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAyB,YAAY,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["../src/Player.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,aAAa,EAAyB,YAAY,EAAE,MAAM,YAAY,CAAA;AACpF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAMtD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAEjE;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CA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