bitmovin-player-react-native 1.2.0 → 1.3.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 (112) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/com/bitmovin/player/reactnative/PlayerModule.kt +47 -0
  4. package/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +32 -3
  5. package/build/adaptationConfig.d.ts +1 -1
  6. package/build/adaptationConfig.js.map +1 -1
  7. package/build/advertising.d.ts +54 -1
  8. package/build/advertising.d.ts.map +1 -1
  9. package/build/advertising.js.map +1 -1
  10. package/build/audioSession.d.ts +3 -3
  11. package/build/audioSession.js +2 -2
  12. package/build/audioSession.js.map +1 -1
  13. package/build/bitmovinCastManager.d.ts +3 -3
  14. package/build/bitmovinCastManager.js +2 -2
  15. package/build/bitmovinCastManager.js.map +1 -1
  16. package/build/bufferConfig.d.ts +2 -2
  17. package/build/bufferConfig.js.map +1 -1
  18. package/build/components/PlayerView/events.d.ts +16 -16
  19. package/build/components/PlayerView/events.js.map +1 -1
  20. package/build/components/PlayerView/nativeEvents.d.ts +16 -16
  21. package/build/components/PlayerView/nativeEvents.js.map +1 -1
  22. package/build/components/PlayerView/pictureInPictureConfig.d.ts +1 -1
  23. package/build/components/PlayerView/pictureInPictureConfig.js.map +1 -1
  24. package/build/components/PlayerView/playerViewConfig.d.ts +2 -2
  25. package/build/components/PlayerView/playerViewConfig.js.map +1 -1
  26. package/build/decoder/decoderConfig.d.ts +2 -2
  27. package/build/decoder/decoderConfig.js.map +1 -1
  28. package/build/drm/index.d.ts +2 -2
  29. package/build/drm/index.js.map +1 -1
  30. package/build/drm/widevineConfig.d.ts +5 -5
  31. package/build/drm/widevineConfig.js.map +1 -1
  32. package/build/events.d.ts +10 -10
  33. package/build/events.js.map +1 -1
  34. package/build/media.d.ts +4 -0
  35. package/build/media.d.ts.map +1 -1
  36. package/build/media.js.map +1 -1
  37. package/build/modules/PlayerModule.d.ts +12 -1
  38. package/build/modules/PlayerModule.d.ts.map +1 -1
  39. package/build/modules/PlayerModule.js.map +1 -1
  40. package/build/offline/offlineContentConfig.d.ts +1 -1
  41. package/build/offline/offlineContentConfig.js.map +1 -1
  42. package/build/offline/offlineContentManager.d.ts +2 -2
  43. package/build/offline/offlineContentManager.js +2 -2
  44. package/build/offline/offlineContentManager.js.map +1 -1
  45. package/build/offline/offlineContentManagerListener.d.ts +13 -13
  46. package/build/offline/offlineContentManagerListener.js +1 -1
  47. package/build/offline/offlineContentManagerListener.js.map +1 -1
  48. package/build/offline/offlineContentOptions.d.ts +2 -2
  49. package/build/offline/offlineContentOptions.js.map +1 -1
  50. package/build/offline/offlineDownloadRequest.d.ts +1 -1
  51. package/build/offline/offlineDownloadRequest.js.map +1 -1
  52. package/build/offline/offlineSourceOptions.d.ts +2 -2
  53. package/build/offline/offlineSourceOptions.js.map +1 -1
  54. package/build/offline/offlineState.d.ts +1 -1
  55. package/build/offline/offlineState.js +1 -1
  56. package/build/offline/offlineState.js.map +1 -1
  57. package/build/playbackConfig.d.ts +1 -1
  58. package/build/playbackConfig.js.map +1 -1
  59. package/build/player.d.ts +13 -11
  60. package/build/player.d.ts.map +1 -1
  61. package/build/player.js +42 -11
  62. package/build/player.js.map +1 -1
  63. package/build/source.d.ts +2 -2
  64. package/build/source.js +1 -1
  65. package/build/source.js.map +1 -1
  66. package/build/styleConfig.d.ts +5 -5
  67. package/build/styleConfig.js +1 -1
  68. package/build/styleConfig.js.map +1 -1
  69. package/build/subtitleFormat.d.ts +5 -5
  70. package/build/subtitleFormat.js +5 -5
  71. package/build/subtitleFormat.js.map +1 -1
  72. package/build/subtitleTrack.d.ts +1 -1
  73. package/build/subtitleTrack.js.map +1 -1
  74. package/build/tweaksConfig.d.ts +15 -15
  75. package/build/tweaksConfig.js.map +1 -1
  76. package/ios/PlayerModule.swift +40 -0
  77. package/ios/RCTConvert+BitmovinPlayer.swift +41 -0
  78. package/package.json +1 -1
  79. package/plugin/build/withBitmovinConfig.js +8 -2
  80. package/plugin/src/withAppGradleDependencies.ts +24 -21
  81. package/plugin/src/withBitmovinAndroidConfig.ts +4 -1
  82. package/plugin/src/withBitmovinConfig.ts +12 -3
  83. package/plugin/src/withBitmovinIosConfig.ts +4 -1
  84. package/src/adaptationConfig.ts +1 -1
  85. package/src/advertising.ts +56 -1
  86. package/src/audioSession.ts +3 -3
  87. package/src/bitmovinCastManager.ts +3 -3
  88. package/src/bufferConfig.ts +2 -2
  89. package/src/components/PlayerView/events.ts +16 -16
  90. package/src/components/PlayerView/nativeEvents.ts +16 -16
  91. package/src/components/PlayerView/pictureInPictureConfig.ts +1 -1
  92. package/src/components/PlayerView/playerViewConfig.ts +2 -2
  93. package/src/decoder/decoderConfig.ts +2 -2
  94. package/src/drm/index.ts +2 -2
  95. package/src/drm/widevineConfig.ts +5 -5
  96. package/src/events.ts +10 -10
  97. package/src/media.ts +4 -0
  98. package/src/modules/PlayerModule.ts +18 -2
  99. package/src/offline/offlineContentConfig.ts +1 -1
  100. package/src/offline/offlineContentManager.ts +2 -2
  101. package/src/offline/offlineContentManagerListener.ts +13 -13
  102. package/src/offline/offlineContentOptions.ts +2 -2
  103. package/src/offline/offlineDownloadRequest.ts +1 -1
  104. package/src/offline/offlineSourceOptions.ts +2 -2
  105. package/src/offline/offlineState.ts +1 -1
  106. package/src/playbackConfig.ts +1 -1
  107. package/src/player.ts +47 -12
  108. package/src/source.ts +2 -2
  109. package/src/styleConfig.ts +5 -5
  110. package/src/subtitleFormat.ts +5 -5
  111. package/src/subtitleTrack.ts +1 -1
  112. package/src/tweaksConfig.ts +15 -15
package/build/player.d.ts CHANGED
@@ -43,6 +43,7 @@ export declare class Player extends NativeInstance<PlayerConfig> {
43
43
  buffer: BufferApi;
44
44
  private network?;
45
45
  private decoderConfig?;
46
+ private onImaBeforeInitializationSubscription?;
46
47
  /**
47
48
  * Allocates the native `Player` instance and its resources natively.
48
49
  */
@@ -109,6 +110,7 @@ export declare class Player extends NativeInstance<PlayerConfig> {
109
110
  * @param volume - The volume level to set.
110
111
  */
111
112
  setVolume: (volume: number) => void;
113
+ private ensureImaBeforeInitializationListener;
112
114
  /**
113
115
  * @returns The player's current volume level.
114
116
  */
@@ -145,12 +147,12 @@ export declare class Player extends NativeInstance<PlayerConfig> {
145
147
  */
146
148
  isLive: () => Promise<boolean>;
147
149
  /**
148
- * @remarks Only available for iOS devices.
150
+ * @platform iOS
149
151
  * @returns `true` when media is played externally using AirPlay.
150
152
  */
151
153
  isAirPlayActive: () => Promise<boolean>;
152
154
  /**
153
- * @remarks Only available for iOS devices.
155
+ * @platform iOS
154
156
  * @returns `true` when AirPlay is available.
155
157
  */
156
158
  isAirPlayAvailable: () => Promise<boolean>;
@@ -188,19 +190,19 @@ export declare class Player extends NativeInstance<PlayerConfig> {
188
190
  *
189
191
  * @param adItem - Ad to be scheduled for playback.
190
192
  *
191
- * @remarks Platform: iOS, Android
193
+ * @platform iOS, Android
192
194
  */
193
195
  scheduleAd: (adItem: AdItem) => void;
194
196
  /**
195
197
  * Skips the current ad.
196
198
  * Has no effect if the current ad is not skippable or if no ad is being played back.
197
199
  *
198
- * @remarks Platform: iOS, Android
200
+ * @platform iOS, Android
199
201
  */
200
202
  skipAd: () => void;
201
203
  /**
202
204
  * @returns `true` while an ad is being played back or when main content playback has been paused for ad playback.
203
- * @remarks Platform: iOS, Android
205
+ * @platform iOS, Android
204
206
  */
205
207
  isAd: () => Promise<boolean>;
206
208
  /**
@@ -235,26 +237,26 @@ export declare class Player extends NativeInstance<PlayerConfig> {
235
237
  * Whether casting to a cast-compatible remote device is available. {@link CastAvailableEvent} signals when
236
238
  * casting becomes available.
237
239
  *
238
- * @remarks Platform: iOS, Android
240
+ * @platform iOS, Android
239
241
  */
240
242
  isCastAvailable: () => Promise<boolean>;
241
243
  /**
242
244
  * Whether video is currently being casted to a remote device and not played locally.
243
245
  *
244
- * @remarks Platform: iOS, Android
246
+ * @platform iOS, Android
245
247
  */
246
248
  isCasting: () => Promise<boolean>;
247
249
  /**
248
250
  * Initiates casting the current video to a cast-compatible remote device. The user has to choose to which device it
249
251
  * should be sent.
250
252
  *
251
- * @remarks Platform: iOS, Android
253
+ * @platform iOS, Android
252
254
  */
253
255
  castVideo: () => void;
254
256
  /**
255
257
  * Stops casting the current video. Has no effect if {@link Player.isCasting} is `false`.
256
258
  *
257
- * @remarks Platform: iOS, Android
259
+ * @platform iOS, Android
258
260
  */
259
261
  castStop: () => void;
260
262
  /**
@@ -269,7 +271,7 @@ export declare class Player extends NativeInstance<PlayerConfig> {
269
271
  getAvailableVideoQualities: () => Promise<VideoQuality[]>;
270
272
  /**
271
273
  * Sets the video quality.
272
- * @remarks Platform: Android
274
+ * @platform Android
273
275
  *
274
276
  * @param qualityId value obtained from {@link VideoQuality}'s `id` property, which can be obtained via `Player.getAvailableVideoQualities()` to select a specific quality. To use automatic quality selection, 'auto' can be passed here.
275
277
  */
@@ -300,7 +302,7 @@ export declare class Player extends NativeInstance<PlayerConfig> {
300
302
  * Checks the possibility to play the media at specified playback speed.
301
303
  * @param playbackSpeed - The playback speed to check.
302
304
  * @returns `true` if it's possible to play the media at the specified playback speed, otherwise `false`. On Android it always returns `undefined`.
303
- * @remarks Platform: iOS, tvOS
305
+ * @platform iOS, tvOS
304
306
  */
305
307
  canPlayAtPlaybackSpeed: (playbackSpeed: number) => Promise<boolean | undefined>;
306
308
  private maybeInitDecoderConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"player.d.ts","sourceRoot":"","sources":["../src/player.ts"],"names":[],"mappings":"AAEA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAA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;;;;OAKG;IACH,MAAM,aAEJ;IAEF;;;OAGG;IACH,IAAI,QAAa,OAAO,CAAC,OAAO,CAAC,CAE/B;IAEF;;;OAGG;IACH,YAAY,QAAa,OAAO,CAAC,MAAM,CAAC,CAEtC;IAEF;;;OAGG;IACH,eAAe,QAAa,OAAO,CAAC,MAAM,CAAC,CAEzC;IAEF;;;;;OAKG;IACH,uBAAuB,GAAI,SAAS,MAAM,GAAG,IAAI,UAE/C;IAEF;;;;;;;;;OASG;IACH,YAAY,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAE5D;IAEF;;;;;OAKG;IACH,eAAe,QAAa,OAAO,CAAC,OAAO,CAAC,CAE1C;IAEF;;;;OAIG;IACH,SAAS,QAAa,OAAO,CAAC,OAAO,CAAC,CAEpC;IAEF;;;;;OAKG;IACH,SAAS,aAEP;IAEF;;;;OAIG;IACH,QAAQ,aAEN;IAEF;;;OAGG;IACH,eAAe,QAAa,OAAO,CAAC,YAAY,CAAC,CAE/C;IAEF;;;OAGG;IACH,0BAA0B,QAAa,OAAO,CAAC,YAAY,EAAE,CAAC,CAE5D;IAEF;;;;;OAKG;IACH,eAAe,GAAI,WAAW,MAAM,UAQlC;IAEF;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,GAAI,eAAe,MAAM,UAEvC;IAEF;;;OAGG;IACH,gBAAgB,QAAa,OAAO,CAAC,MAAM,CAAC,CAE1C;IAEF;;;;;OAKG;IACH,sBAAsB,GACpB,eAAe,MAAM,KACpB,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAa7B;IAEF,OAAO,CAAC,sBAAsB,CAY5B;CACH"}
package/build/player.js CHANGED
@@ -40,11 +40,13 @@ export class Player extends NativeInstance {
40
40
  buffer = new BufferApi(this.nativeId);
41
41
  network;
42
42
  decoderConfig;
43
+ onImaBeforeInitializationSubscription;
43
44
  /**
44
45
  * Allocates the native `Player` instance and its resources natively.
45
46
  */
46
47
  initialize = async () => {
47
48
  if (!this.isInitialized) {
49
+ this.ensureImaBeforeInitializationListener();
48
50
  if (this.config?.networkConfig) {
49
51
  this.network = new Network(this.config.networkConfig);
50
52
  await this.network.initialize();
@@ -71,6 +73,8 @@ export class Player extends NativeInstance {
71
73
  this.source?.destroy();
72
74
  this.network?.destroy();
73
75
  this.decoderConfig?.destroy();
76
+ this.onImaBeforeInitializationSubscription?.remove();
77
+ this.onImaBeforeInitializationSubscription = undefined;
74
78
  this.isDestroyed = true;
75
79
  }
76
80
  };
@@ -157,6 +161,33 @@ export class Player extends NativeInstance {
157
161
  setVolume = (volume) => {
158
162
  PlayerModule.setVolume(this.nativeId, volume);
159
163
  };
164
+ ensureImaBeforeInitializationListener = () => {
165
+ const callback = this.config?.advertisingConfig?.ima?.beforeInitialization;
166
+ if (!callback) {
167
+ return;
168
+ }
169
+ if (this.onImaBeforeInitializationSubscription) {
170
+ return;
171
+ }
172
+ this.onImaBeforeInitializationSubscription = PlayerModule.addListener('onImaBeforeInitialization', ({ nativeId, id, settings }) => {
173
+ if (nativeId !== this.nativeId) {
174
+ return;
175
+ }
176
+ const cloned = { ...settings };
177
+ let prepared = cloned;
178
+ try {
179
+ const result = callback(cloned);
180
+ prepared =
181
+ result && typeof result === 'object'
182
+ ? { ...cloned, ...result }
183
+ : cloned;
184
+ }
185
+ catch {
186
+ prepared = cloned;
187
+ }
188
+ PlayerModule.setPreparedImaSettings(id, prepared);
189
+ });
190
+ };
160
191
  /**
161
192
  * @returns The player's current volume level.
162
193
  */
@@ -207,7 +238,7 @@ export class Player extends NativeInstance {
207
238
  return (await PlayerModule.isLive(this.nativeId)) ?? false;
208
239
  };
209
240
  /**
210
- * @remarks Only available for iOS devices.
241
+ * @platform iOS
211
242
  * @returns `true` when media is played externally using AirPlay.
212
243
  */
213
244
  isAirPlayActive = async () => {
@@ -218,7 +249,7 @@ export class Player extends NativeInstance {
218
249
  return (await PlayerModule.isAirPlayActive(this.nativeId)) ?? false;
219
250
  };
220
251
  /**
221
- * @remarks Only available for iOS devices.
252
+ * @platform iOS
222
253
  * @returns `true` when AirPlay is available.
223
254
  */
224
255
  isAirPlayAvailable = async () => {
@@ -274,7 +305,7 @@ export class Player extends NativeInstance {
274
305
  *
275
306
  * @param adItem - Ad to be scheduled for playback.
276
307
  *
277
- * @remarks Platform: iOS, Android
308
+ * @platform iOS, Android
278
309
  */
279
310
  scheduleAd = (adItem) => {
280
311
  PlayerModule.scheduleAd(this.nativeId, adItem);
@@ -283,14 +314,14 @@ export class Player extends NativeInstance {
283
314
  * Skips the current ad.
284
315
  * Has no effect if the current ad is not skippable or if no ad is being played back.
285
316
  *
286
- * @remarks Platform: iOS, Android
317
+ * @platform iOS, Android
287
318
  */
288
319
  skipAd = () => {
289
320
  PlayerModule.skipAd(this.nativeId);
290
321
  };
291
322
  /**
292
323
  * @returns `true` while an ad is being played back or when main content playback has been paused for ad playback.
293
- * @remarks Platform: iOS, Android
324
+ * @platform iOS, Android
294
325
  */
295
326
  isAd = async () => {
296
327
  return (await PlayerModule.isAd(this.nativeId)) ?? false;
@@ -335,7 +366,7 @@ export class Player extends NativeInstance {
335
366
  * Whether casting to a cast-compatible remote device is available. {@link CastAvailableEvent} signals when
336
367
  * casting becomes available.
337
368
  *
338
- * @remarks Platform: iOS, Android
369
+ * @platform iOS, Android
339
370
  */
340
371
  isCastAvailable = async () => {
341
372
  return (await PlayerModule.isCastAvailable(this.nativeId)) ?? false;
@@ -343,7 +374,7 @@ export class Player extends NativeInstance {
343
374
  /**
344
375
  * Whether video is currently being casted to a remote device and not played locally.
345
376
  *
346
- * @remarks Platform: iOS, Android
377
+ * @platform iOS, Android
347
378
  */
348
379
  isCasting = async () => {
349
380
  return (await PlayerModule.isCasting(this.nativeId)) ?? false;
@@ -352,7 +383,7 @@ export class Player extends NativeInstance {
352
383
  * Initiates casting the current video to a cast-compatible remote device. The user has to choose to which device it
353
384
  * should be sent.
354
385
  *
355
- * @remarks Platform: iOS, Android
386
+ * @platform iOS, Android
356
387
  */
357
388
  castVideo = () => {
358
389
  PlayerModule.castVideo(this.nativeId);
@@ -360,7 +391,7 @@ export class Player extends NativeInstance {
360
391
  /**
361
392
  * Stops casting the current video. Has no effect if {@link Player.isCasting} is `false`.
362
393
  *
363
- * @remarks Platform: iOS, Android
394
+ * @platform iOS, Android
364
395
  */
365
396
  castStop = () => {
366
397
  PlayerModule.castStop(this.nativeId);
@@ -381,7 +412,7 @@ export class Player extends NativeInstance {
381
412
  };
382
413
  /**
383
414
  * Sets the video quality.
384
- * @remarks Platform: Android
415
+ * @platform Android
385
416
  *
386
417
  * @param qualityId value obtained from {@link VideoQuality}'s `id` property, which can be obtained via `Player.getAvailableVideoQualities()` to select a specific quality. To use automatic quality selection, 'auto' can be passed here.
387
418
  */
@@ -422,7 +453,7 @@ export class Player extends NativeInstance {
422
453
  * Checks the possibility to play the media at specified playback speed.
423
454
  * @param playbackSpeed - The playback speed to check.
424
455
  * @returns `true` if it's possible to play the media at the specified playback speed, otherwise `false`. On Android it always returns `undefined`.
425
- * @remarks Platform: iOS, tvOS
456
+ * @platform iOS, tvOS
426
457
  */
427
458
  canPlayAtPlaybackSpeed = async (playbackSpeed) => {
428
459
  if (Platform.OS === 'android') {
@@ -1 +1 @@
1
- {"version":3,"file":"player.js","sourceRoot":"","sources":["../src/player.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAC;AAKhD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,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G;IACH,gBAAgB,GAAG,KAAK,IAAqB,EAAE;QAC7C,OAAO,CAAC,MAAM,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;IACnE,CAAC,CAAC;IAEF;;;;;OAKG;IACH,sBAAsB,GAAG,KAAK,EAC5B,aAAqB,EACS,EAAE;QAChC,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,CAAC,IAAI,CACV,WAAW,IAAI,CAAC,QAAQ,0FAA0F,CACnH,CAAC;YACF,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,CACL,CAAC,MAAM,YAAY,CAAC,sBAAsB,CACxC,IAAI,CAAC,QAAQ,EACb,aAAa,CACd,CAAC,IAAI,KAAK,CACZ,CAAC;IACJ,CAAC,CAAC;IAEM,sBAAsB,GAAG,GAAG,EAAE;QACpC,IAAI,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,aAAa,IAAI,IAAI,EAAE,CAAC;YACvD,OAAO;QACT,CAAC;QACD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,mBAAmB,CAC1C,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CACzC,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC,CAAC;CACH","sourcesContent":["import { Platform } from 'react-native';\nimport PlayerModule from './modules/PlayerModule';\nimport NativeInstance from './nativeInstance';\nimport { Source, SourceConfig } from './source';\nimport { AudioTrack } from './audioTrack';\nimport { SubtitleTrack } from './subtitleTrack';\nimport { OfflineContentManager, OfflineSourceOptions } from './offline';\nimport { Thumbnail } from './thumbnail';\nimport { AnalyticsApi } from './analytics/player';\nimport { PlayerConfig } from './playerConfig';\nimport { AdItem } from './advertising';\nimport { BufferApi } from './bufferApi';\nimport { VideoQuality } from './media';\nimport { Network } from './network';\nimport { DecoderConfigBridge } from './decoder';\n\n/**\n * Loads, controls and renders audio and video content represented through {@link Source}s. A player\n * instance can be created via the {@link usePlayer} hook and will idle until one or more {@link Source}s are\n * loaded. Once {@link Player.load} or {@link Player.loadSource} is called, the player becomes active and initiates necessary downloads to\n * start playback of the loaded source(s).\n *\n * Can be attached to {@link PlayerView} component in order to use Bitmovin's Player Web UI.\n * @see PlayerView\n */\nexport class Player extends NativeInstance<PlayerConfig> {\n /**\n * Whether the native `Player` object has been created.\n */\n isInitialized = false;\n /**\n * Whether the native `Player` object has been disposed.\n */\n isDestroyed = false;\n /**\n * Currently active source, or `null` if none is active.\n */\n source?: Source;\n /**\n * The `AnalyticsApi` for interactions regarding the `Player`'s analytics.\n *\n * `undefined` if the player was created without analytics support.\n */\n analytics?: AnalyticsApi = undefined;\n /**\n * The {@link BufferApi} for interactions regarding the buffer.\n */\n buffer: BufferApi = new BufferApi(this.nativeId);\n\n private network?: Network;\n\n private decoderConfig?: DecoderConfigBridge;\n /**\n * Allocates the native `Player` instance and its resources natively.\n */\n initialize = async (): Promise<void> => {\n if (!this.isInitialized) {\n if (this.config?.networkConfig) {\n this.network = new Network(this.config.networkConfig);\n await this.network.initialize();\n }\n await this.maybeInitDecoderConfig();\n const analyticsConfig = this.config?.analyticsConfig;\n if (analyticsConfig) {\n await PlayerModule.initializeWithAnalyticsConfig(\n this.nativeId,\n analyticsConfig,\n this.config,\n this.network?.nativeId,\n this.decoderConfig?.nativeId\n );\n this.analytics = new AnalyticsApi(this.nativeId);\n } else {\n await PlayerModule.initializeWithConfig(\n this.nativeId,\n this.config,\n this.network?.nativeId,\n this.decoderConfig?.nativeId\n );\n }\n\n this.isInitialized = true;\n }\n return Promise.resolve();\n };\n\n /**\n * Destroys the native `Player` and releases all of its allocated resources.\n */\n destroy = () => {\n if (!this.isDestroyed) {\n PlayerModule.destroy(this.nativeId);\n this.source?.destroy();\n this.network?.destroy();\n this.decoderConfig?.destroy();\n this.isDestroyed = true;\n }\n };\n\n /**\n * Loads a new {@link Source} from `sourceConfig` into the player.\n */\n load = (sourceConfig: SourceConfig) => {\n this.loadSource(new Source(sourceConfig));\n };\n\n /**\n * Loads the downloaded content from {@link OfflineContentManager} into the player.\n */\n loadOfflineContent = (\n offlineContentManager: OfflineContentManager,\n options?: OfflineSourceOptions\n ) => {\n PlayerModule.loadOfflineContent(\n this.nativeId,\n offlineContentManager.nativeId,\n options\n );\n };\n\n /**\n * Loads the given {@link Source} into the player.\n */\n loadSource = (source: Source) => {\n this.source = source;\n source.initialize().then(() => {\n PlayerModule.loadSource(this.nativeId, source.nativeId);\n });\n };\n\n /**\n * Unloads all {@link Source}s from the player.\n */\n unload = () => {\n PlayerModule.unload(this.nativeId);\n };\n\n /**\n * Starts or resumes playback after being paused. Has no effect if the player is already playing.\n */\n play = () => {\n PlayerModule.play(this.nativeId);\n };\n\n /**\n * Pauses the video if it is playing. Has no effect if the player is already paused.\n */\n pause = () => {\n PlayerModule.pause(this.nativeId);\n };\n\n /**\n * Seeks to the given playback time specified by the parameter `time` in seconds. Must not be\n * greater than the total duration of the video. Has no effect when watching a live stream since\n * seeking is not possible.\n *\n * @param time - The time to seek to in seconds.\n */\n seek = (time: number) => {\n PlayerModule.seek(this.nativeId, time);\n };\n\n /**\n * Shifts the time to the given `offset` in seconds from the live edge. The resulting offset has to be within the\n * timeShift window as specified by `maxTimeShift` (which is a negative value) and 0. When the provided `offset` is\n * positive, it will be interpreted as a UNIX timestamp in seconds and converted to fit into the timeShift window.\n * When the provided `offset` is negative, but lower than `maxTimeShift`, then it will be clamped to `maxTimeShift`.\n * Has no effect for VoD.\n *\n * Has no effect if no sources are loaded.\n *\n * @param offset - Target offset from the live edge in seconds.\n */\n timeShift = (offset: number) => {\n PlayerModule.timeShift(this.nativeId, offset);\n };\n\n /**\n * Mutes the player if an audio track is available. Has no effect if the player is already muted.\n */\n mute = () => {\n PlayerModule.mute(this.nativeId);\n };\n\n /**\n * Unmutes the player if it is muted. Has no effect if the player is already unmuted.\n */\n unmute = () => {\n PlayerModule.unmute(this.nativeId);\n };\n\n /**\n * Sets the player's volume between 0 (silent) and 100 (max volume).\n *\n * @param volume - The volume level to set.\n */\n setVolume = (volume: number) => {\n PlayerModule.setVolume(this.nativeId, volume);\n };\n\n /**\n * @returns The player's current volume level.\n */\n getVolume = async (): Promise<number> => {\n return (await PlayerModule.getVolume(this.nativeId)) ?? 0;\n };\n\n /**\n * @returns The current playback time in seconds.\n *\n * For VoD streams the returned time ranges between 0 and the duration of the asset.\n *\n * For live streams it can be specified if an absolute UNIX timestamp or a value\n * relative to the playback start should be returned.\n *\n * @param mode - The time mode to specify: an absolute UNIX timestamp ('absolute') or relative time ('relative').\n */\n getCurrentTime = async (\n mode: 'relative' | 'absolute' = 'absolute'\n ): Promise<number> => {\n return (await PlayerModule.currentTime(this.nativeId, mode)) ?? 0;\n };\n\n /**\n * @returns The total duration in seconds of the current video or INFINITY if it’s a live stream.\n */\n getDuration = async (): Promise<number> => {\n return (await PlayerModule.duration(this.nativeId)) ?? 0;\n };\n\n /**\n * @returns `true` if the player is muted.\n */\n isMuted = async (): Promise<boolean> => {\n return (await PlayerModule.isMuted(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the player is currently playing, i.e. has started and is not paused.\n */\n isPlaying = async (): Promise<boolean> => {\n return (await PlayerModule.isPlaying(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the player has started playback but it's currently paused.\n */\n isPaused = async (): Promise<boolean> => {\n return (await PlayerModule.isPaused(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the displayed video is a live stream.\n */\n isLive = async (): Promise<boolean> => {\n return (await PlayerModule.isLive(this.nativeId)) ?? false;\n };\n\n /**\n * @remarks Only available for iOS devices.\n * @returns `true` when media is played externally using AirPlay.\n */\n isAirPlayActive = async (): Promise<boolean> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method isAirPlayActive is not available for Android. Only iOS devices.`\n );\n return false;\n }\n return (await PlayerModule.isAirPlayActive(this.nativeId)) ?? false;\n };\n\n /**\n * @remarks Only available for iOS devices.\n * @returns `true` when AirPlay is available.\n */\n isAirPlayAvailable = async (): Promise<boolean> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method isAirPlayAvailable is not available for Android. Only iOS devices.`\n );\n return false;\n }\n return (await PlayerModule.isAirPlayAvailable(this.nativeId)) ?? false;\n };\n\n /**\n * @returns The currently selected audio track or `null`.\n */\n getAudioTrack = async (): Promise<AudioTrack | null> => {\n return PlayerModule.getAudioTrack(this.nativeId);\n };\n\n /**\n * @returns An array containing {@link AudioTrack} objects for all available audio tracks.\n */\n getAvailableAudioTracks = async (): Promise<AudioTrack[]> => {\n return PlayerModule.getAvailableAudioTracks(this.nativeId);\n };\n\n /**\n * Sets the audio track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableAudioTracks.\n *\n * @param trackIdentifier - The {@link AudioTrack.identifier} to be set.\n */\n setAudioTrack = async (trackIdentifier: string): Promise<void> => {\n return PlayerModule.setAudioTrack(this.nativeId, trackIdentifier);\n };\n\n /**\n * @returns The currently selected {@link SubtitleTrack} or `null`.\n */\n getSubtitleTrack = async (): Promise<SubtitleTrack | null> => {\n return PlayerModule.getSubtitleTrack(this.nativeId);\n };\n\n /**\n * @returns An array containing SubtitleTrack objects for all available subtitle tracks.\n */\n getAvailableSubtitles = async (): Promise<SubtitleTrack[]> => {\n return PlayerModule.getAvailableSubtitles(this.nativeId);\n };\n\n /**\n * Sets the subtitle track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableSubtitles.\n *\n * @param trackIdentifier - The {@link SubtitleTrack.identifier} to be set.\n */\n setSubtitleTrack = async (trackIdentifier?: string): Promise<void> => {\n return PlayerModule.setSubtitleTrack(this.nativeId, trackIdentifier ?? '');\n };\n\n /**\n * Dynamically schedules the {@link AdItem} for playback.\n * Has no effect if there is no active playback session.\n *\n * @param adItem - Ad to be scheduled for playback.\n *\n * @remarks Platform: iOS, Android\n */\n scheduleAd = (adItem: AdItem) => {\n PlayerModule.scheduleAd(this.nativeId, adItem);\n };\n\n /**\n * Skips the current ad.\n * Has no effect if the current ad is not skippable or if no ad is being played back.\n *\n * @remarks Platform: iOS, Android\n */\n skipAd = () => {\n PlayerModule.skipAd(this.nativeId);\n };\n\n /**\n * @returns `true` while an ad is being played back or when main content playback has been paused for ad playback.\n * @remarks Platform: iOS, Android\n */\n isAd = async (): Promise<boolean> => {\n return (await PlayerModule.isAd(this.nativeId)) ?? false;\n };\n\n /**\n * The current time shift of the live stream in seconds. This value is always 0 if the active {@link Source} is not a\n * live stream or no sources are loaded.\n */\n getTimeShift = async (): Promise<number> => {\n return (await PlayerModule.getTimeShift(this.nativeId)) ?? 0;\n };\n\n /**\n * The limit in seconds for time shifting. This value is either negative or 0 and it is always 0 if the active\n * {@link Source} is not a live stream or no sources are loaded.\n */\n getMaxTimeShift = async (): Promise<number> => {\n return (await PlayerModule.getMaxTimeShift(this.nativeId)) ?? 0;\n };\n\n /**\n * Sets the upper bitrate boundary for video qualities. All qualities with a bitrate\n * that is higher than this threshold will not be eligible for automatic quality selection.\n *\n * Can be set to `null` for no limitation.\n */\n setMaxSelectableBitrate = (bitrate: number | null) => {\n PlayerModule.setMaxSelectableBitrate(this.nativeId, bitrate || -1);\n };\n\n /**\n * @returns a {@link Thumbnail} for the specified playback time for the currently active source if available.\n * Supported thumbnail formats are:\n * - `WebVtt` configured via {@link SourceConfig.thumbnailTrack}, on all supported platforms\n * - HLS `Image Media Playlist` in the multivariant playlist, Android-only\n * - DASH `Image Adaptation Set` as specified in DASH-IF IOP, Android-only\n * If a `WebVtt` thumbnail track is provided, any potential in-manifest thumbnails are ignored on Android.\n *\n * @param time - The time in seconds for which to retrieve the thumbnail.\n */\n getThumbnail = async (time: number): Promise<Thumbnail | null> => {\n return PlayerModule.getThumbnail(this.nativeId, time);\n };\n\n /**\n * Whether casting to a cast-compatible remote device is available. {@link CastAvailableEvent} signals when\n * casting becomes available.\n *\n * @remarks Platform: iOS, Android\n */\n isCastAvailable = async (): Promise<boolean> => {\n return (await PlayerModule.isCastAvailable(this.nativeId)) ?? false;\n };\n\n /**\n * Whether video is currently being casted to a remote device and not played locally.\n *\n * @remarks Platform: iOS, Android\n */\n isCasting = async (): Promise<boolean> => {\n return (await PlayerModule.isCasting(this.nativeId)) ?? false;\n };\n\n /**\n * Initiates casting the current video to a cast-compatible remote device. The user has to choose to which device it\n * should be sent.\n *\n * @remarks Platform: iOS, Android\n */\n castVideo = () => {\n PlayerModule.castVideo(this.nativeId);\n };\n\n /**\n * Stops casting the current video. Has no effect if {@link Player.isCasting} is `false`.\n *\n * @remarks Platform: iOS, Android\n */\n castStop = () => {\n PlayerModule.castStop(this.nativeId);\n };\n\n /**\n * Returns the currently selected video quality.\n * @returns The currently selected video quality.\n */\n getVideoQuality = async (): Promise<VideoQuality> => {\n return PlayerModule.getVideoQuality(this.nativeId);\n };\n\n /**\n * Returns an array containing all available video qualities the player can adapt between.\n * @returns An array containing all available video qualities the player can adapt between.\n */\n getAvailableVideoQualities = async (): Promise<VideoQuality[]> => {\n return PlayerModule.getAvailableVideoQualities(this.nativeId);\n };\n\n /**\n * Sets the video quality.\n * @remarks Platform: Android\n *\n * @param qualityId value obtained from {@link VideoQuality}'s `id` property, which can be obtained via `Player.getAvailableVideoQualities()` to select a specific quality. To use automatic quality selection, 'auto' can be passed here.\n */\n setVideoQuality = (qualityId: string) => {\n if (Platform.OS !== 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method setVideoQuality is not available for iOS and tvOS devices. Only Android devices.`\n );\n return;\n }\n PlayerModule.setVideoQuality(this.nativeId, qualityId);\n };\n\n /**\n * Sets the playback speed of the player. Fast forward, slow motion and reverse playback are supported.\n * @remarks\n * Platform: iOS, tvOS\n *\n * - Slow motion is indicated by values between `0` and `1`.\n * - Fast forward by values greater than `1`.\n * - Slow reverse is used by values between `0` and `-1`, and fast reverse is used by values less than `-1`. iOS and tvOS only.\n * - Negative values are ignored during Casting and on Android.\n * - During reverse playback the playback will continue until the beginning of the active source is\n * reached. When reaching the beginning of the source, playback will be paused and the playback\n * speed will be reset to its default value of `1`. No {@link PlaybackFinishedEvent} will be\n * emitted in this case.\n *\n * @param playbackSpeed - The playback speed to set.\n */\n setPlaybackSpeed = (playbackSpeed: number) => {\n PlayerModule.setPlaybackSpeed(this.nativeId, playbackSpeed);\n };\n\n /**\n * @see {@link setPlaybackSpeed} for details on which values playback speed can assume.\n * @returns The player's current playback speed.\n */\n getPlaybackSpeed = async (): Promise<number> => {\n return (await PlayerModule.getPlaybackSpeed(this.nativeId)) ?? 0;\n };\n\n /**\n * Checks the possibility to play the media at specified playback speed.\n * @param playbackSpeed - The playback speed to check.\n * @returns `true` if it's possible to play the media at the specified playback speed, otherwise `false`. On Android it always returns `undefined`.\n * @remarks Platform: iOS, tvOS\n */\n canPlayAtPlaybackSpeed = async (\n playbackSpeed: number\n ): Promise<boolean | undefined> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method canPlayAtPlaybackSpeed is not available for Android. Only iOS and tvOS devices.`\n );\n return undefined;\n }\n return (\n (await PlayerModule.canPlayAtPlaybackSpeed(\n this.nativeId,\n playbackSpeed\n )) ?? false\n );\n };\n\n private maybeInitDecoderConfig = () => {\n if (this.config?.playbackConfig?.decoderConfig == null) {\n return;\n }\n if (Platform.OS === 'ios') {\n return;\n }\n\n this.decoderConfig = new DecoderConfigBridge(\n this.config.playbackConfig.decoderConfig\n );\n this.decoderConfig.initialize();\n };\n}\n"]}
1
+ {"version":3,"file":"player.js","sourceRoot":"","sources":["../src/player.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAC;AA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EAAE;QAC3C,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IAC9D,CAAC,CAAC;IAEF;;;OAGG;IACH,gBAAgB,GAAG,KAAK,IAAqB,EAAE;QAC7C,OAAO,CAAC,MAAM,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;IACnE,CAAC,CAAC;IAEF;;;;;OAKG;IACH,sBAAsB,GAAG,KAAK,EAC5B,aAAqB,EACS,EAAE;QAChC,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,CAAC,IAAI,CACV,WAAW,IAAI,CAAC,QAAQ,0FAA0F,CACnH,CAAC;YACF,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,CACL,CAAC,MAAM,YAAY,CAAC,sBAAsB,CACxC,IAAI,CAAC,QAAQ,EACb,aAAa,CACd,CAAC,IAAI,KAAK,CACZ,CAAC;IACJ,CAAC,CAAC;IAEM,sBAAsB,GAAG,GAAG,EAAE;QACpC,IAAI,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,aAAa,IAAI,IAAI,EAAE,CAAC;YACvD,OAAO;QACT,CAAC;QACD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,mBAAmB,CAC1C,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CACzC,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC,CAAC;CACH","sourcesContent":["import { EventSubscription } from 'expo-modules-core';\nimport { Platform } from 'react-native';\nimport PlayerModule from './modules/PlayerModule';\nimport NativeInstance from './nativeInstance';\nimport { Source, SourceConfig } from './source';\nimport { AudioTrack } from './audioTrack';\nimport { SubtitleTrack } from './subtitleTrack';\nimport { OfflineContentManager, OfflineSourceOptions } from './offline';\nimport { Thumbnail } from './thumbnail';\nimport { AnalyticsApi } from './analytics/player';\nimport { PlayerConfig } from './playerConfig';\nimport { AdItem, ImaSettings } from './advertising';\nimport { BufferApi } from './bufferApi';\nimport { VideoQuality } from './media';\nimport { Network } from './network';\nimport { DecoderConfigBridge } from './decoder';\n\n/**\n * Loads, controls and renders audio and video content represented through {@link Source}s. A player\n * instance can be created via the {@link usePlayer} hook and will idle until one or more {@link Source}s are\n * loaded. Once {@link Player.load} or {@link Player.loadSource} is called, the player becomes active and initiates necessary downloads to\n * start playback of the loaded source(s).\n *\n * Can be attached to {@link PlayerView} component in order to use Bitmovin's Player Web UI.\n * @see PlayerView\n */\nexport class Player extends NativeInstance<PlayerConfig> {\n /**\n * Whether the native `Player` object has been created.\n */\n isInitialized = false;\n /**\n * Whether the native `Player` object has been disposed.\n */\n isDestroyed = false;\n /**\n * Currently active source, or `null` if none is active.\n */\n source?: Source;\n /**\n * The `AnalyticsApi` for interactions regarding the `Player`'s analytics.\n *\n * `undefined` if the player was created without analytics support.\n */\n analytics?: AnalyticsApi = undefined;\n /**\n * The {@link BufferApi} for interactions regarding the buffer.\n */\n buffer: BufferApi = new BufferApi(this.nativeId);\n\n private network?: Network;\n\n private decoderConfig?: DecoderConfigBridge;\n private onImaBeforeInitializationSubscription?: EventSubscription;\n /**\n * Allocates the native `Player` instance and its resources natively.\n */\n initialize = async (): Promise<void> => {\n if (!this.isInitialized) {\n this.ensureImaBeforeInitializationListener();\n if (this.config?.networkConfig) {\n this.network = new Network(this.config.networkConfig);\n await this.network.initialize();\n }\n await this.maybeInitDecoderConfig();\n const analyticsConfig = this.config?.analyticsConfig;\n if (analyticsConfig) {\n await PlayerModule.initializeWithAnalyticsConfig(\n this.nativeId,\n analyticsConfig,\n this.config,\n this.network?.nativeId,\n this.decoderConfig?.nativeId\n );\n this.analytics = new AnalyticsApi(this.nativeId);\n } else {\n await PlayerModule.initializeWithConfig(\n this.nativeId,\n this.config,\n this.network?.nativeId,\n this.decoderConfig?.nativeId\n );\n }\n\n this.isInitialized = true;\n }\n return Promise.resolve();\n };\n\n /**\n * Destroys the native `Player` and releases all of its allocated resources.\n */\n destroy = () => {\n if (!this.isDestroyed) {\n PlayerModule.destroy(this.nativeId);\n this.source?.destroy();\n this.network?.destroy();\n this.decoderConfig?.destroy();\n this.onImaBeforeInitializationSubscription?.remove();\n this.onImaBeforeInitializationSubscription = undefined;\n this.isDestroyed = true;\n }\n };\n\n /**\n * Loads a new {@link Source} from `sourceConfig` into the player.\n */\n load = (sourceConfig: SourceConfig) => {\n this.loadSource(new Source(sourceConfig));\n };\n\n /**\n * Loads the downloaded content from {@link OfflineContentManager} into the player.\n */\n loadOfflineContent = (\n offlineContentManager: OfflineContentManager,\n options?: OfflineSourceOptions\n ) => {\n PlayerModule.loadOfflineContent(\n this.nativeId,\n offlineContentManager.nativeId,\n options\n );\n };\n\n /**\n * Loads the given {@link Source} into the player.\n */\n loadSource = (source: Source) => {\n this.source = source;\n source.initialize().then(() => {\n PlayerModule.loadSource(this.nativeId, source.nativeId);\n });\n };\n\n /**\n * Unloads all {@link Source}s from the player.\n */\n unload = () => {\n PlayerModule.unload(this.nativeId);\n };\n\n /**\n * Starts or resumes playback after being paused. Has no effect if the player is already playing.\n */\n play = () => {\n PlayerModule.play(this.nativeId);\n };\n\n /**\n * Pauses the video if it is playing. Has no effect if the player is already paused.\n */\n pause = () => {\n PlayerModule.pause(this.nativeId);\n };\n\n /**\n * Seeks to the given playback time specified by the parameter `time` in seconds. Must not be\n * greater than the total duration of the video. Has no effect when watching a live stream since\n * seeking is not possible.\n *\n * @param time - The time to seek to in seconds.\n */\n seek = (time: number) => {\n PlayerModule.seek(this.nativeId, time);\n };\n\n /**\n * Shifts the time to the given `offset` in seconds from the live edge. The resulting offset has to be within the\n * timeShift window as specified by `maxTimeShift` (which is a negative value) and 0. When the provided `offset` is\n * positive, it will be interpreted as a UNIX timestamp in seconds and converted to fit into the timeShift window.\n * When the provided `offset` is negative, but lower than `maxTimeShift`, then it will be clamped to `maxTimeShift`.\n * Has no effect for VoD.\n *\n * Has no effect if no sources are loaded.\n *\n * @param offset - Target offset from the live edge in seconds.\n */\n timeShift = (offset: number) => {\n PlayerModule.timeShift(this.nativeId, offset);\n };\n\n /**\n * Mutes the player if an audio track is available. Has no effect if the player is already muted.\n */\n mute = () => {\n PlayerModule.mute(this.nativeId);\n };\n\n /**\n * Unmutes the player if it is muted. Has no effect if the player is already unmuted.\n */\n unmute = () => {\n PlayerModule.unmute(this.nativeId);\n };\n\n /**\n * Sets the player's volume between 0 (silent) and 100 (max volume).\n *\n * @param volume - The volume level to set.\n */\n setVolume = (volume: number) => {\n PlayerModule.setVolume(this.nativeId, volume);\n };\n\n private ensureImaBeforeInitializationListener = () => {\n const callback = this.config?.advertisingConfig?.ima?.beforeInitialization;\n if (!callback) {\n return;\n }\n if (this.onImaBeforeInitializationSubscription) {\n return;\n }\n this.onImaBeforeInitializationSubscription = PlayerModule.addListener(\n 'onImaBeforeInitialization',\n ({ nativeId, id, settings }) => {\n if (nativeId !== this.nativeId) {\n return;\n }\n const cloned: ImaSettings = { ...settings };\n let prepared = cloned;\n try {\n const result = callback(cloned);\n prepared =\n result && typeof result === 'object'\n ? { ...cloned, ...result }\n : cloned;\n } catch {\n prepared = cloned;\n }\n PlayerModule.setPreparedImaSettings(id, prepared);\n }\n );\n };\n\n /**\n * @returns The player's current volume level.\n */\n getVolume = async (): Promise<number> => {\n return (await PlayerModule.getVolume(this.nativeId)) ?? 0;\n };\n\n /**\n * @returns The current playback time in seconds.\n *\n * For VoD streams the returned time ranges between 0 and the duration of the asset.\n *\n * For live streams it can be specified if an absolute UNIX timestamp or a value\n * relative to the playback start should be returned.\n *\n * @param mode - The time mode to specify: an absolute UNIX timestamp ('absolute') or relative time ('relative').\n */\n getCurrentTime = async (\n mode: 'relative' | 'absolute' = 'absolute'\n ): Promise<number> => {\n return (await PlayerModule.currentTime(this.nativeId, mode)) ?? 0;\n };\n\n /**\n * @returns The total duration in seconds of the current video or INFINITY if it’s a live stream.\n */\n getDuration = async (): Promise<number> => {\n return (await PlayerModule.duration(this.nativeId)) ?? 0;\n };\n\n /**\n * @returns `true` if the player is muted.\n */\n isMuted = async (): Promise<boolean> => {\n return (await PlayerModule.isMuted(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the player is currently playing, i.e. has started and is not paused.\n */\n isPlaying = async (): Promise<boolean> => {\n return (await PlayerModule.isPlaying(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the player has started playback but it's currently paused.\n */\n isPaused = async (): Promise<boolean> => {\n return (await PlayerModule.isPaused(this.nativeId)) ?? false;\n };\n\n /**\n * @returns `true` if the displayed video is a live stream.\n */\n isLive = async (): Promise<boolean> => {\n return (await PlayerModule.isLive(this.nativeId)) ?? false;\n };\n\n /**\n * @platform iOS\n * @returns `true` when media is played externally using AirPlay.\n */\n isAirPlayActive = async (): Promise<boolean> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method isAirPlayActive is not available for Android. Only iOS devices.`\n );\n return false;\n }\n return (await PlayerModule.isAirPlayActive(this.nativeId)) ?? false;\n };\n\n /**\n * @platform iOS\n * @returns `true` when AirPlay is available.\n */\n isAirPlayAvailable = async (): Promise<boolean> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method isAirPlayAvailable is not available for Android. Only iOS devices.`\n );\n return false;\n }\n return (await PlayerModule.isAirPlayAvailable(this.nativeId)) ?? false;\n };\n\n /**\n * @returns The currently selected audio track or `null`.\n */\n getAudioTrack = async (): Promise<AudioTrack | null> => {\n return PlayerModule.getAudioTrack(this.nativeId);\n };\n\n /**\n * @returns An array containing {@link AudioTrack} objects for all available audio tracks.\n */\n getAvailableAudioTracks = async (): Promise<AudioTrack[]> => {\n return PlayerModule.getAvailableAudioTracks(this.nativeId);\n };\n\n /**\n * Sets the audio track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableAudioTracks.\n *\n * @param trackIdentifier - The {@link AudioTrack.identifier} to be set.\n */\n setAudioTrack = async (trackIdentifier: string): Promise<void> => {\n return PlayerModule.setAudioTrack(this.nativeId, trackIdentifier);\n };\n\n /**\n * @returns The currently selected {@link SubtitleTrack} or `null`.\n */\n getSubtitleTrack = async (): Promise<SubtitleTrack | null> => {\n return PlayerModule.getSubtitleTrack(this.nativeId);\n };\n\n /**\n * @returns An array containing SubtitleTrack objects for all available subtitle tracks.\n */\n getAvailableSubtitles = async (): Promise<SubtitleTrack[]> => {\n return PlayerModule.getAvailableSubtitles(this.nativeId);\n };\n\n /**\n * Sets the subtitle track to the ID specified by trackIdentifier. A list can be retrieved by calling getAvailableSubtitles.\n *\n * @param trackIdentifier - The {@link SubtitleTrack.identifier} to be set.\n */\n setSubtitleTrack = async (trackIdentifier?: string): Promise<void> => {\n return PlayerModule.setSubtitleTrack(this.nativeId, trackIdentifier ?? '');\n };\n\n /**\n * Dynamically schedules the {@link AdItem} for playback.\n * Has no effect if there is no active playback session.\n *\n * @param adItem - Ad to be scheduled for playback.\n *\n * @platform iOS, Android\n */\n scheduleAd = (adItem: AdItem) => {\n PlayerModule.scheduleAd(this.nativeId, adItem);\n };\n\n /**\n * Skips the current ad.\n * Has no effect if the current ad is not skippable or if no ad is being played back.\n *\n * @platform iOS, Android\n */\n skipAd = () => {\n PlayerModule.skipAd(this.nativeId);\n };\n\n /**\n * @returns `true` while an ad is being played back or when main content playback has been paused for ad playback.\n * @platform iOS, Android\n */\n isAd = async (): Promise<boolean> => {\n return (await PlayerModule.isAd(this.nativeId)) ?? false;\n };\n\n /**\n * The current time shift of the live stream in seconds. This value is always 0 if the active {@link Source} is not a\n * live stream or no sources are loaded.\n */\n getTimeShift = async (): Promise<number> => {\n return (await PlayerModule.getTimeShift(this.nativeId)) ?? 0;\n };\n\n /**\n * The limit in seconds for time shifting. This value is either negative or 0 and it is always 0 if the active\n * {@link Source} is not a live stream or no sources are loaded.\n */\n getMaxTimeShift = async (): Promise<number> => {\n return (await PlayerModule.getMaxTimeShift(this.nativeId)) ?? 0;\n };\n\n /**\n * Sets the upper bitrate boundary for video qualities. All qualities with a bitrate\n * that is higher than this threshold will not be eligible for automatic quality selection.\n *\n * Can be set to `null` for no limitation.\n */\n setMaxSelectableBitrate = (bitrate: number | null) => {\n PlayerModule.setMaxSelectableBitrate(this.nativeId, bitrate || -1);\n };\n\n /**\n * @returns a {@link Thumbnail} for the specified playback time for the currently active source if available.\n * Supported thumbnail formats are:\n * - `WebVtt` configured via {@link SourceConfig.thumbnailTrack}, on all supported platforms\n * - HLS `Image Media Playlist` in the multivariant playlist, Android-only\n * - DASH `Image Adaptation Set` as specified in DASH-IF IOP, Android-only\n * If a `WebVtt` thumbnail track is provided, any potential in-manifest thumbnails are ignored on Android.\n *\n * @param time - The time in seconds for which to retrieve the thumbnail.\n */\n getThumbnail = async (time: number): Promise<Thumbnail | null> => {\n return PlayerModule.getThumbnail(this.nativeId, time);\n };\n\n /**\n * Whether casting to a cast-compatible remote device is available. {@link CastAvailableEvent} signals when\n * casting becomes available.\n *\n * @platform iOS, Android\n */\n isCastAvailable = async (): Promise<boolean> => {\n return (await PlayerModule.isCastAvailable(this.nativeId)) ?? false;\n };\n\n /**\n * Whether video is currently being casted to a remote device and not played locally.\n *\n * @platform iOS, Android\n */\n isCasting = async (): Promise<boolean> => {\n return (await PlayerModule.isCasting(this.nativeId)) ?? false;\n };\n\n /**\n * Initiates casting the current video to a cast-compatible remote device. The user has to choose to which device it\n * should be sent.\n *\n * @platform iOS, Android\n */\n castVideo = () => {\n PlayerModule.castVideo(this.nativeId);\n };\n\n /**\n * Stops casting the current video. Has no effect if {@link Player.isCasting} is `false`.\n *\n * @platform iOS, Android\n */\n castStop = () => {\n PlayerModule.castStop(this.nativeId);\n };\n\n /**\n * Returns the currently selected video quality.\n * @returns The currently selected video quality.\n */\n getVideoQuality = async (): Promise<VideoQuality> => {\n return PlayerModule.getVideoQuality(this.nativeId);\n };\n\n /**\n * Returns an array containing all available video qualities the player can adapt between.\n * @returns An array containing all available video qualities the player can adapt between.\n */\n getAvailableVideoQualities = async (): Promise<VideoQuality[]> => {\n return PlayerModule.getAvailableVideoQualities(this.nativeId);\n };\n\n /**\n * Sets the video quality.\n * @platform Android\n *\n * @param qualityId value obtained from {@link VideoQuality}'s `id` property, which can be obtained via `Player.getAvailableVideoQualities()` to select a specific quality. To use automatic quality selection, 'auto' can be passed here.\n */\n setVideoQuality = (qualityId: string) => {\n if (Platform.OS !== 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method setVideoQuality is not available for iOS and tvOS devices. Only Android devices.`\n );\n return;\n }\n PlayerModule.setVideoQuality(this.nativeId, qualityId);\n };\n\n /**\n * Sets the playback speed of the player. Fast forward, slow motion and reverse playback are supported.\n * @remarks\n * Platform: iOS, tvOS\n *\n * - Slow motion is indicated by values between `0` and `1`.\n * - Fast forward by values greater than `1`.\n * - Slow reverse is used by values between `0` and `-1`, and fast reverse is used by values less than `-1`. iOS and tvOS only.\n * - Negative values are ignored during Casting and on Android.\n * - During reverse playback the playback will continue until the beginning of the active source is\n * reached. When reaching the beginning of the source, playback will be paused and the playback\n * speed will be reset to its default value of `1`. No {@link PlaybackFinishedEvent} will be\n * emitted in this case.\n *\n * @param playbackSpeed - The playback speed to set.\n */\n setPlaybackSpeed = (playbackSpeed: number) => {\n PlayerModule.setPlaybackSpeed(this.nativeId, playbackSpeed);\n };\n\n /**\n * @see {@link setPlaybackSpeed} for details on which values playback speed can assume.\n * @returns The player's current playback speed.\n */\n getPlaybackSpeed = async (): Promise<number> => {\n return (await PlayerModule.getPlaybackSpeed(this.nativeId)) ?? 0;\n };\n\n /**\n * Checks the possibility to play the media at specified playback speed.\n * @param playbackSpeed - The playback speed to check.\n * @returns `true` if it's possible to play the media at the specified playback speed, otherwise `false`. On Android it always returns `undefined`.\n * @platform iOS, tvOS\n */\n canPlayAtPlaybackSpeed = async (\n playbackSpeed: number\n ): Promise<boolean | undefined> => {\n if (Platform.OS === 'android') {\n console.warn(\n `[Player ${this.nativeId}] Method canPlayAtPlaybackSpeed is not available for Android. Only iOS and tvOS devices.`\n );\n return undefined;\n }\n return (\n (await PlayerModule.canPlayAtPlaybackSpeed(\n this.nativeId,\n playbackSpeed\n )) ?? false\n );\n };\n\n private maybeInitDecoderConfig = () => {\n if (this.config?.playbackConfig?.decoderConfig == null) {\n return;\n }\n if (Platform.OS === 'ios') {\n return;\n }\n\n this.decoderConfig = new DecoderConfigBridge(\n this.config.playbackConfig.decoderConfig\n );\n this.decoderConfig.initialize();\n };\n}\n"]}
package/build/source.d.ts CHANGED
@@ -129,7 +129,7 @@ export interface SourceConfig extends NativeInstanceConfig {
129
129
  }
130
130
  /**
131
131
  * The remote control config for a source.
132
- * @remarks Platform: iOS
132
+ * @platform iOS
133
133
  */
134
134
  export interface SourceRemoteControlConfig {
135
135
  /**
@@ -153,7 +153,7 @@ export declare class Source extends NativeInstance<SourceConfig> {
153
153
  * The remote control config for this source.
154
154
  * This is only supported on iOS.
155
155
  *
156
- * @remarks Platform: iOS
156
+ * @platform iOS
157
157
  */
158
158
  remoteControl: SourceRemoteControlConfig | null;
159
159
  /**
package/build/source.js CHANGED
@@ -68,7 +68,7 @@ export class Source extends NativeInstance {
68
68
  * The remote control config for this source.
69
69
  * This is only supported on iOS.
70
70
  *
71
- * @remarks Platform: iOS
71
+ * @platform iOS
72
72
  */
73
73
  remoteControl = null;
74
74
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"source.js","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAa,MAAM,OAAO,CAAC;AACvC,OAAO,cAAwC,MAAM,kBAAkB,CAAC;AAIxE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAN,IAAY,UAiBX;AAjBD,WAAY,UAAU;IACpB;;OAEG;IACH,2BAAa,CAAA;IACb;;OAEG;IACH,yBAAW,CAAA;IACX;;OAEG;IACH,2BAA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CAAC,CAAC;IAEF;;;;;OAKG;IACH,WAAW,GAAG,CAAC,QAAoC,EAAQ,EAAE;QAC3D,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACpD,CAAC,CAAC;IAEF;;OAEG;IACH,YAAY,GAAG,KAAK,IAA2B,EAAE;QAC/C,OAAO,CACL,CAAC,MAAM,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,YAAY,CAAC,QAAQ,CAC1E,CAAC;IACJ,CAAC,CAAC;IAEF;;;;;;;;;OASG;IACH,YAAY,GAAG,KAAK,EAAE,IAAY,EAA6B,EAAE;QAC/D,OAAO,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC,CAAC;CACH","sourcesContent":["import { Drm, DrmConfig } from './drm';\nimport NativeInstance, { NativeInstanceConfig } from './nativeInstance';\nimport { SideLoadedSubtitleTrack } from './subtitleTrack';\nimport { Thumbnail } from './thumbnail';\nimport { SourceMetadata } from './analytics';\nimport SourceModule from './modules/SourceModule';\n\n/**\n * Types of media that can be handled by the player.\n */\nexport enum SourceType {\n /**\n * Indicates a missing source type.\n */\n NONE = 'none',\n /**\n * Indicates media type HLS.\n */\n HLS = 'hls',\n /**\n * Indicates media type DASH.\n */\n DASH = 'dash',\n /**\n * Indicates media type Progressive MP4.\n */\n PROGRESSIVE = 'progressive',\n}\n\n/**\n * The different loading states a {@link Source} instance can be in.\n */\nexport enum LoadingState {\n /**\n * The source is unloaded.\n */\n UNLOADED = 0,\n /**\n * The source is currently loading.\n */\n LOADING = 1,\n /**\n * The source is loaded.\n */\n LOADED = 2,\n}\n\n/**\n * Types of SourceOptions.\n */\nexport interface SourceOptions {\n /**\n * The position where the stream should be started.\n * Number can be positive or negative depending on the used `TimelineReferencePoint`.\n * Invalid numbers will be corrected according to the stream boundaries.\n * For VOD this is applied at the time the stream is loaded, for LIVE when playback starts.\n */\n startOffset?: number;\n /**\n * Sets the Timeline reference point to calculate the startOffset from.\n * Default for live: `TimelineReferencePoint.END`.\n * Default for VOD: `TimelineReferencePoint.START`.\n */\n startOffsetTimelineReference?: TimelineReferencePoint;\n}\n\n/**\n Timeline reference point to calculate SourceOptions.startOffset from.\n Default for live: TimelineReferencePoint.EBD Default for VOD: TimelineReferencePoint.START.\n */\nexport enum TimelineReferencePoint {\n /**\n * Relative offset will be calculated from the beginning of the stream or DVR window.\n */\n START = 'start',\n /**\n * Relative offset will be calculated from the end of the stream or the live edge in case of a live stream with DVR window.\n */\n END = 'end',\n}\n\n/**\n * Represents a source configuration that be loaded into a player instance.\n */\nexport interface SourceConfig extends NativeInstanceConfig {\n /**\n * The url for this source configuration.\n */\n url: string;\n /**\n * The `SourceType` for this configuration.\n */\n type?: SourceType;\n /**\n * The title of the video source.\n */\n title?: string;\n /**\n * The description of the video source.\n */\n description?: string;\n /**\n * The URL to a preview image displayed until the video starts.\n */\n poster?: string;\n /**\n * Indicates whether to show the poster image during playback.\n * Useful, for example, for audio-only streams.\n */\n isPosterPersistent?: boolean;\n /**\n * The DRM config for the source.\n */\n drmConfig?: DrmConfig;\n /**\n * External subtitle tracks to be added into the player.\n */\n subtitleTracks?: SideLoadedSubtitleTrack[];\n /**\n * External thumbnails to be added into the player.\n */\n thumbnailTrack?: string;\n /**\n * The optional custom metadata. Also sent to the cast receiver when loading the Source.\n */\n metadata?: Record<string, string>;\n /**\n * The `SourceOptions` for this configuration.\n */\n options?: SourceOptions;\n /**\n * The `SourceMetadata` for the {@link Source} to setup custom analytics tracking\n */\n analyticsSourceMetadata?: SourceMetadata;\n}\n\n/**\n * The remote control config for a source.\n * @remarks Platform: iOS\n */\nexport interface SourceRemoteControlConfig {\n /**\n * The `SourceConfig` for casting.\n * Enables to play different content when casting.\n * This can be useful when the remote playback device supports different streaming formats,\n * DRM systems, etc. than the local device.\n * If not set, the local source config will be used for casting.\n */\n castSourceConfig?: SourceConfig | null;\n}\n\n/**\n * Represents audio and video content that can be loaded into a player.\n */\nexport class Source extends NativeInstance<SourceConfig> {\n /**\n * The native DRM config reference of this source.\n */\n private drm?: Drm;\n /**\n * The remote control config for this source.\n * This is only supported on iOS.\n *\n * @remarks Platform: iOS\n */\n remoteControl: SourceRemoteControlConfig | null = null;\n /**\n * Whether the native {@link Source} object has been created.\n */\n isInitialized = false;\n /**\n * Whether the native {@link Source} object has been disposed.\n */\n isDestroyed = false;\n\n /**\n * Allocates the native {@link Source} instance and its resources natively.\n */\n initialize = async (): Promise<void> => {\n if (!this.isInitialized) {\n const sourceMetadata = this.config?.analyticsSourceMetadata;\n if (this.config?.drmConfig) {\n this.drm = new Drm(this.config.drmConfig);\n this.drm.initialize();\n }\n if (sourceMetadata) {\n await SourceModule.initializeWithAnalyticsConfig(\n this.nativeId,\n this.drm?.nativeId,\n this.config,\n this.remoteControl || undefined,\n sourceMetadata\n );\n } else {\n await SourceModule.initializeWithConfig(\n this.nativeId,\n this.drm?.nativeId,\n this.config,\n this.remoteControl || undefined\n );\n }\n this.isInitialized = true;\n }\n return Promise.resolve();\n };\n\n /**\n * Destroys the native {@link Source} and releases all of its allocated resources.\n */\n destroy = () => {\n if (!this.isDestroyed) {\n SourceModule.destroy(this.nativeId);\n this.drm?.destroy();\n this.isDestroyed = true;\n }\n };\n\n /**\n * The duration of the source in seconds if it’s a VoD or `INFINITY` if it’s a live stream.\n * Default value is `0` if the duration is not available or not known.\n */\n duration = async (): Promise<number> => {\n return (await SourceModule.duration(this.nativeId)) || 0;\n };\n\n /**\n * Whether the source is currently active in a player (i.e. playing back or paused).\n * Only one source can be active in the same player instance at any time.\n */\n isActive = async (): Promise<boolean> => {\n return (await SourceModule.isActive(this.nativeId)) ?? false;\n };\n\n /**\n * Whether the source is currently attached to a player instance.\n */\n isAttachedToPlayer = async (): Promise<boolean> => {\n return (await SourceModule.isAttachedToPlayer(this.nativeId)) ?? false;\n };\n\n /**\n * Metadata for the currently loaded source.\n */\n metadata = async (): Promise<Record<string, any> | null> => {\n return SourceModule.getMetadata(this.nativeId);\n };\n\n /**\n * Set metadata for the currently loaded source.\n * Setting the metadata to `null` clears the metadata object in native source.\n *\n * @param metadata metadata to be set.\n */\n setMetadata = (metadata: Record<string, any> | null): void => {\n SourceModule.setMetadata(this.nativeId, metadata);\n };\n\n /**\n * The current `LoadingState` of the source.\n */\n loadingState = async (): Promise<LoadingState> => {\n return (\n (await SourceModule.loadingState(this.nativeId)) || LoadingState.UNLOADED\n );\n };\n\n /**\n * @returns a `Thumbnail` for the specified playback time if available.\n * Supported thumbnail formats are:\n * - `WebVtt` configured via {@link SourceConfig.thumbnailTrack}, on all supported platforms\n * - HLS `Image Media Playlist` in the multivariant playlist, Android-only\n * - DASH `Image Adaptation Set` as specified in DASH-IF IOP, Android-only\n * If a `WebVtt` thumbnail track is provided, any potential in-manifest thumbnails are ignored on Android.\n *\n * @param time - The time in seconds for which to retrieve the thumbnail.\n */\n getThumbnail = async (time: number): Promise<Thumbnail | null> => {\n return SourceModule.getThumbnail(this.nativeId, time);\n };\n}\n"]}
1
+ {"version":3,"file":"source.js","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAa,MAAM,OAAO,CAAC;AACvC,OAAO,cAAwC,MAAM,kBAAkB,CAAC;AAIxE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAN,IAAY,UAiBX;AAjBD,WAAY,UAAU;IACpB;;OAEG;IACH,2BAAa,CAAA;IACb;;OAEG;IACH,yBAAW,CAAA;IACX;;OAEG;IACH,2BAAa,CAAA;IACb;;OAEG;IACH,yCAA2B,CAAA;AAC7B,CAAC,EAjBW,UAAU,KAAV,UAAU,QAiBrB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,YAaX;AAbD,WAAY,YAAY;IACtB;;OAEG;IACH,uDAAY,CAAA;IACZ;;OAEG;IACH,qDAAW,CAAA;IACX;;OAEG;IACH,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AO,CACL,CAAC,MAAM,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,YAAY,CAAC,QAAQ,CAC1E,CAAC;IACJ,CAAC,CAAC;IAEF;;;;;;;;;OASG;IACH,YAAY,GAAG,KAAK,EAAE,IAAY,EAA6B,EAAE;QAC/D,OAAO,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC,CAAC;CACH","sourcesContent":["import { Drm, DrmConfig } from './drm';\nimport NativeInstance, { NativeInstanceConfig } from './nativeInstance';\nimport { SideLoadedSubtitleTrack } from './subtitleTrack';\nimport { Thumbnail } from './thumbnail';\nimport { SourceMetadata } from './analytics';\nimport SourceModule from './modules/SourceModule';\n\n/**\n * Types of media that can be handled by the player.\n */\nexport enum SourceType {\n /**\n * Indicates a missing source type.\n */\n NONE = 'none',\n /**\n * Indicates media type HLS.\n */\n HLS = 'hls',\n /**\n * Indicates media type DASH.\n */\n DASH = 'dash',\n /**\n * Indicates media type Progressive MP4.\n */\n PROGRESSIVE = 'progressive',\n}\n\n/**\n * The different loading states a {@link Source} instance can be in.\n */\nexport enum LoadingState {\n /**\n * The source is unloaded.\n */\n UNLOADED = 0,\n /**\n * The source is currently loading.\n */\n LOADING = 1,\n /**\n * The source is loaded.\n */\n LOADED = 2,\n}\n\n/**\n * Types of SourceOptions.\n */\nexport interface SourceOptions {\n /**\n * The position where the stream should be started.\n * Number can be positive or negative depending on the used `TimelineReferencePoint`.\n * Invalid numbers will be corrected according to the stream boundaries.\n * For VOD this is applied at the time the stream is loaded, for LIVE when playback starts.\n */\n startOffset?: number;\n /**\n * Sets the Timeline reference point to calculate the startOffset from.\n * Default for live: `TimelineReferencePoint.END`.\n * Default for VOD: `TimelineReferencePoint.START`.\n */\n startOffsetTimelineReference?: TimelineReferencePoint;\n}\n\n/**\n Timeline reference point to calculate SourceOptions.startOffset from.\n Default for live: TimelineReferencePoint.EBD Default for VOD: TimelineReferencePoint.START.\n */\nexport enum TimelineReferencePoint {\n /**\n * Relative offset will be calculated from the beginning of the stream or DVR window.\n */\n START = 'start',\n /**\n * Relative offset will be calculated from the end of the stream or the live edge in case of a live stream with DVR window.\n */\n END = 'end',\n}\n\n/**\n * Represents a source configuration that be loaded into a player instance.\n */\nexport interface SourceConfig extends NativeInstanceConfig {\n /**\n * The url for this source configuration.\n */\n url: string;\n /**\n * The `SourceType` for this configuration.\n */\n type?: SourceType;\n /**\n * The title of the video source.\n */\n title?: string;\n /**\n * The description of the video source.\n */\n description?: string;\n /**\n * The URL to a preview image displayed until the video starts.\n */\n poster?: string;\n /**\n * Indicates whether to show the poster image during playback.\n * Useful, for example, for audio-only streams.\n */\n isPosterPersistent?: boolean;\n /**\n * The DRM config for the source.\n */\n drmConfig?: DrmConfig;\n /**\n * External subtitle tracks to be added into the player.\n */\n subtitleTracks?: SideLoadedSubtitleTrack[];\n /**\n * External thumbnails to be added into the player.\n */\n thumbnailTrack?: string;\n /**\n * The optional custom metadata. Also sent to the cast receiver when loading the Source.\n */\n metadata?: Record<string, string>;\n /**\n * The `SourceOptions` for this configuration.\n */\n options?: SourceOptions;\n /**\n * The `SourceMetadata` for the {@link Source} to setup custom analytics tracking\n */\n analyticsSourceMetadata?: SourceMetadata;\n}\n\n/**\n * The remote control config for a source.\n * @platform iOS\n */\nexport interface SourceRemoteControlConfig {\n /**\n * The `SourceConfig` for casting.\n * Enables to play different content when casting.\n * This can be useful when the remote playback device supports different streaming formats,\n * DRM systems, etc. than the local device.\n * If not set, the local source config will be used for casting.\n */\n castSourceConfig?: SourceConfig | null;\n}\n\n/**\n * Represents audio and video content that can be loaded into a player.\n */\nexport class Source extends NativeInstance<SourceConfig> {\n /**\n * The native DRM config reference of this source.\n */\n private drm?: Drm;\n /**\n * The remote control config for this source.\n * This is only supported on iOS.\n *\n * @platform iOS\n */\n remoteControl: SourceRemoteControlConfig | null = null;\n /**\n * Whether the native {@link Source} object has been created.\n */\n isInitialized = false;\n /**\n * Whether the native {@link Source} object has been disposed.\n */\n isDestroyed = false;\n\n /**\n * Allocates the native {@link Source} instance and its resources natively.\n */\n initialize = async (): Promise<void> => {\n if (!this.isInitialized) {\n const sourceMetadata = this.config?.analyticsSourceMetadata;\n if (this.config?.drmConfig) {\n this.drm = new Drm(this.config.drmConfig);\n this.drm.initialize();\n }\n if (sourceMetadata) {\n await SourceModule.initializeWithAnalyticsConfig(\n this.nativeId,\n this.drm?.nativeId,\n this.config,\n this.remoteControl || undefined,\n sourceMetadata\n );\n } else {\n await SourceModule.initializeWithConfig(\n this.nativeId,\n this.drm?.nativeId,\n this.config,\n this.remoteControl || undefined\n );\n }\n this.isInitialized = true;\n }\n return Promise.resolve();\n };\n\n /**\n * Destroys the native {@link Source} and releases all of its allocated resources.\n */\n destroy = () => {\n if (!this.isDestroyed) {\n SourceModule.destroy(this.nativeId);\n this.drm?.destroy();\n this.isDestroyed = true;\n }\n };\n\n /**\n * The duration of the source in seconds if it’s a VoD or `INFINITY` if it’s a live stream.\n * Default value is `0` if the duration is not available or not known.\n */\n duration = async (): Promise<number> => {\n return (await SourceModule.duration(this.nativeId)) || 0;\n };\n\n /**\n * Whether the source is currently active in a player (i.e. playing back or paused).\n * Only one source can be active in the same player instance at any time.\n */\n isActive = async (): Promise<boolean> => {\n return (await SourceModule.isActive(this.nativeId)) ?? false;\n };\n\n /**\n * Whether the source is currently attached to a player instance.\n */\n isAttachedToPlayer = async (): Promise<boolean> => {\n return (await SourceModule.isAttachedToPlayer(this.nativeId)) ?? false;\n };\n\n /**\n * Metadata for the currently loaded source.\n */\n metadata = async (): Promise<Record<string, any> | null> => {\n return SourceModule.getMetadata(this.nativeId);\n };\n\n /**\n * Set metadata for the currently loaded source.\n * Setting the metadata to `null` clears the metadata object in native source.\n *\n * @param metadata metadata to be set.\n */\n setMetadata = (metadata: Record<string, any> | null): void => {\n SourceModule.setMetadata(this.nativeId, metadata);\n };\n\n /**\n * The current `LoadingState` of the source.\n */\n loadingState = async (): Promise<LoadingState> => {\n return (\n (await SourceModule.loadingState(this.nativeId)) || LoadingState.UNLOADED\n );\n };\n\n /**\n * @returns a `Thumbnail` for the specified playback time if available.\n * Supported thumbnail formats are:\n * - `WebVtt` configured via {@link SourceConfig.thumbnailTrack}, on all supported platforms\n * - HLS `Image Media Playlist` in the multivariant playlist, Android-only\n * - DASH `Image Adaptation Set` as specified in DASH-IF IOP, Android-only\n * If a `WebVtt` thumbnail track is provided, any potential in-manifest thumbnails are ignored on Android.\n *\n * @param time - The time in seconds for which to retrieve the thumbnail.\n */\n getThumbnail = async (time: number): Promise<Thumbnail | null> => {\n return SourceModule.getThumbnail(this.nativeId, time);\n };\n}\n"]}
@@ -26,7 +26,7 @@ export interface StyleConfig {
26
26
  * },
27
27
  * });
28
28
  * ```
29
- * @remarks Platform: iOS, tvOS
29
+ * @platform iOS, tvOS
30
30
  */
31
31
  userInterfaceType?: UserInterfaceType;
32
32
  /**
@@ -39,7 +39,7 @@ export interface StyleConfig {
39
39
  * },
40
40
  * });
41
41
  * ```
42
- * @remarks Platform: iOS, Android
42
+ * @platform iOS, Android
43
43
  */
44
44
  playerUiCss?: string;
45
45
  /**
@@ -52,7 +52,7 @@ export interface StyleConfig {
52
52
  * },
53
53
  * });
54
54
  * ```
55
- * @remarks Platform: iOS, Android
55
+ * @platform iOS, Android
56
56
  */
57
57
  supplementalPlayerUiCss?: string;
58
58
  /**
@@ -65,7 +65,7 @@ export interface StyleConfig {
65
65
  * },
66
66
  * });
67
67
  * ```
68
- * @remarks Platform: iOS, Android
68
+ * @platform iOS, Android
69
69
  */
70
70
  playerUiJs?: string;
71
71
  /**
@@ -109,7 +109,7 @@ export declare enum UserInterfaceType {
109
109
  Bitmovin = "Bitmovin",
110
110
  /**
111
111
  * Indicates that the system UI should be used.
112
- * @remarks Platform: iOS, tvOS
112
+ * @platform iOS, tvOS
113
113
  */
114
114
  System = "System",
115
115
  /**
@@ -27,7 +27,7 @@ export var UserInterfaceType;
27
27
  UserInterfaceType["Bitmovin"] = "Bitmovin";
28
28
  /**
29
29
  * Indicates that the system UI should be used.
30
- * @remarks Platform: iOS, tvOS
30
+ * @platform iOS, tvOS
31
31
  */
32
32
  UserInterfaceType["System"] = "System";
33
33
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"styleConfig.js","sourceRoot":"","sources":["../src/styleConfig.ts"],"names":[],"mappings":"AAqFA;;GAEG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB;;OAEG;IACH,0BAAW,CAAA;IACX;;OAEG;IACH,kCAAmB,CAAA;IACnB;;OAEG;IACH,4BAAa,CAAA;AACf,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,iBAcX;AAdD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,0CAAqB,CAAA;IACrB;;;OAGG;IACH,sCAAiB,CAAA;IACjB;;OAEG;IACH,0CAAqB,CAAA;AACvB,CAAC,EAdW,iBAAiB,KAAjB,iBAAiB,QAc5B","sourcesContent":["/**\n * Contains config values which can be used to alter the visual presentation and behaviour of the player UI.\n */\nexport interface StyleConfig {\n /**\n * Sets if the UI should be enabled or not. Default value is `true`.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * isUiEnabled: false,\n * },\n * });\n * ```\n */\n isUiEnabled?: boolean;\n /**\n * Sets which user interface type should be used.\n * Default value is `UserInterfaceType.bitmovin` on `iOS` and `UserInterfaceType.system` on `tvOS`.\n * This setting only applies if `StyleConfig.isUiEnabled` is set to true.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * userInterfaceType: UserInterfaceType.System,\n * },\n * });\n * ```\n * @remarks Platform: iOS, tvOS\n */\n userInterfaceType?: UserInterfaceType;\n /**\n * Sets 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.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * playerUiCss: 'https://domain.tld/path/to/bitmovinplayer-ui.css',\n * },\n * });\n * ```\n * @remarks Platform: iOS, Android\n */\n playerUiCss?: string;\n /**\n * Sets 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`.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * supplementalPlayerUiCss: 'https://domain.tld/path/to/bitmovinplayer-supplemental-ui.css',\n * },\n * });\n * ```\n * @remarks Platform: iOS, Android\n */\n supplementalPlayerUiCss?: string;\n /**\n * 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.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * playerUiJs: 'https://domain.tld/path/to/bitmovinplayer-ui.js',\n * },\n * });\n * ```\n * @remarks Platform: iOS, Android\n */\n playerUiJs?: string;\n /**\n * Determines how the video content is scaled or stretched within the parent container’s bounds. Possible values are defined in `ScalingMode`.\n * Default value is `ScalingMode.fit`.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * scalingMode: ScalingMode.Zoom,\n * },\n * });\n * ```\n */\n scalingMode?: ScalingMode;\n}\n\n/**\n * Specifies how the video content is scaled or stretched.\n */\nexport enum ScalingMode {\n /**\n * Specifies that the player should preserve the video’s aspect ratio and fit the video within the container's bounds.\n */\n Fit = 'Fit',\n /**\n * Specifies that the video should be stretched to fill the container’s bounds. The aspect ratio may not be preserved.\n */\n Stretch = 'Stretch',\n /**\n * Specifies that the player should preserve the video’s aspect ratio and fill the container’s bounds.\n */\n Zoom = 'Zoom',\n}\n\n/**\n * Indicates which type of UI should be used.\n */\nexport enum UserInterfaceType {\n /**\n * Indicates that Bitmovin's customizable UI should be used.\n */\n Bitmovin = 'Bitmovin',\n /**\n * Indicates that the system UI should be used.\n * @remarks Platform: iOS, tvOS\n */\n System = 'System',\n /**\n * Indicates that only subtitles should be displayed along with the video content.\n */\n Subtitle = 'Subtitle',\n}\n"]}
1
+ {"version":3,"file":"styleConfig.js","sourceRoot":"","sources":["../src/styleConfig.ts"],"names":[],"mappings":"AAqFA;;GAEG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB;;OAEG;IACH,0BAAW,CAAA;IACX;;OAEG;IACH,kCAAmB,CAAA;IACnB;;OAEG;IACH,4BAAa,CAAA;AACf,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,iBAcX;AAdD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,0CAAqB,CAAA;IACrB;;;OAGG;IACH,sCAAiB,CAAA;IACjB;;OAEG;IACH,0CAAqB,CAAA;AACvB,CAAC,EAdW,iBAAiB,KAAjB,iBAAiB,QAc5B","sourcesContent":["/**\n * Contains config values which can be used to alter the visual presentation and behaviour of the player UI.\n */\nexport interface StyleConfig {\n /**\n * Sets if the UI should be enabled or not. Default value is `true`.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * isUiEnabled: false,\n * },\n * });\n * ```\n */\n isUiEnabled?: boolean;\n /**\n * Sets which user interface type should be used.\n * Default value is `UserInterfaceType.bitmovin` on `iOS` and `UserInterfaceType.system` on `tvOS`.\n * This setting only applies if `StyleConfig.isUiEnabled` is set to true.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * userInterfaceType: UserInterfaceType.System,\n * },\n * });\n * ```\n * @platform iOS, tvOS\n */\n userInterfaceType?: UserInterfaceType;\n /**\n * Sets 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.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * playerUiCss: 'https://domain.tld/path/to/bitmovinplayer-ui.css',\n * },\n * });\n * ```\n * @platform iOS, Android\n */\n playerUiCss?: string;\n /**\n * Sets 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`.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * supplementalPlayerUiCss: 'https://domain.tld/path/to/bitmovinplayer-supplemental-ui.css',\n * },\n * });\n * ```\n * @platform iOS, Android\n */\n supplementalPlayerUiCss?: string;\n /**\n * 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.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * playerUiJs: 'https://domain.tld/path/to/bitmovinplayer-ui.js',\n * },\n * });\n * ```\n * @platform iOS, Android\n */\n playerUiJs?: string;\n /**\n * Determines how the video content is scaled or stretched within the parent container’s bounds. Possible values are defined in `ScalingMode`.\n * Default value is `ScalingMode.fit`.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * scalingMode: ScalingMode.Zoom,\n * },\n * });\n * ```\n */\n scalingMode?: ScalingMode;\n}\n\n/**\n * Specifies how the video content is scaled or stretched.\n */\nexport enum ScalingMode {\n /**\n * Specifies that the player should preserve the video’s aspect ratio and fit the video within the container's bounds.\n */\n Fit = 'Fit',\n /**\n * Specifies that the video should be stretched to fill the container’s bounds. The aspect ratio may not be preserved.\n */\n Stretch = 'Stretch',\n /**\n * Specifies that the player should preserve the video’s aspect ratio and fill the container’s bounds.\n */\n Zoom = 'Zoom',\n}\n\n/**\n * Indicates which type of UI should be used.\n */\nexport enum UserInterfaceType {\n /**\n * Indicates that Bitmovin's customizable UI should be used.\n */\n Bitmovin = 'Bitmovin',\n /**\n * Indicates that the system UI should be used.\n * @platform iOS, tvOS\n */\n System = 'System',\n /**\n * Indicates that only subtitles should be displayed along with the video content.\n */\n Subtitle = 'Subtitle',\n}\n"]}
@@ -1,26 +1,26 @@
1
1
  /**
2
2
  * Supported subtitle/caption file formats.
3
- * @remarks Platform: Android, iOS, tvOS
3
+ * @platform Android, iOS, tvOS
4
4
  */
5
5
  export declare enum SubtitleFormat {
6
6
  /**
7
7
  * Closed Captioning (CEA) subtitle format.
8
- * @remarks Platform: Android, iOS, tvOS
8
+ * @platform Android, iOS, tvOS
9
9
  */
10
10
  CEA = "cea",
11
11
  /**
12
12
  * Timed Text Markup Language (TTML) subtitle format.
13
- * @remarks Platform: Android, iOS, tvOS
13
+ * @platform Android, iOS, tvOS
14
14
  */
15
15
  TTML = "ttml",
16
16
  /**
17
17
  * Web Video Text Tracks Format (WebVTT) subtitle format.
18
- * @remarks Platform: Android, iOS, tvOS
18
+ * @platform Android, iOS, tvOS
19
19
  */
20
20
  VTT = "vtt",
21
21
  /**
22
22
  * SubRip (SRT) subtitle format.
23
- * @remarks Platform: Android, iOS, tvOS
23
+ * @platform Android, iOS, tvOS
24
24
  */
25
25
  SRT = "srt"
26
26
  }
@@ -1,27 +1,27 @@
1
1
  /**
2
2
  * Supported subtitle/caption file formats.
3
- * @remarks Platform: Android, iOS, tvOS
3
+ * @platform Android, iOS, tvOS
4
4
  */
5
5
  export var SubtitleFormat;
6
6
  (function (SubtitleFormat) {
7
7
  /**
8
8
  * Closed Captioning (CEA) subtitle format.
9
- * @remarks Platform: Android, iOS, tvOS
9
+ * @platform Android, iOS, tvOS
10
10
  */
11
11
  SubtitleFormat["CEA"] = "cea";
12
12
  /**
13
13
  * Timed Text Markup Language (TTML) subtitle format.
14
- * @remarks Platform: Android, iOS, tvOS
14
+ * @platform Android, iOS, tvOS
15
15
  */
16
16
  SubtitleFormat["TTML"] = "ttml";
17
17
  /**
18
18
  * Web Video Text Tracks Format (WebVTT) subtitle format.
19
- * @remarks Platform: Android, iOS, tvOS
19
+ * @platform Android, iOS, tvOS
20
20
  */
21
21
  SubtitleFormat["VTT"] = "vtt";
22
22
  /**
23
23
  * SubRip (SRT) subtitle format.
24
- * @remarks Platform: Android, iOS, tvOS
24
+ * @platform Android, iOS, tvOS
25
25
  */
26
26
  SubtitleFormat["SRT"] = "srt";
27
27
  })(SubtitleFormat || (SubtitleFormat = {}));