bitmovin-player-react-native 0.3.1 → 0.5.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.
Files changed (56) hide show
  1. package/README.md +486 -24
  2. package/RNBitmovinPlayer.podspec +5 -1
  3. package/android/build.gradle +8 -5
  4. package/android/src/main/java/com/bitmovin/player/reactnative/AnalyticsModule.kt +154 -0
  5. package/android/src/main/java/com/bitmovin/player/reactnative/DrmModule.kt +4 -5
  6. package/android/src/main/java/com/bitmovin/player/reactnative/PlayerModule.kt +41 -5
  7. package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerView.kt +318 -2
  8. package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewManager.kt +70 -9
  9. package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewPackage.kt +3 -0
  10. package/android/src/main/java/com/bitmovin/player/reactnative/SourceModule.kt +4 -5
  11. package/android/src/main/java/com/bitmovin/player/reactnative/UuidModule.kt +3 -1
  12. package/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +389 -0
  13. package/android/src/main/java/com/bitmovin/player/reactnative/extensions/Any.kt +27 -0
  14. package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReactContextExtension.kt +8 -0
  15. package/android/src/main/java/com/bitmovin/player/reactnative/extensions/ReadableArray.kt +19 -2
  16. package/android/src/main/java/com/bitmovin/player/reactnative/extensions/String.kt +8 -0
  17. package/android/src/main/java/com/bitmovin/player/reactnative/extensions/WritableMap.kt +19 -0
  18. package/android/src/main/java/com/bitmovin/player/reactnative/ui/FullscreenHandlerBridge.kt +37 -0
  19. package/android/src/main/java/com/bitmovin/player/reactnative/ui/FullscreenHandlerModule.kt +73 -0
  20. package/android/src/main/java/com/bitmovin/player/reactnative/ui/RNPictureInPictureHandler.kt +191 -0
  21. package/ios/AnalyticsModule.m +14 -0
  22. package/ios/AnalyticsModule.swift +180 -0
  23. package/ios/AudioSessionModule.m +10 -0
  24. package/ios/AudioSessionModule.swift +65 -0
  25. package/ios/Event+JSON.swift +134 -0
  26. package/ios/FullscreenHandlerBridge.swift +33 -0
  27. package/ios/FullscreenHandlerModule.m +9 -0
  28. package/ios/FullscreenHandlerModule.swift +71 -0
  29. package/ios/PlayerModule.m +6 -0
  30. package/ios/PlayerModule.swift +44 -0
  31. package/ios/RCTConvert+BitmovinPlayer.swift +382 -0
  32. package/ios/RNPlayerView+PlayerListener.swift +56 -0
  33. package/ios/RNPlayerView+UserInterfaceListener.swift +35 -0
  34. package/ios/RNPlayerView.swift +22 -0
  35. package/ios/RNPlayerViewManager.m +24 -1
  36. package/ios/RNPlayerViewManager.swift +23 -1
  37. package/lib/index.d.ts +1013 -150
  38. package/lib/index.js +251 -48
  39. package/lib/index.mjs +231 -34
  40. package/package.json +1 -1
  41. package/src/advertising.ts +155 -0
  42. package/src/analytics/collector.ts +97 -0
  43. package/src/analytics/config.ts +218 -0
  44. package/src/analytics/index.ts +2 -0
  45. package/src/audioSession.ts +47 -0
  46. package/src/components/PlayerView/events.ts +49 -3
  47. package/src/components/PlayerView/index.tsx +68 -11
  48. package/src/components/PlayerView/native.ts +4 -1
  49. package/src/events.ts +255 -0
  50. package/src/index.ts +4 -0
  51. package/src/media.ts +33 -0
  52. package/src/player.ts +57 -1
  53. package/src/source.ts +4 -0
  54. package/src/styleConfig.ts +87 -0
  55. package/src/ui/fullscreenhandler.ts +19 -0
  56. package/src/ui/fullscreenhandlerbridge.ts +59 -0
package/lib/index.d.ts CHANGED
@@ -1,5 +1,480 @@
1
1
  import { ViewStyle } from 'react-native';
2
2
 
3
+ /**
4
+ * Quartiles that can be reached during an ad playback.
5
+ */
6
+ declare enum AdQuartile {
7
+ FIRST = "first",
8
+ MID_POINT = "mid_point",
9
+ THIRD = "third"
10
+ }
11
+ /**
12
+ * The possible types an `AdSource` can be.
13
+ */
14
+ declare enum AdSourceType {
15
+ IMA = "ima",
16
+ UNKNOWN = "unknown",
17
+ PROGRESSIVE = "progressive"
18
+ }
19
+ /**
20
+ * Represents an ad source which can be assigned to an `AdItem`. An `AdItem` can have multiple `AdSource`s
21
+ * as waterfalling option.
22
+ */
23
+ interface AdSource {
24
+ /**
25
+ * The ad tag / url to the ad manifest.
26
+ */
27
+ tag: string;
28
+ /**
29
+ * The `AdSourceType` of this `AdSource`.
30
+ */
31
+ type: AdSourceType;
32
+ }
33
+ /**
34
+ * Represents an ad break which can be scheduled for playback.
35
+ *
36
+ * One single `AdItem` can have multiple `AdSource`s where all but the first act as fallback ad sources
37
+ * if the first one fails to load. The start and end of an ad break are signaled via `AdBreakStartedEvent`
38
+ * and `AdBreakFinishedEvent`.
39
+ */
40
+ interface AdItem {
41
+ /**
42
+ * The playback position at which the ad break is scheduled to start. Default value is "pre".
43
+ *
44
+ * Possible values are:
45
+ * • "pre": pre-roll ad (for VoD and Live streaming)
46
+ * • "post": post-roll ad (for VoD streaming only)
47
+ * • fractional seconds: "10", "12.5" (mid-roll ad, for VoD and Live streaming)
48
+ * • percentage of the entire video duration: "25%", "50%" (mid-roll ad, for VoD streaming only)
49
+ * • timecode hh:mm:ss.mmm: "00:10:30.000", "01:00:00.000" (mid-roll ad, for VoD streaming only)
50
+ */
51
+ position?: string;
52
+ /**
53
+ * The `AdSource`s that make up this `AdItem`. The first ad source in this array is used as the main ad.
54
+ * Subsequent ad sources act as a fallback, meaning that if the main ad source does not provide a
55
+ * valid response, the subsequent ad sources will be utilized one after another.
56
+ *
57
+ * The fallback ad sources need to have the same `AdSourceType` as the main ad source.
58
+ */
59
+ sources: AdSource[];
60
+ }
61
+ /**
62
+ * Contains configuration values regarding the ads which should be played back by the player.
63
+ */
64
+ interface AdvertisingConfig {
65
+ /**
66
+ * The ad items that are scheduled when a new playback session is started via `Player.load()`.
67
+ */
68
+ schedule: AdItem[];
69
+ }
70
+ /**
71
+ * Contains the base configuration options for an ad.
72
+ */
73
+ interface AdConfig {
74
+ /**
75
+ * Specifies how many seconds of the main video content should be replaced by ad break(s).
76
+ */
77
+ replaceContentDuration: number;
78
+ }
79
+ /**
80
+ * Holds various additional ad data.
81
+ */
82
+ interface AdData {
83
+ /**
84
+ * The average bitrate of the progressive media file as defined in the VAST response.
85
+ */
86
+ bitrate?: number;
87
+ /**
88
+ * The maximum bitrate of the streaming media file as defined in the VAST response.
89
+ */
90
+ maxBitrate?: number;
91
+ /**
92
+ * The MIME type of the media file or creative as defined in the VAST response.
93
+ */
94
+ mimeType?: string;
95
+ /**
96
+ * The minimum bitrate of the streaming media file as defined in the VAST response.
97
+ */
98
+ minBitrate?: number;
99
+ }
100
+ /**
101
+ * Defines basic properties available for every ad type.
102
+ */
103
+ interface Ad {
104
+ /**
105
+ * The url the user should be redirected to when clicking the ad.
106
+ */
107
+ clickThroughUrl?: string;
108
+ /**
109
+ * Holds various additional `AdData`.
110
+ */
111
+ data?: AdData;
112
+ /**
113
+ * The height of the ad.
114
+ */
115
+ height: number;
116
+ /**
117
+ * Identifier for the ad. This might be autogenerated.
118
+ */
119
+ id?: string;
120
+ /**
121
+ * Determines whether an ad is linear, i.e. playback of main content needs to be paused for the ad.
122
+ */
123
+ isLinear: boolean;
124
+ /**
125
+ * The corresponding media file url for the ad.
126
+ */
127
+ mediaFileUrl?: string;
128
+ /**
129
+ * The width of the ad.
130
+ */
131
+ width: number;
132
+ }
133
+ /**
134
+ * Contains information about an ad break.
135
+ */
136
+ interface AdBreak {
137
+ /**
138
+ * The ads scheduled for this `AdBreak`.
139
+ */
140
+ ads: Ad[];
141
+ /**
142
+ * The id of the corresponding `AdBreakConfig`. This will be auto-generated.
143
+ */
144
+ id: string;
145
+ /**
146
+ * The time in seconds in the media timeline the `AdBreak` is scheduled for.
147
+ */
148
+ scheduleTime: number;
149
+ }
150
+
151
+ interface NativeInstanceConfig {
152
+ /**
153
+ * Optionally user-defined string `id` for the native instance.
154
+ * Used to access a certain native instance from any point in the source code then call
155
+ * methods/properties on it.
156
+ *
157
+ * When left empty, a random `UUIDv4` is generated for it.
158
+ * @example
159
+ * Accessing or creating the `Player` with `nativeId` equal to `my-player`:
160
+ * ```
161
+ * const player = new Player({ nativeId: 'my-player' })
162
+ * player.play(); // call methods and properties...
163
+ * ```
164
+ */
165
+ nativeId?: string;
166
+ }
167
+ declare abstract class NativeInstance<Config extends NativeInstanceConfig> {
168
+ /**
169
+ * Optionally user-defined string `id` for the native instance, or UUIDv4.
170
+ */
171
+ readonly nativeId: string;
172
+ /**
173
+ * The configuration object used to initialize this instance.
174
+ */
175
+ readonly config?: Config;
176
+ /**
177
+ * Generate UUID in case the user-defined `nativeId` is empty.
178
+ */
179
+ constructor(config?: Config);
180
+ /**
181
+ * Flag indicating whether the native resources of this object have been created internally
182
+ * .i.e `initialize` has been called.
183
+ */
184
+ abstract isInitialized: boolean;
185
+ /**
186
+ * Create the native object/resources that will be managed by this instance.
187
+ */
188
+ abstract initialize(): void;
189
+ /**
190
+ * Flag indicating whether the native resources of this object have been disposed .i.e
191
+ * `destroy` has been called.
192
+ */
193
+ abstract isDestroyed: boolean;
194
+ /**
195
+ * Dispose the native object/resources created by this instance during `initialize`.
196
+ */
197
+ abstract destroy(): void;
198
+ }
199
+
200
+ /**
201
+ * Available cdn provider options for AnalyticsConfig.
202
+ */
203
+ declare enum CdnProvider {
204
+ BITMOVIN = "bitmovin",
205
+ AKAMAI = "akamai",
206
+ FASTLY = "fastly",
207
+ MAXCDN = "maxcdn",
208
+ CLOUDFRONT = "cloudfront",
209
+ CHINACACHE = "chinacache",
210
+ BITGRAVITY = "bitgravity"
211
+ }
212
+ /**
213
+ * Object used to configure a new `AnalyticsCollector` instance.
214
+ */
215
+ interface AnalyticsConfig extends NativeInstanceConfig, CustomDataConfig {
216
+ /**
217
+ * CDN Provide that the video playback session is using.
218
+ */
219
+ cdnProvider?: CdnProvider;
220
+ /**
221
+ * User ID of the customer.
222
+ */
223
+ customUserId?: string;
224
+ /**
225
+ * Experiment name needed for A/B testing.
226
+ */
227
+ experimentName?: string;
228
+ /**
229
+ * ID of the video in the CMS system.
230
+ */
231
+ videoId?: string;
232
+ /**
233
+ * Human readable title of the video asset currently playing.
234
+ */
235
+ title?: string;
236
+ /**
237
+ * Analytics key.
238
+ */
239
+ key: string;
240
+ /**
241
+ * Player key.
242
+ */
243
+ playerKey?: string;
244
+ /**
245
+ * Breadcrumb path to show where in the app the user is.
246
+ */
247
+ path?: string;
248
+ /**
249
+ * Flag to see if stream is live before stream metadata is available (default: false).
250
+ */
251
+ isLive?: boolean;
252
+ /**
253
+ * Flag to enable Ad tracking (default: false).
254
+ */
255
+ ads?: boolean;
256
+ /**
257
+ * Flag to use randomised userId not depending on device specific values (default: false).
258
+ */
259
+ randomizeUserId?: boolean;
260
+ }
261
+ interface CustomDataConfig {
262
+ /**
263
+ * Optional free-form custom data
264
+ */
265
+ customData1?: string;
266
+ /**
267
+ * Optional free-form custom data
268
+ */
269
+ customData2?: string;
270
+ /**
271
+ * Optional free-form custom data
272
+ */
273
+ customData3?: string;
274
+ /**
275
+ * Optional free-form custom data
276
+ */
277
+ customData4?: string;
278
+ /**
279
+ * Optional free-form custom data
280
+ */
281
+ customData5?: string;
282
+ /**
283
+ * Optional free-form custom data
284
+ */
285
+ customData6?: string;
286
+ /**
287
+ * Optional free-form custom data
288
+ */
289
+ customData7?: string;
290
+ /**
291
+ * Optional free-form custom data
292
+ */
293
+ customData8?: string;
294
+ /**
295
+ * Optional free-form custom data
296
+ */
297
+ customData9?: string;
298
+ /**
299
+ * Optional free-form custom data
300
+ */
301
+ customData10?: string;
302
+ /**
303
+ * Optional free-form custom data
304
+ */
305
+ customData11?: string;
306
+ /**
307
+ * Optional free-form custom data
308
+ */
309
+ customData12?: string;
310
+ /**
311
+ * Optional free-form custom data
312
+ */
313
+ customData13?: string;
314
+ /**
315
+ * Optional free-form custom data
316
+ */
317
+ customData14?: string;
318
+ /**
319
+ * Optional free-form custom data
320
+ */
321
+ customData15?: string;
322
+ /**
323
+ * Optional free-form custom data
324
+ */
325
+ customData16?: string;
326
+ /**
327
+ * Optional free-form custom data
328
+ */
329
+ customData17?: string;
330
+ /**
331
+ * Optional free-form custom data
332
+ */
333
+ customData18?: string;
334
+ /**
335
+ * Optional free-form custom data
336
+ */
337
+ customData19?: string;
338
+ /**
339
+ * Optional free-form custom data
340
+ */
341
+ customData20?: string;
342
+ /**
343
+ * Optional free-form custom data
344
+ */
345
+ customData21?: string;
346
+ /**
347
+ * Optional free-form custom data
348
+ */
349
+ customData22?: string;
350
+ /**
351
+ * Optional free-form custom data
352
+ */
353
+ customData23?: string;
354
+ /**
355
+ * Optional free-form custom data
356
+ */
357
+ customData24?: string;
358
+ /**
359
+ * Optional free-form custom data
360
+ */
361
+ customData25?: string;
362
+ /**
363
+ * Optional free-form custom data
364
+ */
365
+ customData26?: string;
366
+ /**
367
+ * Optional free-form custom data
368
+ */
369
+ customData27?: string;
370
+ /**
371
+ * Optional free-form custom data
372
+ */
373
+ customData28?: string;
374
+ /**
375
+ * Optional free-form custom data
376
+ */
377
+ customData29?: string;
378
+ /**
379
+ * Optional free-form custom data
380
+ */
381
+ customData30?: string;
382
+ }
383
+
384
+ /**
385
+ * Analytics collector that can be attached to a player object in order to collect and send
386
+ * its analytics information.
387
+ */
388
+ declare class AnalyticsCollector extends NativeInstance<AnalyticsConfig> {
389
+ /**
390
+ * Whether the native `AnalyticsCollector` object has been created.
391
+ */
392
+ isInitialized: boolean;
393
+ /**
394
+ * Whether the native `AnalyticsCollector` object has been disposed.
395
+ */
396
+ isDestroyed: boolean;
397
+ /**
398
+ * Initializes a native `BitmovinPlayerCollector` object.
399
+ */
400
+ initialize: () => void;
401
+ /**
402
+ * Disposes the native `BitmovinPlayerCollector` object that has been created
403
+ * during initialization.
404
+ */
405
+ destroy: () => void;
406
+ /**
407
+ * Attach a player instance to this analytics plugin. After this is completed, BitmovinAnalytics
408
+ * will start monitoring and sending analytics data based on the attached player instance.
409
+ *
410
+ * @param playerId - Native Id of the player to attach this collector instance.
411
+ */
412
+ attach: (playerId: string) => void;
413
+ /**
414
+ * Detach a player instance from this analytics plugin if there's any attached. If no player is attached,
415
+ * nothing happens.
416
+ */
417
+ detach: () => void;
418
+ /**
419
+ * Dynamically updates analytics custom data information. Use this method
420
+ * to update your custom data during runtime.
421
+ *
422
+ * @param customData - Analytics custom data config.
423
+ */
424
+ setCustomDataOnce: (customData: CustomDataConfig) => void;
425
+ /**
426
+ * Sets the internal analytics custom data state.
427
+ *
428
+ * @param customData - Analytics custom data config.
429
+ */
430
+ setCustomData: (customData: CustomDataConfig) => void;
431
+ /**
432
+ * Gets the current custom data config from the native `BitmovinPlayerCollector` instance.
433
+ *
434
+ * @returns The current custom data config.
435
+ */
436
+ getCustomData: () => Promise<CustomDataConfig>;
437
+ /**
438
+ * Gets the current user id used by the native `BitmovinPlayerCollector` instance.
439
+ *
440
+ * @returns The current user id.
441
+ */
442
+ getUserId: () => Promise<string>;
443
+ }
444
+
445
+ /**
446
+ * An audio session category defines a set of audio behaviors.
447
+ * Choose a category that most accurately describes the audio behavior you require.
448
+ *
449
+ * Note the `playback` category is required in order to properly enable picture in picture support.
450
+ *
451
+ * - `ambient`: The category for an app in which sound playback is nonprimary — that is, your app also works with the sound turned off.
452
+ * - `multiRoute`: The category for routing distinct streams of audio data to different output devices at the same time.
453
+ * - `playAndRecord`: The category for recording (input) and playback (output) of audio, such as for a Voice over Internet Protocol (VoIP) app.
454
+ * - `playback`: The category for playing recorded music or other sounds that are central to the successful use of your app.
455
+ * - `record`: The category for recording audio while also silencing playback audio.
456
+ * - `soloAmbient`: The default audio session category.
457
+ *
458
+ * @platform iOS
459
+ * @see https://developer.apple.com/documentation/avfaudio/avaudiosession/category
460
+ */
461
+ declare type AudioSessionCategory = 'ambient' | 'multiRoute' | 'playAndRecord' | 'playback' | 'record' | 'soloAmbient';
462
+ /**
463
+ * An object that communicates to the system how you intend to use audio in your app.
464
+ *
465
+ * @platform iOS
466
+ * @see https://developer.apple.com/documentation/avfaudio/avaudiosession
467
+ */
468
+ declare const AudioSession: {
469
+ /**
470
+ * Sets the audio session's category.
471
+ *
472
+ * @platform iOS
473
+ * @see https://developer.apple.com/documentation/avfaudio/avaudiosession/1616583-setcategory
474
+ */
475
+ setCategory: (category: AudioSessionCategory) => Promise<void>;
476
+ };
477
+
3
478
  /**
4
479
  * Utility type that maps the specified optional props from the target `Type` to be
5
480
  * required props. Note all the other props stay unaffected.
@@ -69,6 +544,40 @@ interface SubtitleTrack {
69
544
  */
70
545
  declare type SideLoadedSubtitleTrack = MakeRequired<SubtitleTrack, 'url' | 'label' | 'language' | 'format'>;
71
546
 
547
+ /**
548
+ * Quality definition of a video representation.
549
+ */
550
+ interface VideoQuality {
551
+ /**
552
+ * The id of the media quality.
553
+ */
554
+ id: string;
555
+ /**
556
+ * The label of the media quality that should be exposed to the user.
557
+ */
558
+ label?: string;
559
+ /**
560
+ * The bitrate of the media quality.
561
+ */
562
+ bitrate?: number;
563
+ /**
564
+ * The codec of the media quality.
565
+ */
566
+ codec?: string;
567
+ /**
568
+ * The frame rate of the video quality. If the frame rate is not known or not applicable a value of -1 will be returned.
569
+ */
570
+ frameRate?: number;
571
+ /**
572
+ * The height of the video quality.
573
+ */
574
+ height?: number;
575
+ /**
576
+ * The width of the video quality.
577
+ */
578
+ width?: number;
579
+ }
580
+
72
581
  /**
73
582
  * Base event type for all events.
74
583
  */
@@ -118,186 +627,419 @@ interface PlayerWarningEvent extends ErrorEvent {
118
627
  /**
119
628
  * Emitted when the player is destroyed.
120
629
  */
121
- interface DestroyEvent extends Event {
630
+ interface DestroyEvent extends Event {
631
+ }
632
+ /**
633
+ * Emitted when the player is muted.
634
+ */
635
+ interface MutedEvent extends Event {
636
+ }
637
+ /**
638
+ * Emitted when the player is unmuted.
639
+ */
640
+ interface UnmutedEvent extends Event {
641
+ }
642
+ /**
643
+ * Emitted when the player is ready for immediate playback, because initial audio/video
644
+ * has been downloaded.
645
+ */
646
+ interface ReadyEvent extends Event {
647
+ }
648
+ /**
649
+ * Emitted when the player is paused.
650
+ */
651
+ interface PausedEvent extends Event {
652
+ /**
653
+ * The player's playback time from when this event happened.
654
+ */
655
+ time: number;
656
+ }
657
+ /**
658
+ * Emitted when the player received an intention to start/resume playback.
659
+ */
660
+ interface PlayEvent extends Event {
661
+ /**
662
+ * The player's playback time from when this event happened.
663
+ */
664
+ time: number;
665
+ }
666
+ /**
667
+ * Emitted when playback has started.
668
+ */
669
+ interface PlayingEvent extends Event {
670
+ /**
671
+ * The player's playback time from when this event happened.
672
+ */
673
+ time: number;
674
+ }
675
+ /**
676
+ * Emitted when the playback of the current media has finished.
677
+ */
678
+ interface PlaybackFinishedEvent extends Event {
679
+ }
680
+ /**
681
+ * Source object representation the way it appears on `Event` payloads such as `SeekEvent`, for example.
682
+ *
683
+ * This interface only type hints what should be the shape of a `Source` object inside an `Event`'s
684
+ * payload during runtime so it has no direct relation with the `Source` class present in `src/source.ts`.
685
+ *
686
+ * Do not mistake it for a `NativeInstance` type.
687
+ */
688
+ interface EventSource {
689
+ /**
690
+ * Event's source duration in seconds.
691
+ */
692
+ duration: number;
693
+ /**
694
+ * Whether this event's source is currently active in a player.
695
+ */
696
+ isActive: boolean;
697
+ /**
698
+ * Whether this event's source is currently attached to a player instance.
699
+ */
700
+ isAttachedToPlayer: boolean;
701
+ /**
702
+ * Metadata for this event's source.
703
+ */
704
+ metadata?: Record<string, any>;
705
+ }
706
+ /**
707
+ * Emitted when the player is about to seek to a new position.
708
+ * Only applies to VoD streams.
709
+ */
710
+ interface SeekEvent extends Event {
711
+ /**
712
+ * Removed source metadata.
713
+ */
714
+ from: {
715
+ time: number;
716
+ source: EventSource;
717
+ };
718
+ /**
719
+ * Added source metadata.
720
+ */
721
+ to: {
722
+ time: number;
723
+ source: EventSource;
724
+ };
725
+ }
726
+ /**
727
+ * Emitted when seeking has finished and data to continue playback is available.
728
+ * Only applies to VoD streams.
729
+ */
730
+ interface SeekedEvent extends Event {
731
+ }
732
+ /**
733
+ * Emitted when the player begins to stall and to buffer due to an empty buffer.
734
+ */
735
+ interface StallStartedEvent extends Event {
736
+ }
737
+ /**
738
+ * Emitted when the player ends stalling, due to enough data in the buffer.
739
+ */
740
+ interface StallEndedEvent extends Event {
741
+ }
742
+ /**
743
+ * Emitted when the current playback time has changed.
744
+ */
745
+ interface TimeChangedEvent extends Event {
746
+ /**
747
+ * The player's playback time from when this event happened.
748
+ */
749
+ currentTime: number;
750
+ }
751
+ /**
752
+ * Emitted when a new source loading has started.
753
+ * It doesn't mean that the loading of the new manifest has finished.
754
+ */
755
+ interface SourceLoadEvent extends Event {
756
+ /**
757
+ * Source that is about to load.
758
+ */
759
+ source: EventSource;
760
+ }
761
+ /**
762
+ * Emitted when a new source is loaded.
763
+ * It doesn't mean that the loading of the new manifest has finished.
764
+ */
765
+ interface SourceLoadedEvent extends Event {
766
+ /**
767
+ * Source that was loaded into player.
768
+ */
769
+ source: EventSource;
770
+ }
771
+ /**
772
+ * Emitted when the current source has been unloaded.
773
+ */
774
+ interface SourceUnloadedEvent extends Event {
775
+ /**
776
+ * Source that was unloaded from player.
777
+ */
778
+ source: EventSource;
779
+ }
780
+ /**
781
+ * Emitted when a source error happens.
782
+ */
783
+ interface SourceErrorEvent extends ErrorEvent {
784
+ }
785
+ /**
786
+ * Emitted when a source warning happens.
787
+ */
788
+ interface SourceWarningEvent extends ErrorEvent {
789
+ }
790
+ /**
791
+ * Emitted when a new subtitle track is added to the player.
792
+ */
793
+ interface SubtitleAddedEvent extends Event {
794
+ /**
795
+ * Subtitle track that has been added.
796
+ */
797
+ subtitleTrack: SubtitleTrack;
798
+ }
799
+ /**
800
+ * Emitted when a subtitle track is removed from the player.
801
+ */
802
+ interface SubtitleRemovedEvent extends Event {
803
+ /**
804
+ * Subtitle track that has been removed.
805
+ */
806
+ subtitleTrack: SubtitleTrack;
807
+ }
808
+ /**
809
+ * Emitted when the player's selected subtitle track has changed.
810
+ */
811
+ interface SubtitleChangedEvent extends Event {
812
+ /**
813
+ * Subtitle track that was previously selected.
814
+ */
815
+ oldSubtitleTrack: SubtitleTrack;
816
+ /**
817
+ * Subtitle track that is selected now.
818
+ */
819
+ newSubtitleTrack: SubtitleTrack;
820
+ }
821
+ /**
822
+ * Emitted when the player enters Picture in Picture mode.
823
+ *
824
+ * @platform iOS, Android
825
+ */
826
+ interface PictureInPictureEnterEvent extends Event {
827
+ }
828
+ /**
829
+ * Emitted when the player exits Picture in Picture mode.
830
+ *
831
+ * @platform iOS, Android
832
+ */
833
+ interface PictureInPictureExitEvent extends Event {
834
+ }
835
+ /**
836
+ * Emitted when the player has finished entering Picture in Picture mode on iOS.
837
+ *
838
+ * @platform iOS
839
+ */
840
+ interface PictureInPictureEnteredEvent extends Event {
841
+ }
842
+ /**
843
+ * Emitted when the player has finished exiting Picture in Picture mode on iOS.
844
+ *
845
+ * @platform iOS
846
+ */
847
+ interface PictureInPictureExitedEvent extends Event {
848
+ }
849
+ /**
850
+ * Emitted when the fullscreen functionality has been enabled.
851
+ *
852
+ * @platform iOS, Android
853
+ */
854
+ interface FullscreenEnabledEvent extends Event {
122
855
  }
123
856
  /**
124
- * Emitted when the player is muted.
857
+ * Emitted when the fullscreen functionality has been disabled.
858
+ *
859
+ * @platform iOS, Android
125
860
  */
126
- interface MutedEvent extends Event {
861
+ interface FullscreenDisabledEvent extends Event {
127
862
  }
128
863
  /**
129
- * Emitted when the player is unmuted.
864
+ * Emitted when the player enters fullscreen mode.
865
+ *
866
+ * @platform iOS, Android
130
867
  */
131
- interface UnmutedEvent extends Event {
868
+ interface FullscreenEnterEvent extends Event {
132
869
  }
133
870
  /**
134
- * Emitted when the player is ready for immediate playback, because initial audio/video
135
- * has been downloaded.
871
+ * Emitted when the player exits fullscreen mode.
872
+ *
873
+ * @platform iOS, Android
136
874
  */
137
- interface ReadyEvent extends Event {
875
+ interface FullscreenExitEvent extends Event {
138
876
  }
139
877
  /**
140
- * Emitted when the player is paused.
878
+ * Emitted when the availability of the Picture in Picture mode changed on Android.
879
+ *
880
+ * @platform Android
141
881
  */
142
- interface PausedEvent extends Event {
882
+ interface PictureInPictureAvailabilityChangedEvent extends Event {
143
883
  /**
144
- * The player's playback time from when this event happened.
884
+ * Whether Picture in Picture is available.
145
885
  */
146
- time: number;
886
+ isPictureInPictureAvailable: boolean;
147
887
  }
148
888
  /**
149
- * Emitted when the player received an intention to start/resume playback.
889
+ * Emitted when an ad break has started.
150
890
  */
151
- interface PlayEvent extends Event {
891
+ interface AdBreakStartedEvent extends Event {
152
892
  /**
153
- * The player's playback time from when this event happened.
893
+ * The `AdBreak` that has started.
154
894
  */
155
- time: number;
895
+ adBreak?: AdBreak;
156
896
  }
157
897
  /**
158
- * Emitted when playback has started.
898
+ * Emitted when an ad break has finished.
159
899
  */
160
- interface PlayingEvent extends Event {
900
+ interface AdBreakFinishedEvent extends Event {
161
901
  /**
162
- * The player's playback time from when this event happened.
902
+ * The `AdBreak` that has finished.
163
903
  */
164
- time: number;
904
+ adBreak?: AdBreak;
165
905
  }
166
906
  /**
167
- * Emitted when the playback of the current media has finished.
168
- */
169
- interface PlaybackFinishedEvent extends Event {
170
- }
171
- /**
172
- * Source object representation the way it appears on `Event` payloads such as `SeekEvent`, for example.
173
- *
174
- * This interface only type hints what should be the shape of a `Source` object inside an `Event`'s
175
- * payload during runtime so it has no direct relation with the `Source` class present in `src/source.ts`.
176
- *
177
- * Do not mistake it for a `NativeInstance` type.
907
+ * Emitted when the playback of an ad has started.
178
908
  */
179
- interface EventSource {
909
+ interface AdStartedEvent extends Event {
180
910
  /**
181
- * Event's source duration in seconds.
911
+ * The `Ad` this event is related to.
182
912
  */
183
- duration: number;
913
+ ad?: Ad;
184
914
  /**
185
- * Whether this event's source is currently active in a player.
915
+ * The target URL to open once the user clicks on the ad.
186
916
  */
187
- isActive: boolean;
917
+ clickThroughUrl?: string;
188
918
  /**
189
- * Whether this event's source is currently attached to a player instance.
919
+ * The `AdSourceType` of the started `Ad`.
190
920
  */
191
- isAttachedToPlayer: boolean;
921
+ clientType?: AdSourceType;
192
922
  /**
193
- * Metadata for this event's source.
923
+ * The duration of the ad in seconds.
194
924
  */
195
- metadata?: Record<string, any>;
196
- }
197
- /**
198
- * Emitted when the player is about to seek to a new position.
199
- * Only applies to VoD streams.
200
- */
201
- interface SeekEvent extends Event {
925
+ duration: number;
202
926
  /**
203
- * Removed source metadata.
927
+ * The index of the ad in the queue.
204
928
  */
205
- from: {
206
- time: number;
207
- source: EventSource;
208
- };
929
+ indexInQueue: number;
209
930
  /**
210
- * Added source metadata.
931
+ * The position of the corresponding `Ad`.
211
932
  */
212
- to: {
213
- time: number;
214
- source: EventSource;
215
- };
216
- }
217
- /**
218
- * Emitted when seeking has finished and data to continue playback is available.
219
- * Only applies to VoD streams.
220
- */
221
- interface SeekedEvent extends Event {
933
+ position?: string;
934
+ /**
935
+ * The skip offset of the ad in seconds.
936
+ */
937
+ skipOffset: number;
938
+ /**
939
+ * The content time at which the `Ad` is played.
940
+ */
941
+ timeOffset: number;
222
942
  }
223
943
  /**
224
- * Emitted when the current playback time has changed.
944
+ * Emitted when an ad has finished playback.
225
945
  */
226
- interface TimeChangedEvent extends Event {
946
+ interface AdFinishedEvent extends Event {
227
947
  /**
228
- * The player's playback time from when this event happened.
948
+ * The `Ad` that finished playback.
229
949
  */
230
- currentTime: number;
950
+ ad?: Ad;
231
951
  }
232
952
  /**
233
- * Emitted when a new source loading has started.
234
- * It doesn't mean that the loading of the new manifest has finished.
953
+ * Emitted when an error with the ad playback occurs.
235
954
  */
236
- interface SourceLoadEvent extends Event {
955
+ interface AdErrorEvent extends ErrorEvent {
237
956
  /**
238
- * Source that is about to load.
957
+ * The `AdConfig` for which the ad error occurred.
239
958
  */
240
- source: EventSource;
959
+ adConfig?: AdConfig;
960
+ /**
961
+ * The `AdItem` for which the ad error occurred.
962
+ */
963
+ adItem?: AdItem;
241
964
  }
242
965
  /**
243
- * Emitted when a new source is loaded.
244
- * It doesn't mean that the loading of the new manifest has finished.
966
+ * Emitted when an ad was clicked.
245
967
  */
246
- interface SourceLoadedEvent extends Event {
968
+ interface AdClickedEvent extends Event {
247
969
  /**
248
- * Source that was loaded into player.
970
+ * The click through url of the ad.
249
971
  */
250
- source: EventSource;
972
+ clickThroughUrl?: string;
251
973
  }
252
974
  /**
253
- * Emitted when the current source has been unloaded.
975
+ * Emitted when an ad was skipped.
254
976
  */
255
- interface SourceUnloadedEvent extends Event {
977
+ interface AdSkippedEvent extends Event {
256
978
  /**
257
- * Source that was unloaded from player.
979
+ * The `Ad` that was skipped.
258
980
  */
259
- source: EventSource;
981
+ ad?: Ad;
260
982
  }
261
983
  /**
262
- * Emitted when a source error happens.
984
+ * Emitted when the playback of an ad has progressed over a quartile boundary.
263
985
  */
264
- interface SourceErrorEvent extends ErrorEvent {
986
+ interface AdQuartileEvent extends Event {
987
+ /**
988
+ * The `AdQuartile` boundary that playback has progressed over.
989
+ */
990
+ quartile: AdQuartile;
265
991
  }
266
992
  /**
267
- * Emitted when a source warning happens.
993
+ * Emitted when an ad manifest was successfully downloaded, parsed and added into the ad break schedule.
268
994
  */
269
- interface SourceWarningEvent extends ErrorEvent {
995
+ interface AdScheduledEvent extends Event {
996
+ /**
997
+ * The total number of scheduled ads.
998
+ */
999
+ numberOfAds: number;
270
1000
  }
271
1001
  /**
272
- * Emitted when a new subtitle track is added to the player.
1002
+ * Emitted when the download of an ad manifest is started.
273
1003
  */
274
- interface SubtitleAddedEvent extends Event {
1004
+ interface AdManifestLoadEvent extends Event {
275
1005
  /**
276
- * Subtitle track that has been added.
1006
+ * The `AdBreak` this event is related to.
277
1007
  */
278
- subtitleTrack: SubtitleTrack;
1008
+ adBreak?: AdBreak;
1009
+ /**
1010
+ * The `AdConfig` of the loaded ad manifest.
1011
+ */
1012
+ adConfig?: AdConfig;
279
1013
  }
280
1014
  /**
281
- * Emitted when a subtitle track is removed from the player.
1015
+ * Emitted when an ad manifest was successfully loaded.
282
1016
  */
283
- interface SubtitleRemovedEvent extends Event {
1017
+ interface AdManifestLoadedEvent extends Event {
284
1018
  /**
285
- * Subtitle track that has been removed.
1019
+ * The `AdBreak` this event is related to.
286
1020
  */
287
- subtitleTrack: SubtitleTrack;
1021
+ adBreak?: AdBreak;
1022
+ /**
1023
+ * The `AdConfig` of the loaded ad manifest.
1024
+ */
1025
+ adConfig?: AdConfig;
1026
+ /**
1027
+ * How long it took for the ad tag to be downloaded in milliseconds.
1028
+ */
1029
+ downloadTime: number;
288
1030
  }
289
1031
  /**
290
- * Emitted when the player's selected subtitle track has changed.
1032
+ * Emitted when the current video playback quality has changed.
291
1033
  */
292
- interface SubtitleChangedEvent extends Event {
1034
+ interface VideoPlaybackQualityChangedEvent extends Event {
293
1035
  /**
294
- * Subtitle track that was previously selected.
1036
+ * The new quality
295
1037
  */
296
- oldSubtitleTrack: SubtitleTrack;
1038
+ newVideoQuality: VideoQuality;
297
1039
  /**
298
- * Subtitle track that is selected now.
1040
+ * The previous quality
299
1041
  */
300
- newSubtitleTrack: SubtitleTrack;
1042
+ oldVideoQuality: VideoQuality;
301
1043
  }
302
1044
 
303
1045
  /**
@@ -305,10 +1047,30 @@ interface SubtitleChangedEvent extends Event {
305
1047
  * Used to generate the specific events interface for each component.
306
1048
  */
307
1049
  interface EventProps {
1050
+ onAdBreakFinished: AdBreakFinishedEvent;
1051
+ onAdBreakStarted: AdBreakStartedEvent;
1052
+ onAdClicked: AdClickedEvent;
1053
+ onAdError: AdErrorEvent;
1054
+ onAdFinished: AdFinishedEvent;
1055
+ onAdManifestLoad: AdManifestLoadEvent;
1056
+ onAdManifestLoaded: AdManifestLoadedEvent;
1057
+ onAdQuartile: AdQuartileEvent;
1058
+ onAdScheduled: AdScheduledEvent;
1059
+ onAdSkipped: AdSkippedEvent;
1060
+ onAdStarted: AdStartedEvent;
308
1061
  onDestroy: DestroyEvent;
309
1062
  onEvent: Event;
1063
+ onFullscreenEnabled: FullscreenEnabledEvent;
1064
+ onFullscreenDisabled: FullscreenDisabledEvent;
1065
+ onFullscreenEnter: FullscreenEnterEvent;
1066
+ onFullscreenExit: FullscreenExitEvent;
310
1067
  onMuted: MutedEvent;
311
1068
  onPaused: PausedEvent;
1069
+ onPictureInPictureAvailabilityChanged: PictureInPictureAvailabilityChangedEvent;
1070
+ onPictureInPictureEnter: PictureInPictureEnterEvent;
1071
+ onPictureInPictureEntered: PictureInPictureEnteredEvent;
1072
+ onPictureInPictureExit: PictureInPictureExitEvent;
1073
+ onPictureInPictureExited: PictureInPictureExitedEvent;
312
1074
  onPlay: PlayEvent;
313
1075
  onPlaybackFinished: PlaybackFinishedEvent;
314
1076
  onPlayerActive: PlayerActiveEvent;
@@ -318,6 +1080,8 @@ interface EventProps {
318
1080
  onReady: ReadyEvent;
319
1081
  onSeek: SeekEvent;
320
1082
  onSeeked: SeekedEvent;
1083
+ onStallStarted: StallStartedEvent;
1084
+ onStallEnded: StallEndedEvent;
321
1085
  onSourceError: SourceErrorEvent;
322
1086
  onSourceLoad: SourceLoadEvent;
323
1087
  onSourceLoaded: SourceLoadedEvent;
@@ -328,6 +1092,7 @@ interface EventProps {
328
1092
  onSubtitleRemoved: SubtitleRemovedEvent;
329
1093
  onTimeChanged: TimeChangedEvent;
330
1094
  onUnmuted: UnmutedEvent;
1095
+ onVideoPlaybackQualityChanged: VideoPlaybackQualityChangedEvent;
331
1096
  }
332
1097
  /**
333
1098
  * Event props for `PlayerView`.
@@ -339,55 +1104,6 @@ declare type PlayerViewEvents = {
339
1104
  [Prop in keyof EventProps]?: (event: EventProps[Prop]) => void;
340
1105
  };
341
1106
 
342
- interface NativeInstanceConfig {
343
- /**
344
- * Optionally user-defined string `id` for the native instance.
345
- * Used to access a certain native instance from any point in the source code then call
346
- * methods/properties on it.
347
- *
348
- * When left empty, a random `UUIDv4` is generated for it.
349
- * @example
350
- * Accessing or creating the `Player` with `nativeId` equal to `my-player`:
351
- * ```
352
- * const player = new Player({ nativeId: 'my-player' })
353
- * player.play(); // call methods and properties...
354
- * ```
355
- */
356
- nativeId?: string;
357
- }
358
- declare abstract class NativeInstance<Config extends NativeInstanceConfig> {
359
- /**
360
- * Optionally user-defined string `id` for the native instance, or UUIDv4.
361
- */
362
- readonly nativeId: string;
363
- /**
364
- * The configuration object used to initialize this instance.
365
- */
366
- readonly config?: Config;
367
- /**
368
- * Generate UUID in case the user-defined `nativeId` is empty.
369
- */
370
- constructor(config?: Config);
371
- /**
372
- * Flag indicating whether the native resources of this object have been created internally
373
- * .i.e `initialize` has been called.
374
- */
375
- abstract isInitialized: boolean;
376
- /**
377
- * Create the native object/resources that will be managed by this instance.
378
- */
379
- abstract initialize(): void;
380
- /**
381
- * Flag indicating whether the native resources of this object have been disposed .i.e
382
- * `destroy` has been called.
383
- */
384
- abstract isDestroyed: boolean;
385
- /**
386
- * Dispose the native object/resources created by this instance during `initialize`.
387
- */
388
- abstract destroy(): void;
389
- }
390
-
391
1107
  /**
392
1108
  * Represents a FairPlay Streaming DRM config.
393
1109
  */
@@ -686,6 +1402,10 @@ interface SourceConfig extends NativeInstanceConfig {
686
1402
  * External subtitle tracks to be added into the player.
687
1403
  */
688
1404
  subtitleTracks?: SideLoadedSubtitleTrack[];
1405
+ /**
1406
+ * External thumbnails to be added into the player.
1407
+ */
1408
+ thumbnailTrack?: string;
689
1409
  }
690
1410
  /**
691
1411
  * Represents audio and video content that can be loaded into a player.
@@ -740,6 +1460,93 @@ declare class Source extends NativeInstance<SourceConfig> {
740
1460
  loadingState: () => Promise<LoadingState>;
741
1461
  }
742
1462
 
1463
+ /**
1464
+ * Contains config values which can be used to alter the visual presentation and behaviour of the player UI.
1465
+ */
1466
+ interface StyleConfig {
1467
+ /**
1468
+ * Sets if the UI should be enabled or not. Default value is true.
1469
+ * @example
1470
+ * ```
1471
+ * const player = new Player({
1472
+ * styleConfig: {
1473
+ * isUiEnabled: false,
1474
+ * },
1475
+ * });
1476
+ * ```
1477
+ */
1478
+ isUiEnabled?: boolean;
1479
+ /**
1480
+ * Set the CSS file that will be used for the UI. The default CSS file will be completely replaced by the CSS file set with this property.
1481
+ * @example
1482
+ * ```
1483
+ * const player = new Player({
1484
+ * styleConfig: {
1485
+ * playerUiCss: 'https://domain.tld/path/to/bitmovinplayer-ui.css',
1486
+ * },
1487
+ * });
1488
+ * ```
1489
+ * @platform iOS, Android
1490
+ */
1491
+ playerUiCss?: string;
1492
+ /**
1493
+ * Set a CSS file which contains supplemental styles for the player UI. These styles will be added to the default CSS file or the CSS file set with StyleConfig#playerUiCss.
1494
+ * @example
1495
+ * ```
1496
+ * const player = new Player({
1497
+ * styleConfig: {
1498
+ * supplementalPlayerUiCss: 'https://domain.tld/path/to/bitmovinplayer-supplemental-ui.css',
1499
+ * },
1500
+ * });
1501
+ * ```
1502
+ * @platform iOS, Android
1503
+ */
1504
+ supplementalPlayerUiCss?: string;
1505
+ /**
1506
+ * Sets the JS file that will be used for the UI. The default JS file will be completely replaced by the JS file set with this property.
1507
+ * @example
1508
+ * ```
1509
+ * const player = new Player({
1510
+ * styleConfig: {
1511
+ * playerUiJs: 'https://domain.tld/path/to/bitmovinplayer-ui.js',
1512
+ * },
1513
+ * });
1514
+ * ```
1515
+ * @platform iOS, Android
1516
+ */
1517
+ playerUiJs?: string;
1518
+ /**
1519
+ * Determines how the video content is scaled or stretched within the parent container’s bounds. Possible values are defined in ScalingMode.
1520
+ * Default value is ScalingMode.fit.
1521
+ * @example
1522
+ * ```
1523
+ * const player = new Player({
1524
+ * styleConfig: {
1525
+ * scalingMode: ScalingMode.Zoom,
1526
+ * },
1527
+ * });
1528
+ * ```
1529
+ */
1530
+ scalingMode?: ScalingMode;
1531
+ }
1532
+ /**
1533
+ * Specifies how the video content is scaled or stretched.
1534
+ */
1535
+ declare enum ScalingMode {
1536
+ /**
1537
+ * Specifies that the player should preserve the video’s aspect ratio and fit the video within the container's bounds.
1538
+ */
1539
+ Fit = "Fit",
1540
+ /**
1541
+ * Specifies that the video should be stretched to fill the container’s bounds. The aspect ratio may not be preserved.
1542
+ */
1543
+ Stretch = "Stretch",
1544
+ /**
1545
+ * Specifies that the player should preserve the video’s aspect ratio and fill the container’s bounds.
1546
+ */
1547
+ Zoom = "Zoom"
1548
+ }
1549
+
743
1550
  /**
744
1551
  * This configuration is used as an incubator for experimental features. Tweaks are not officially
745
1552
  * supported and are not guaranteed to be stable, i.e. their naming, functionality and API can
@@ -921,10 +1728,22 @@ interface PlayerConfig extends NativeInstanceConfig {
921
1728
  * Configures playback behaviour. A default PlaybackConfig is set initially.
922
1729
  */
923
1730
  playbackConfig?: PlaybackConfig;
1731
+ /**
1732
+ * Configures the visual presentation and behaviour of the player UI. A default StyleConfig is set initially.
1733
+ */
1734
+ styleConfig?: StyleConfig;
1735
+ /**
1736
+ * Configures advertising functionality. A default AdvertisingConfig is set initially.
1737
+ */
1738
+ advertisingConfig?: AdvertisingConfig;
924
1739
  /**
925
1740
  * Configures experimental features. A default TweaksConfig is set initially.
926
1741
  */
927
1742
  tweaksConfig?: TweaksConfig;
1743
+ /**
1744
+ * Configures analytics functionality.
1745
+ */
1746
+ analyticsConfig?: AnalyticsConfig;
928
1747
  }
929
1748
  /**
930
1749
  * Configures the playback behaviour of the player.
@@ -990,7 +1809,7 @@ interface PlaybackConfig {
990
1809
  */
991
1810
  isBackgroundPlaybackEnabled?: boolean;
992
1811
  /**
993
- * Whether the picture-in-picture mode option is enabled for iOS or not. Default is `false`.
1812
+ * Whether the Picture in Picture mode option is enabled or not. Default is `false`.
994
1813
  * @example
995
1814
  * ```
996
1815
  * const player = new Player({
@@ -1016,6 +1835,10 @@ declare class Player extends NativeInstance<PlayerConfig> {
1016
1835
  * Currently active source, or `null` if none is active.
1017
1836
  */
1018
1837
  source?: Source;
1838
+ /**
1839
+ * Analytics collector currently attached to this player instance.
1840
+ */
1841
+ analyticsCollector?: AnalyticsCollector;
1019
1842
  /**
1020
1843
  * Whether the native `Player` object has been created.
1021
1844
  */
@@ -1123,6 +1946,45 @@ declare class Player extends NativeInstance<PlayerConfig> {
1123
1946
  * @returns An array containing SubtitleTrack objects for all available subtitle tracks.
1124
1947
  */
1125
1948
  getAvailableSubtitles: () => Promise<SubtitleTrack[]>;
1949
+ /**
1950
+ * Dynamically schedules the `adItem` for playback.
1951
+ * Has no effect if there is no active playback session.
1952
+ *
1953
+ * @param adItem - Ad to be scheduled for playback.
1954
+ *
1955
+ * @platform iOS, Android
1956
+ */
1957
+ scheduleAd: (adItem: AdItem) => void;
1958
+ /**
1959
+ * Skips the current ad.
1960
+ * Has no effect if the current ad is not skippable or if no ad is being played back.
1961
+ *
1962
+ * @platform iOS, Android
1963
+ */
1964
+ skipAd: () => void;
1965
+ /**
1966
+ * @returns `true` while an ad is being played back or when main content playback has been paused for ad playback.
1967
+ * @platform iOS, Android
1968
+ */
1969
+ isAd: () => Promise<boolean>;
1970
+ }
1971
+
1972
+ /**
1973
+ * Handles the UI state change when fullscreen should be entered or exited.
1974
+ */
1975
+ interface FullscreenHandler {
1976
+ /**
1977
+ * Indicates if the UI is currently in fullscreen mode
1978
+ */
1979
+ isFullscreenActive: boolean;
1980
+ /**
1981
+ * Is called by the `PlayerView` when the UI should enter fullscreen mode.
1982
+ */
1983
+ enterFullscreen(): void;
1984
+ /**
1985
+ * Is called by the `PlayerView` when the UI should exit fullscreen mode.
1986
+ */
1987
+ exitFullscreen(): void;
1126
1988
  }
1127
1989
 
1128
1990
  /**
@@ -1143,12 +2005,13 @@ interface PlayerViewProps extends BasePlayerViewProps, PlayerViewEvents {
1143
2005
  * and render audio/video inside the `PlayerView`.
1144
2006
  */
1145
2007
  player: Player;
2008
+ fullscreenHandler?: FullscreenHandler;
1146
2009
  }
1147
2010
  /**
1148
2011
  * Component that provides the Bitmovin Player UI and default UI handling to an attached `Player` instance.
1149
2012
  * This component needs a `Player` instance to work properly so make sure one is passed to it as a prop.
1150
2013
  */
1151
- declare function PlayerView(props: PlayerViewProps): JSX.Element;
2014
+ declare function PlayerView({ style, player, fullscreenHandler, ...props }: PlayerViewProps): JSX.Element;
1152
2015
 
1153
2016
  /**
1154
2017
  * React hook that creates and returns a reference to a `Player` instance
@@ -1156,4 +2019,4 @@ declare function PlayerView(props: PlayerViewProps): JSX.Element;
1156
2019
  */
1157
2020
  declare function usePlayer(config?: PlayerConfig): Player;
1158
2021
 
1159
- export { BasePlayerViewProps, DestroyEvent, Drm, DrmConfig, ErrorEvent, Event, EventSource, FairplayConfig, LoadingState, MutedEvent, PausedEvent, PlayEvent, PlaybackConfig, PlaybackFinishedEvent, Player, PlayerActiveEvent, PlayerConfig, PlayerErrorEvent, PlayerView, PlayerViewProps, PlayerWarningEvent, PlayingEvent, ReadyEvent, SeekEvent, SeekedEvent, SideLoadedSubtitleTrack, Source, SourceConfig, SourceErrorEvent, SourceLoadEvent, SourceLoadedEvent, SourceType, SourceUnloadedEvent, SourceWarningEvent, SubtitleAddedEvent, SubtitleChangedEvent, SubtitleFormat, SubtitleRemovedEvent, SubtitleTrack, TimeChangedEvent, UnmutedEvent, WidevineConfig, usePlayer };
2022
+ export { Ad, AdBreak, AdBreakFinishedEvent, AdBreakStartedEvent, AdClickedEvent, AdConfig, AdData, AdErrorEvent, AdFinishedEvent, AdItem, AdManifestLoadEvent, AdManifestLoadedEvent, AdQuartile, AdQuartileEvent, AdScheduledEvent, AdSkippedEvent, AdSource, AdSourceType, AdStartedEvent, AdvertisingConfig, AnalyticsCollector, AnalyticsConfig, AudioSession, AudioSessionCategory, BasePlayerViewProps, CdnProvider, CustomDataConfig, DestroyEvent, Drm, DrmConfig, ErrorEvent, Event, EventSource, FairplayConfig, FullscreenDisabledEvent, FullscreenEnabledEvent, FullscreenEnterEvent, FullscreenExitEvent, LoadingState, MutedEvent, PausedEvent, PictureInPictureAvailabilityChangedEvent, PictureInPictureEnterEvent, PictureInPictureEnteredEvent, PictureInPictureExitEvent, PictureInPictureExitedEvent, PlayEvent, PlaybackConfig, PlaybackFinishedEvent, Player, PlayerActiveEvent, PlayerConfig, PlayerErrorEvent, PlayerView, PlayerViewProps, PlayerWarningEvent, PlayingEvent, ReadyEvent, ScalingMode, SeekEvent, SeekedEvent, SideLoadedSubtitleTrack, Source, SourceConfig, SourceErrorEvent, SourceLoadEvent, SourceLoadedEvent, SourceType, SourceUnloadedEvent, SourceWarningEvent, StallEndedEvent, StallStartedEvent, StyleConfig, SubtitleAddedEvent, SubtitleChangedEvent, SubtitleFormat, SubtitleRemovedEvent, SubtitleTrack, TimeChangedEvent, UnmutedEvent, VideoPlaybackQualityChangedEvent, WidevineConfig, usePlayer };