@annoto/widget-api 3.65.0-alpha.0 → 3.66.0-alpha.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.
@@ -24,11 +24,11 @@ export interface ICaptureUIEventCallbackParams {
24
24
  eventCanceledCb?: () => void;
25
25
  }
26
26
  /**
27
- * @description Annoto Player Adaptor API
27
+ * Annoto Player Adaptor API
28
28
  */
29
29
  export interface IPlayerAdaptorApi {
30
30
  /**
31
- * @description This method is called by Annoto as the first method.
31
+ * This method is called by Annoto as the first method.
32
32
  * Use it to configure the player interface object.
33
33
  * If the method returns false, Annoto will retry a number of times with fixed
34
34
  * period of time between the retries.
@@ -42,42 +42,42 @@ export interface IPlayerAdaptorApi {
42
42
  */
43
43
  init(element: Element, params?: any): boolean | Promise<boolean>;
44
44
  /**
45
- * @description (OPTIONAL) called by Annoto to release resources when the widget is closing.
45
+ * (OPTIONAL) called by Annoto to release resources when the widget is closing.
46
46
  * NOTICE: Although optional this method is highly recommended if you use Annoto API
47
47
  * to dynamically load and close the widget.
48
48
  * The adaptor implementation should discard the events that were regsitered using the onReady, onPlay, etc. when remove() is called.
49
49
  */
50
50
  remove?(): void | Promise<void>;
51
51
  /**
52
- * @description Start playing the media
52
+ * Start playing the media
53
53
  */
54
54
  play(): void | Promise<void>;
55
55
  /**
56
- * @description Pause the media
56
+ * Pause the media
57
57
  */
58
58
  pause(): void | Promise<void>;
59
59
  /**
60
- * @description set default text track (captions/subtitles) if available.
60
+ * set default text track (captions/subtitles) if available.
61
61
  */
62
62
  setDefaultTextTrack?(textTrack?: ITextTrack): void | Promise<void>;
63
63
  /**
64
- * @description Set the media current time of track (skip/seek to time of the track)
64
+ * Set the media current time of track (skip/seek to time of the track)
65
65
  * @param time - in seconds
66
66
  */
67
67
  setCurrentTime(time: number): void | Promise<void>;
68
68
  /**
69
- * @description (OPTIONAL) Return if the media is a live stream or a VOD.
69
+ * (OPTIONAL) Return if the media is a live stream or a VOD.
70
70
  * NOTE: if the method is not implemented VOD is assumed.
71
71
  * @returns {boolean | Promise<boolean>}
72
72
  */
73
73
  isLive?(): boolean | Promise<boolean>;
74
74
  /**
75
- * @description Get time of current playback position.
75
+ * Get time of current playback position.
76
76
  * @returns {Number | Promise<number>} - in seconds. Preferred Floating point precision.
77
77
  */
78
78
  currentTime(): number | Promise<number>;
79
79
  /**
80
- * @description Get the total media track duration in seconds
80
+ * Get the total media track duration in seconds
81
81
  * 0 or NaN or 'undefined' values may be returned until media is ready.
82
82
  * Note: For live video for best experience return the latest known duration of the stream.
83
83
  * (for DVR enabled live stream, it can defer from currentTime)
@@ -85,38 +85,38 @@ export interface IPlayerAdaptorApi {
85
85
  */
86
86
  duration(): number | Promise<number>;
87
87
  /**
88
- * @description Get player playback state (playing or paused)
88
+ * Get player playback state (playing or paused)
89
89
  * @returns {boolean | Promise<boolean>} - true if pause, false if playing
90
90
  */
91
91
  paused(): boolean | Promise<boolean>;
92
92
  /**
93
- * @description Get currently played media source. The returned value, identifies
93
+ * Get currently played media source. The returned value, identifies
94
94
  * the current video and must be unique. It can be a full URL or an unique identifier.
95
95
  * Notice: this value can be overriden by hooks.mediaDetails widget configuration.
96
96
  * @returns {string | Promise<string>}
97
97
  */
98
98
  mediaSrc(): string | Promise<string>;
99
99
  /**
100
- * @description (OPTIONAL) Get Details for the media.
100
+ * (OPTIONAL) Get Details for the media.
101
101
  * Notice: this value can be overriden by hooks.mediaDetails widget configuration.
102
102
  * @return {IMediaDetails | Promise<IMediaDetails>}
103
103
  */
104
104
  mediaMetadata?(): IMediaDetails | Promise<IMediaDetails>;
105
105
  /**
106
- * @description (OPTIONAL) Get player autoplay configuration option
106
+ * (OPTIONAL) Get player autoplay configuration option
107
107
  * (if player configured to play on page load)
108
108
  * @returns {boolean | Promise<boolean>}
109
109
  */
110
110
  autoplay?(): boolean | Promise<boolean>;
111
111
  /**
112
- * @description (OPTIONAL) Get player full screen state.
112
+ * (OPTIONAL) Get player full screen state.
113
113
  * NOTE: if not supported the function must be undefined.
114
114
  * Annoto will use other methods to detect full screen.
115
115
  * @returns {boolean}
116
116
  */
117
117
  fullScreen?(): boolean;
118
118
  /**
119
- * @description (OPTIONAL) By default Annoto will try applying a fix
119
+ * (OPTIONAL) By default Annoto will try applying a fix
120
120
  * To enable Annoto to work when player enters Full screen. The fix is
121
121
  * moving annoto-app container as a child of the player element or embeddableElement()
122
122
  * annoto-app will be moved only if the player element allows it (is NOT an IFRAME).
@@ -127,7 +127,7 @@ export interface IPlayerAdaptorApi {
127
127
  */
128
128
  fixFullScreen?(): boolean;
129
129
  /**
130
- * @description (OPTIONAL) Get player controls Element for embedding
130
+ * (OPTIONAL) Get player controls Element for embedding
131
131
  * annoto timeline for overlay and full screen mode.
132
132
  * NOTE: Although this method is optional it's highly recomended and will make the integration
133
133
  * much simpler, imrove performance and provide better User experience.
@@ -136,28 +136,28 @@ export interface IPlayerAdaptorApi {
136
136
  */
137
137
  controlsElement?(): Element;
138
138
  /**
139
- * @description (OPTIONAL) Get player Element for embedding annoto application for full screen state.
139
+ * (OPTIONAL) Get player Element for embedding annoto application for full screen state.
140
140
  * If not provided the main player Element would be used (the element provided at init()).
141
141
  * NOTE: if not supported the function must be undefined.
142
142
  * @returns {Element}
143
143
  */
144
144
  embeddableElement?(): Element;
145
145
  /**
146
- * @description (OPTIONAL) Get player width in pixels.
146
+ * (OPTIONAL) Get player width in pixels.
147
147
  * NOTE: if not supported the function must be undefined.
148
148
  * Annoto will use other methods to detect width of the player.
149
149
  * @returns {number | string} if string, may contain 'px'
150
150
  */
151
151
  width?(): number | string;
152
152
  /**
153
- * @description (OPTIONAL) Get player height in pixels.
153
+ * (OPTIONAL) Get player height in pixels.
154
154
  * NOTE: if not supported the function must be undefined.
155
155
  * Annoto will use other methods to detect height of the player.
156
156
  * @returns {number | string} if string, may contain 'px'
157
157
  */
158
158
  height?(): number | string;
159
159
  /**
160
- * @description Feature support flag. If set to true, indicates that
160
+ * Feature support flag. If set to true, indicates that
161
161
  * the player has support for side panel layout, including for full screen.
162
162
  * Player that supports side panel layout, must reserve space for the widget, if requested by the widget.
163
163
  * The widget applies number of classes and css variables to the player element:
@@ -167,70 +167,70 @@ export interface IPlayerAdaptorApi {
167
167
  */
168
168
  readonly sidePanelSupported?: boolean;
169
169
  /**
170
- * @description cb should be called when the player is setup and the media metadata is loaded.
170
+ * cb should be called when the player is setup and the media metadata is loaded.
171
171
  * Note: This method MUST be called as the first event.
172
172
  * If your player does not support this event, simulate it by calling the cb manually.
173
173
  * @param cb
174
174
  */
175
175
  onReady(cb: PlayerEventCallback): void;
176
176
  /**
177
- * @description cb should be called when the media is played.
177
+ * cb should be called when the media is played.
178
178
  * @param cb
179
179
  */
180
180
  onPlay(cb: PlayerEventCallback): void;
181
181
  /**
182
- * @description cb should be called when the media is paused.
182
+ * cb should be called when the media is paused.
183
183
  * @param cb
184
184
  */
185
185
  onPause(cb: PlayerEventCallback): void;
186
186
  /**
187
- * @description cb should be called when the media is seeked
187
+ * cb should be called when the media is seeked
188
188
  * (playback position changes after seeking).
189
189
  * @param cb
190
190
  */
191
191
  onSeek(cb: PlayerEventCallback): void;
192
192
  /**
193
- * @description cb should be called when the media playback current time is updated.
193
+ * cb should be called when the media playback current time is updated.
194
194
  * Or when the media duration is changed.
195
195
  * can be frequent. 200 msec is a good choice for period.
196
196
  * @param cb
197
197
  */
198
198
  onTimeUpdate(cb: PlayerEventCallback): void;
199
199
  /**
200
- * @description cb should be called when the media source changes.
200
+ * cb should be called when the media source changes.
201
201
  * @param cb
202
202
  */
203
203
  onMediaChange(cb: PlayerEventCallback): void;
204
204
  /**
205
- * @description (OPTIONAL) cb should be called when media is ended
205
+ * (OPTIONAL) cb should be called when media is ended
206
206
  * NOTE: if not supported the function must be undefined.
207
207
  * Annoto will use other methods to detect media end.
208
208
  * @param cb
209
209
  */
210
210
  onEnded?(cb: PlayerEventCallback): void;
211
211
  /**
212
- * @description (OPTIONAL) cb should be called when full screen state of the player changes.
212
+ * (OPTIONAL) cb should be called when full screen state of the player changes.
213
213
  * NOTE: if not supported the function must be undefined.
214
214
  * Annoto will use other methods to detect full screen changes.
215
215
  * @param cb the callback may pass non mandatory new full screen state as boolean.
216
216
  */
217
217
  onFullScreen?(cb: (isFullScreen?: boolean) => void): void;
218
218
  /**
219
- * @description (OPTIONAL) cb should be called when player size changes.
219
+ * (OPTIONAL) cb should be called when player size changes.
220
220
  * NOTE: if not supported the function must be undefined.
221
221
  * Annoto will use other methods to detect size change.
222
222
  * @param cb
223
223
  */
224
224
  onSizeChange?(cb: PlayerEventCallback): void;
225
225
  /**
226
- * @description (OPTIONAL) cb should be called when
226
+ * (OPTIONAL) cb should be called when
227
227
  * the media element/player is taken off of a page.
228
228
  * Useful for dynamic websites.
229
229
  * @param cb
230
230
  */
231
231
  onRemove?(cb: PlayerEventCallback): void;
232
232
  /**
233
- * @description (OPTIONAL) cb should be called when click event captured on player progress bar
233
+ * (OPTIONAL) cb should be called when click event captured on player progress bar
234
234
  * or keydown event captured on player.
235
235
  * Implementation of this callback may improve interactions and fast forwarding limit functionality
236
236
  * NOTE: if not supported the function must be undefined.
@@ -238,13 +238,13 @@ export interface IPlayerAdaptorApi {
238
238
  */
239
239
  onCaptureUIEvent?(cb: CaptureUIEventCallback): void;
240
240
  /**
241
- * @description (OPTIONAL) Get player controls description parameters.
241
+ * (OPTIONAL) Get player controls description parameters.
242
242
  * The parameters describe behavior of the player controls.
243
243
  * @returns controls descriptor object
244
244
  */
245
245
  controlsDescriptor?(): IControlsDescriptor;
246
246
  /**
247
- * @description (OPTIONAL) If defined will be called at view refreshes of the widget.
247
+ * (OPTIONAL) If defined will be called at view refreshes of the widget.
248
248
  * Allows the player to perform optional adjustments to the controls descriptor.
249
249
  * NOTE: may be called frequently, so no heavy operations should be performed.
250
250
  * @param isPhone
@@ -252,14 +252,14 @@ export interface IPlayerAdaptorApi {
252
252
  */
253
253
  updateControlsDescriptor?(isPhone: boolean, isFullScreen: boolean): void;
254
254
  /**
255
- * @description (OPTIONAL) Get player controls hidden state.
255
+ * (OPTIONAL) Get player controls hidden state.
256
256
  * NOTE: if not supported the function must be undefined.
257
257
  * Annoto will use other methods to detect controls state.
258
258
  * @returns
259
259
  */
260
260
  controlsHidden?(): boolean;
261
261
  /**
262
- * @description (OPTIONAL) Get player controls height in pixels.
262
+ * (OPTIONAL) Get player controls height in pixels.
263
263
  * If supported it will be used instead of controlsDescriptor values.
264
264
  * NOTE: if not supported the function must be undefined.
265
265
  * Annoto will use other methods to detect height of the player.
@@ -267,7 +267,7 @@ export interface IPlayerAdaptorApi {
267
267
  */
268
268
  controlsHeight?(): number | string;
269
269
  /**
270
- * @description (OPTIONAL) Get player controls track (progress bar) left margin in pixels.
270
+ * (OPTIONAL) Get player controls track (progress bar) left margin in pixels.
271
271
  * If supported it will be used instead of controlsDescriptor values.
272
272
  * NOTE: if not supported the function must be undefined.
273
273
  * Annoto will use other methods to detect height of the player.
@@ -275,7 +275,7 @@ export interface IPlayerAdaptorApi {
275
275
  */
276
276
  trackMarginLeft?(): number | string;
277
277
  /**
278
- * @description (OPTIONAL) Get player player controls track (progress bar) right margin in pixels.
278
+ * (OPTIONAL) Get player player controls track (progress bar) right margin in pixels.
279
279
  * If supported it will be used instead of controlsDescriptor values.
280
280
  * NOTE: if not supported the function must be undefined.
281
281
  * Annoto will use other methods to detect height of the player.
@@ -283,7 +283,7 @@ export interface IPlayerAdaptorApi {
283
283
  */
284
284
  trackMarginRight?(): number | string;
285
285
  /**
286
- * @description (OPTIONAL) cb should be called when player controls are shown.
286
+ * (OPTIONAL) cb should be called when player controls are shown.
287
287
  * If implemented the onControlsHide() method must be implemented as well.
288
288
  * If implemented those events will be used instead of mouse tracking
289
289
  * and controlsDescriptor.mouse parameters.
@@ -293,7 +293,7 @@ export interface IPlayerAdaptorApi {
293
293
  */
294
294
  onControlsShow?(cb: PlayerEventCallback): void;
295
295
  /**
296
- * @description (OPTIONAL) cb should be called when player controls are hidden.
296
+ * (OPTIONAL) cb should be called when player controls are hidden.
297
297
  * If implemented the onControlsShow() method must be implemented as well.
298
298
  * If implemented those events will be used instead of mouse tracking
299
299
  * and controlsDescriptor.mouse parameters.
@@ -303,7 +303,7 @@ export interface IPlayerAdaptorApi {
303
303
  */
304
304
  onControlsHide?(cb: PlayerEventCallback): void;
305
305
  /**
306
- * @description (OPTIONAL) Get the ration of width / height of the video frame itself.
306
+ * (OPTIONAL) Get the ration of width / height of the video frame itself.
307
307
  * Note: the ratio shold be of the video frame, not of the player element (it can be differnt).
308
308
  * Note: In most cases this method is not required. It is required only if the controls size
309
309
  * depends on the video frame size and not on the player element size, for example this is the
@@ -311,7 +311,7 @@ export interface IPlayerAdaptorApi {
311
311
  */
312
312
  videoRatio?(): number | null;
313
313
  /**
314
- * @description (DEPRECATED) cb should be called when mouse enters player controls.
314
+ * (DEPRECATED) cb should be called when mouse enters player controls.
315
315
  * If implemented the onControlsLeave() method must be implemented as well.
316
316
  * NOTE: In most cases this event is not required.
317
317
  * NOTE: if not supported the function must be undefined.
@@ -323,7 +323,7 @@ export interface IPlayerAdaptorApi {
323
323
  */
324
324
  onControlsEnter?(cb: PlayerEventCallback): void;
325
325
  /**
326
- * @description (DEPRECATED) cb should be called when mouse leaves player controls.
326
+ * (DEPRECATED) cb should be called when mouse leaves player controls.
327
327
  * If implemented the onControlsEnter() method must be implemented as well.
328
328
  * NOTE: In most cases this event is not required.
329
329
  * NOTE: if not supported the function must be undefined.
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../lib/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,yFAezB;IACC,mBAAmB,EAAE,WAAW,EAAE,CAAC;IACnC,iBAAiB,EAAE,WAAW,EAAE,CAAC;IACjC,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,EAAE,EAAE,sBAAsB,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,KAAG,WA2CH,CAAC"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../lib/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,GAAI,sFAe7B;IACC,mBAAmB,EAAE,WAAW,EAAE,CAAC;IACnC,iBAAiB,EAAE,WAAW,EAAE,CAAC;IACjC,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,EAAE,EAAE,sBAAsB,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,KAAG,WA2CH,CAAC"}