@flowplayer/spins 0.1.0-rc.8 → 0.2.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 +12 -30
- package/dist/index.js +23 -23
- package/dist/types.d.ts +61 -18
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { PlayerIMAConfig } from '@flowplayer/player/plugins/ads';
|
|
|
3
3
|
import { ConsentConfig } from '@flowplayer/player/plugins/consent';
|
|
4
4
|
import { ShareConfig } from '@flowplayer/player/plugins/share';
|
|
5
5
|
import { SubtitlesConfig } from '@flowplayer/player/plugins/subtitles';
|
|
6
|
-
import { ThumbnailsConfig } from '@flowplayer/player/plugins/thumbnails';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* Emitted when a new spin is created.
|
|
@@ -13,10 +12,6 @@ declare const SPIN_CREATED = "spin:created";
|
|
|
13
12
|
* Emitted when a different spin enters the viewport.
|
|
14
13
|
*/
|
|
15
14
|
declare const SPIN_IN_VIEWPORT = "spin:viewport";
|
|
16
|
-
/**
|
|
17
|
-
* Should be emitted in order to add more spins dynamically.
|
|
18
|
-
*/
|
|
19
|
-
declare const ADD_SPINS = "spins:add";
|
|
20
15
|
|
|
21
16
|
/**
|
|
22
17
|
* All supported plugin identifiers for configuring the player.
|
|
@@ -24,20 +19,61 @@ declare const ADD_SPINS = "spins:add";
|
|
|
24
19
|
declare const PlayerPlugins: readonly ["subtitles", "vtsel", "ads", "share", "thumbnails", "asel", "qsel"];
|
|
25
20
|
|
|
26
21
|
interface SpinsConfig {
|
|
22
|
+
/**
|
|
23
|
+
* The playlist value should either be a composite media ID with a playlist ID,
|
|
24
|
+
* or an array of SpinItem.
|
|
25
|
+
*
|
|
26
|
+
* @see https://developer.wowza.com/docs/wowza-flowplayer/plugins/wowza-video-platform-integration/#add-composite-media-ids
|
|
27
|
+
* @see {@link SpinItem}
|
|
28
|
+
*/
|
|
27
29
|
playlist: string | Array<SpinItem>;
|
|
30
|
+
/**
|
|
31
|
+
* Sets the language of your preference.
|
|
32
|
+
* @default english
|
|
33
|
+
* @see https://developer.wowza.com/docs/wowza-flowplayer/player/translations/#configure-translations
|
|
34
|
+
*/
|
|
28
35
|
lang?: Config["lang"];
|
|
36
|
+
/**
|
|
37
|
+
* Your token.
|
|
38
|
+
* @see https://developer.wowza.com/docs/wowza-flowplayer/player/configure/#token-configuration
|
|
39
|
+
*/
|
|
29
40
|
token?: Config["token"];
|
|
41
|
+
/**
|
|
42
|
+
* User interface configuration
|
|
43
|
+
* @see https://developer.wowza.com/docs/wowza-flowplayer/player/configure/#user-interface-configuration
|
|
44
|
+
*/
|
|
30
45
|
ui?: Config["ui"];
|
|
46
|
+
/**
|
|
47
|
+
* Ads configuration
|
|
48
|
+
* @see https://developer.wowza.com/docs/wowza-flowplayer/plugins/advertising/#ima-object-configuration
|
|
49
|
+
*/
|
|
31
50
|
ima?: PlayerIMAConfig;
|
|
51
|
+
/**
|
|
52
|
+
* Configuration for Share plugin
|
|
53
|
+
* @see https://developer.wowza.com/docs/wowza-flowplayer/plugins/sharing/
|
|
54
|
+
*/
|
|
32
55
|
share?: ShareConfig["share"];
|
|
56
|
+
/**
|
|
57
|
+
* Consent plugin configuration. A bitmask property where the possible values can be found from `Consent.tracking` and `Consent.storage` enumerations.
|
|
58
|
+
* @see https://developer.wowza.com/docs/wowza-flowplayer/plugins/consent/
|
|
59
|
+
*/
|
|
33
60
|
consent?: ConsentConfig["consent"];
|
|
34
61
|
/**
|
|
35
62
|
* A list of plugins to configure the player.
|
|
36
63
|
* @default ["subtitles", "vtsel", "ads", "share", "thumbnails", "asel"]
|
|
64
|
+
* @see https://developer.wowza.com/docs/wowza-flowplayer/plugins/about-plugins/#plugin-descriptions
|
|
37
65
|
*/
|
|
38
66
|
plugins?: (typeof PlayerPlugins)[number][];
|
|
39
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Describes an individual item used in a Spin playlist.
|
|
70
|
+
* @see {@link SpinsConfig.playlist}
|
|
71
|
+
*/
|
|
40
72
|
interface SpinItem {
|
|
73
|
+
/**
|
|
74
|
+
* The value should either be a media ID
|
|
75
|
+
* or a [Video source](https://developer.wowza.com/docs/wowza-flowplayer/player/configure#video-source)
|
|
76
|
+
*/
|
|
41
77
|
url: string | {
|
|
42
78
|
src: string;
|
|
43
79
|
type: string;
|
|
@@ -45,15 +81,27 @@ interface SpinItem {
|
|
|
45
81
|
title?: Config["title"];
|
|
46
82
|
poster?: Config["poster"];
|
|
47
83
|
description?: Config["description"];
|
|
84
|
+
/**
|
|
85
|
+
* Subtitles plugin configuration. Requires Subtitles plugin to be attached.
|
|
86
|
+
* @see https://developer.wowza.com/docs/wowza-flowplayer/plugins/html-subtitles/#configure-the-plugin
|
|
87
|
+
*/
|
|
48
88
|
subtitles?: SubtitlesConfig["subtitles"];
|
|
49
|
-
thumbnails?: ThumbnailsConfig["thumbnails"];
|
|
50
89
|
}
|
|
51
90
|
type SpinEventData = {
|
|
91
|
+
/**
|
|
92
|
+
* The SpinItem associated with the spin.
|
|
93
|
+
*/
|
|
52
94
|
config: SpinItem;
|
|
95
|
+
/**
|
|
96
|
+
* The spin container element
|
|
97
|
+
*/
|
|
53
98
|
spin: HTMLElement;
|
|
99
|
+
/**
|
|
100
|
+
* the index of the spin
|
|
101
|
+
*/
|
|
102
|
+
index: number;
|
|
54
103
|
};
|
|
55
|
-
|
|
56
|
-
interface SpinsContainer extends HTMLDivElement {
|
|
104
|
+
interface SpinsContainer extends HTMLElement {
|
|
57
105
|
/**
|
|
58
106
|
* Adds a listener for the SpinsEvents["SPIN_CREATED"] event
|
|
59
107
|
*/
|
|
@@ -65,25 +113,20 @@ interface SpinsContainer extends HTMLDivElement {
|
|
|
65
113
|
/**
|
|
66
114
|
* Removes a listener for the SpinsEvents["SPIN_IN_VIEWPORT"] event
|
|
67
115
|
*/
|
|
68
|
-
off(e: typeof SPIN_IN_VIEWPORT, handler: (e
|
|
116
|
+
off(e: typeof SPIN_IN_VIEWPORT, handler: (e?: CustomEvent<SpinEventData>) => void): void;
|
|
69
117
|
/**
|
|
70
118
|
* Removes a listener for the SpinsEvents["SPIN_CREATED"] event
|
|
71
119
|
*/
|
|
72
|
-
off(e: typeof SPIN_CREATED, handler: (e
|
|
73
|
-
/**
|
|
74
|
-
* Triggers dynamic addition of new spins
|
|
75
|
-
*/
|
|
76
|
-
emit(e: typeof ADD_SPINS, data: AddSpinsEventData): void;
|
|
120
|
+
off(e: typeof SPIN_CREATED, handler: (e?: CustomEvent<SpinEventData>) => void): void;
|
|
77
121
|
/**
|
|
78
|
-
*
|
|
122
|
+
* Add more spins dynamically.
|
|
79
123
|
*/
|
|
80
|
-
|
|
124
|
+
addSpins(spins: SpinItem[]): void;
|
|
81
125
|
}
|
|
82
126
|
declare const events: {
|
|
83
127
|
SPIN_IN_VIEWPORT: typeof SPIN_IN_VIEWPORT;
|
|
84
128
|
SPIN_CREATED: typeof SPIN_CREATED;
|
|
85
|
-
ADD_SPINS: typeof ADD_SPINS;
|
|
86
129
|
};
|
|
87
130
|
declare function createSpins(config: SpinsConfig): SpinsContainer;
|
|
88
131
|
|
|
89
|
-
export { type
|
|
132
|
+
export { type SpinEventData, type SpinItem, type SpinsConfig, type SpinsContainer, createSpins, events };
|