bitmovin-player-react-native 1.9.0 → 1.10.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 (79) hide show
  1. package/.eslintrc.js +11 -0
  2. package/CHANGELOG.md +25 -0
  3. package/android/build.gradle +2 -2
  4. package/android/src/main/java/com/bitmovin/player/reactnative/RNPlayerViewManager.kt +35 -1
  5. package/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +47 -28
  6. package/build/advertising.d.ts +3 -3
  7. package/build/advertising.js.map +1 -1
  8. package/build/components/PlayerView/events.d.ts +7 -1
  9. package/build/components/PlayerView/events.d.ts.map +1 -1
  10. package/build/components/PlayerView/events.js.map +1 -1
  11. package/build/components/PlayerView/index.d.ts.map +1 -1
  12. package/build/components/PlayerView/index.js +3 -3
  13. package/build/components/PlayerView/index.js.map +1 -1
  14. package/build/components/PlayerView/nativeEvents.d.ts +9 -1
  15. package/build/components/PlayerView/nativeEvents.d.ts.map +1 -1
  16. package/build/components/PlayerView/nativeEvents.js.map +1 -1
  17. package/build/drm/fairplayDrmApi.d.ts +21 -0
  18. package/build/drm/fairplayDrmApi.d.ts.map +1 -0
  19. package/build/drm/fairplayDrmApi.js +30 -0
  20. package/build/drm/fairplayDrmApi.js.map +1 -0
  21. package/build/drm/index.d.ts +9 -1
  22. package/build/drm/index.d.ts.map +1 -1
  23. package/build/drm/index.js +13 -0
  24. package/build/drm/index.js.map +1 -1
  25. package/build/events.d.ts +37 -3
  26. package/build/events.d.ts.map +1 -1
  27. package/build/events.js.map +1 -1
  28. package/build/metadata.d.ts.map +1 -1
  29. package/build/metadata.js.map +1 -1
  30. package/build/modules/SourceModule.d.ts +6 -0
  31. package/build/modules/SourceModule.d.ts.map +1 -1
  32. package/build/modules/SourceModule.js.map +1 -1
  33. package/build/network/index.js +4 -12
  34. package/build/network/index.js.map +1 -1
  35. package/build/offline/offlineContentManager.js +1 -1
  36. package/build/offline/offlineContentManager.js.map +1 -1
  37. package/build/offline/offlineContentManagerListener.d.ts.map +1 -1
  38. package/build/offline/offlineContentManagerListener.js.map +1 -1
  39. package/build/player.js +24 -24
  40. package/build/player.js.map +1 -1
  41. package/build/source.d.ts +6 -3
  42. package/build/source.d.ts.map +1 -1
  43. package/build/source.js +8 -5
  44. package/build/source.js.map +1 -1
  45. package/build/tweaksConfig.d.ts +8 -0
  46. package/build/tweaksConfig.d.ts.map +1 -1
  47. package/build/tweaksConfig.js.map +1 -1
  48. package/build/ui/custommessagehandlerbridge.d.ts.map +1 -1
  49. package/build/ui/custommessagehandlerbridge.js +4 -4
  50. package/build/ui/custommessagehandlerbridge.js.map +1 -1
  51. package/build/ui/fullscreenhandlerbridge.js +5 -5
  52. package/build/ui/fullscreenhandlerbridge.js.map +1 -1
  53. package/ios/Event+JSON.swift +20 -1
  54. package/ios/FairplayContentKeyRequestRegistry.swift +39 -0
  55. package/ios/NetworkModule.swift +1 -0
  56. package/ios/PlayerModule.swift +3 -3
  57. package/ios/RCTConvert+BitmovinPlayer.swift +1 -0
  58. package/ios/RNBitmovinPlayer.podspec +1 -1
  59. package/ios/RNPlayerView.swift +5 -0
  60. package/ios/RNPlayerViewManager.swift +2 -1
  61. package/ios/SourceModule.swift +24 -0
  62. package/package.json +2 -2
  63. package/src/advertising.ts +3 -3
  64. package/src/components/PlayerView/events.ts +7 -0
  65. package/src/components/PlayerView/index.tsx +3 -2
  66. package/src/components/PlayerView/nativeEvents.ts +9 -0
  67. package/src/drm/fairplayDrmApi.ts +36 -0
  68. package/src/drm/index.ts +14 -2
  69. package/src/events.ts +40 -3
  70. package/src/metadata.ts +2 -4
  71. package/src/modules/SourceModule.ts +10 -0
  72. package/src/network/index.ts +12 -12
  73. package/src/offline/offlineContentManager.ts +1 -1
  74. package/src/offline/offlineContentManagerListener.ts +3 -6
  75. package/src/player.ts +24 -24
  76. package/src/source.ts +9 -6
  77. package/src/tweaksConfig.ts +8 -0
  78. package/src/ui/custommessagehandlerbridge.ts +7 -4
  79. package/src/ui/fullscreenhandlerbridge.ts +5 -5
@@ -2,6 +2,7 @@
2
2
 
3
3
  import BitmovinCollector
4
4
  import BitmovinPlayer
5
+ import BitmovinPlayerCore
5
6
  import Foundation
6
7
 
7
8
  extension RCTConvert {
@@ -28,7 +28,7 @@ Pod::Spec.new do |s|
28
28
  s.static_framework = true
29
29
 
30
30
  s.dependency 'ExpoModulesCore'
31
- s.dependency "BitmovinPlayer", "3.107.0"
31
+ s.dependency "BitmovinPlayer", "3.108.1"
32
32
  s.ios.dependency "GoogleAds-IMA-iOS-SDK", "3.26.1"
33
33
  s.tvos.dependency "GoogleAds-IMA-tvOS-SDK", "4.15.1"
34
34
 
@@ -108,6 +108,7 @@ public class RNPlayerView: ExpoView {
108
108
  let onBmpCueExit = EventDispatcher()
109
109
  let onBmpMetadata = EventDispatcher()
110
110
  let onBmpMetadataParsed = EventDispatcher()
111
+ let onBmpFairplayLicenseAcquired = EventDispatcher()
111
112
 
112
113
  required init(appContext: AppContext? = nil) {
113
114
  super.init(appContext: appContext)
@@ -475,6 +476,10 @@ extension RNPlayerView: PlayerListener {
475
476
  onBmpMetadataParsed(event.eventPayload())
476
477
  }
477
478
 
479
+ public func onFairplayLicenseAcquired(_ event: FairplayLicenseAcquiredEvent, player: Player) {
480
+ onBmpFairplayLicenseAcquired(event.eventPayload())
481
+ }
482
+
478
483
  #if os(iOS)
479
484
  public func onCastAvailable(_ event: CastAvailableEvent, player: Player) {
480
485
  onBmpCastAvailable(event.eventPayload())
@@ -99,7 +99,8 @@ public class RNPlayerViewManager: Module {
99
99
  "onBmpCueEnter",
100
100
  "onBmpCueExit",
101
101
  "onBmpMetadata",
102
- "onBmpMetadataParsed"
102
+ "onBmpMetadataParsed",
103
+ "onBmpFairplayLicenseAcquired"
103
104
  )
104
105
  }
105
106
  }
@@ -1,4 +1,5 @@
1
1
  import BitmovinPlayer
2
+ import Combine
2
3
  import ExpoModulesCore
3
4
 
4
5
  public class SourceModule: Module {
@@ -6,7 +7,12 @@ public class SourceModule: Module {
6
7
  private var sources: Registry<Source> = [:]
7
8
  /// In-memory mapping from `nativeId`s to `SourceConfig` instances for casting.
8
9
  private var castSourceConfigs: Registry<SourceConfig> = [:]
10
+ /// Registry retaining native `FairplayContentKeyRequest` instances keyed by source nativeId + skdUri.
11
+ private let fairplayRegistry = FairplayContentKeyRequestRegistry()
12
+ /// Combine cancellables for FairPlay license acquired events, keyed by source nativeId.
13
+ private var fairplayCancellables: [NativeId: AnyCancellable] = [:]
9
14
 
15
+ // swiftlint:disable:next function_body_length
10
16
  public func definition() -> ModuleDefinition {
11
17
  Name("SourceModule")
12
18
  OnCreate {
@@ -15,6 +21,8 @@ public class SourceModule: Module {
15
21
  OnDestroy {
16
22
  sources.removeAll()
17
23
  castSourceConfigs.removeAll()
24
+ fairplayCancellables.values.forEach { $0.cancel() }
25
+ fairplayCancellables.removeAll()
18
26
  }
19
27
 
20
28
  // MARK: - Module methods
@@ -59,6 +67,13 @@ public class SourceModule: Module {
59
67
  AsyncFunction("getThumbnail") { [weak self] (nativeId: NativeId, time: Double) -> [String: Any]? in
60
68
  self?.getSourceThumbnail(nativeId: nativeId, time: time)
61
69
  }.runOnQueue(.main)
70
+ AsyncFunction("drmFairplayRenewExpiringLicense") { [weak self] (nativeId: NativeId, skdUri: String) in
71
+ guard let source = self?.sources[nativeId],
72
+ let contentKeyRequest = self?.fairplayRegistry.retrieve(nativeId: nativeId, skdUri: skdUri) else {
73
+ return
74
+ }
75
+ source.drm.fairplay.renewExpiringLicense(for: contentKeyRequest)
76
+ }.runOnQueue(.main)
62
77
  }
63
78
 
64
79
  // MARK: - Public methods
@@ -125,6 +140,12 @@ public class SourceModule: Module {
125
140
  source = SourceFactory.createSource(from: sourceConfig)
126
141
  }
127
142
  sources[nativeId] = source
143
+ // Attach Combine listener to populate the FairPlay registry when a license is acquired
144
+ fairplayCancellables[nativeId] = source.events
145
+ .on(FairplayLicenseAcquiredEvent.self)
146
+ .sink { [weak self] event in
147
+ self?.fairplayRegistry.store(nativeId: nativeId, contentKeyRequest: event.contentKeyRequest)
148
+ }
128
149
  // Store cast source config if provided
129
150
  #if os(iOS)
130
151
  if let remoteConfig = RCTConvert.sourceRemoteControlConfig(sourceRemoteControlConfig) {
@@ -139,6 +160,9 @@ public class SourceModule: Module {
139
160
  private func destroySource(nativeId: NativeId) {
140
161
  sources.removeValue(forKey: nativeId)
141
162
  castSourceConfigs.removeValue(forKey: nativeId)
163
+ fairplayCancellables[nativeId]?.cancel()
164
+ fairplayCancellables.removeValue(forKey: nativeId)
165
+ fairplayRegistry.removeAll(nativeId: nativeId)
142
166
  }
143
167
  }
144
168
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitmovin-player-react-native",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Official React Native bindings for Bitmovin's mobile Player SDKs.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -67,7 +67,7 @@
67
67
  "eslint-config-expo": "~9.2.0",
68
68
  "eslint-config-prettier": "^9.1.0",
69
69
  "eslint-plugin-prettier": "^5.5.1",
70
- "expo": "53.0.25",
70
+ "expo": "53.0.26",
71
71
  "expo-module-scripts": "^4.1.9",
72
72
  "lint-staged": "13.0.3",
73
73
  "prettier": "^3.6.2",
@@ -63,9 +63,9 @@ export interface AdItem {
63
63
  * Possible values are:
64
64
  * • "pre": pre-roll ad (for VoD and Live streaming)
65
65
  * • "post": post-roll ad (for VoD streaming only)
66
- * • fractional seconds: "10", "12.5" (mid-roll ad, for VoD and Live streaming)
67
- * • percentage of the entire video duration: "25%", "50%" (mid-roll ad, for VoD streaming only)
68
- * • timecode hh:mm:ss.mmm: "00:10:30.000", "01:00:00.000" (mid-roll ad, for VoD streaming only)
66
+ * • fractional seconds: "10", "12.5" (mid-roll ad, for VoD and Live streaming)
67
+ * • percentage of the entire video duration: "25%", "50%" (mid-roll ad, for VoD streaming only)
68
+ * • timecode hh:mm:ss.mmm: "00:10:30.000", "01:00:00.000" (mid-roll ad, for VoD streaming only)
69
69
  */
70
70
  position?: string;
71
71
  /**
@@ -66,6 +66,7 @@ import {
66
66
  CueExitEvent,
67
67
  MetadataParsedEvent,
68
68
  MetadataEvent,
69
+ FairplayLicenseAcquiredEvent,
69
70
  } from '../../events';
70
71
 
71
72
  /**
@@ -389,4 +390,10 @@ export type PlayerViewEvents = {
389
390
  onVideoPlaybackQualityChanged?: (
390
391
  event: VideoPlaybackQualityChangedEvent
391
392
  ) => void;
393
+ /**
394
+ * Emitted when a FairPlay license has been acquired successfully.
395
+ *
396
+ * @platform iOS, tvOS
397
+ */
398
+ onFairplayLicenseAcquired?: (event: FairplayLicenseAcquiredEvent) => void;
392
399
  };
@@ -82,7 +82,7 @@ export function PlayerView({
82
82
  const [isPlayerInitialized, setIsPlayerInitialized] = useState(false);
83
83
 
84
84
  useEffect(() => {
85
- player.initialize().then(() => {
85
+ void player.initialize().then(() => {
86
86
  setIsPlayerInitialized(true);
87
87
  // call attach player on native view if switched to AsyncFunction for RNPlayerViewExpo
88
88
  });
@@ -103,7 +103,7 @@ export function PlayerView({
103
103
 
104
104
  useEffect(() => {
105
105
  if (isPlayerInitialized && pictureInPictureActions != null) {
106
- nativeView.current?.updatePictureInPictureActions(
106
+ void nativeView.current?.updatePictureInPictureActions(
107
107
  pictureInPictureActions
108
108
  );
109
109
  }
@@ -206,6 +206,7 @@ export function PlayerView({
206
206
  props.onVideoPlaybackQualityChanged
207
207
  )}
208
208
  onBmpDownloadFinished={proxy(props.onDownloadFinished)}
209
+ onBmpFairplayLicenseAcquired={proxy(props.onFairplayLicenseAcquired)}
209
210
  />
210
211
  );
211
212
  }
@@ -66,6 +66,7 @@ import {
66
66
  CueExitEvent,
67
67
  MetadataEvent,
68
68
  MetadataParsedEvent,
69
+ FairplayLicenseAcquiredEvent,
69
70
  } from '../../events';
70
71
 
71
72
  /**
@@ -414,4 +415,12 @@ export type NativePlayerViewEvents = {
414
415
  onBmpVideoPlaybackQualityChanged?: (event: {
415
416
  nativeEvent: VideoPlaybackQualityChangedEvent;
416
417
  }) => void;
418
+ /**
419
+ * Event emitted when a FairPlay license has been acquired successfully.
420
+ *
421
+ * @platform iOS, tvOS
422
+ */
423
+ onBmpFairplayLicenseAcquired?: (event: {
424
+ nativeEvent: FairplayLicenseAcquiredEvent;
425
+ }) => void;
417
426
  };
@@ -0,0 +1,36 @@
1
+ import { Platform } from 'react-native';
2
+ import { FairplayContentKeyRequest } from '../events';
3
+ import SourceModule from '../modules/SourceModule';
4
+
5
+ /**
6
+ * Provides FairPlay-specific DRM runtime APIs for an active {@link Source}.
7
+ *
8
+ * Accessible via {@link Source.drm}.fairplay.
9
+ *
10
+ * @platform iOS, tvOS
11
+ */
12
+ export class FairplayDrmApi {
13
+ constructor(private readonly sourceNativeId: string) {}
14
+
15
+ /**
16
+ * Renews an expiring FairPlay license for the provided content key request.
17
+ * Has no effect if called on Android.
18
+ *
19
+ * @platform iOS, tvOS
20
+ * @param contentKeyRequest - The content key request from a {@link FairplayLicenseAcquiredEvent}.
21
+ */
22
+ renewExpiringLicense = async (
23
+ contentKeyRequest: FairplayContentKeyRequest
24
+ ): Promise<void> => {
25
+ if (Platform.OS === 'android') {
26
+ console.warn(
27
+ `[Source ${this.sourceNativeId}] renewExpiringLicense is not available on Android.`
28
+ );
29
+ return;
30
+ }
31
+ return SourceModule.drmFairplayRenewExpiringLicense(
32
+ this.sourceNativeId,
33
+ contentKeyRequest.skdUri
34
+ );
35
+ };
36
+ }
package/src/drm/index.ts CHANGED
@@ -3,10 +3,11 @@ import { EventSubscription } from 'expo-modules-core';
3
3
  import NativeInstance, { NativeInstanceConfig } from '../nativeInstance';
4
4
  import { FairplayConfig } from './fairplayConfig';
5
5
  import { WidevineConfig } from './widevineConfig';
6
+ import { FairplayDrmApi } from './fairplayDrmApi';
6
7
  import DrmModule from './drmModule';
7
8
 
8
- // Export config types from DRM module.
9
- export { FairplayConfig, WidevineConfig };
9
+ // Export config types and API classes from DRM module.
10
+ export { FairplayConfig, WidevineConfig, FairplayDrmApi };
10
11
 
11
12
  /**
12
13
  * Represents the general Streaming DRM config.
@@ -31,6 +32,12 @@ export interface DrmConfig extends NativeInstanceConfig {
31
32
  * @internal
32
33
  */
33
34
  export class Drm extends NativeInstance<DrmConfig> {
35
+ /**
36
+ * Provides FairPlay-specific DRM runtime APIs such as {@link FairplayDrmApi.renewExpiringLicense}.
37
+ *
38
+ * @platform iOS, tvOS
39
+ */
40
+ readonly fairplay: FairplayDrmApi;
34
41
  /**
35
42
  * Whether this object's native instance has been created.
36
43
  */
@@ -42,6 +49,11 @@ export class Drm extends NativeInstance<DrmConfig> {
42
49
 
43
50
  private eventSubscriptions: EventSubscription[] = [];
44
51
 
52
+ constructor(config?: DrmConfig, sourceNativeId?: string) {
53
+ super(config);
54
+ this.fairplay = new FairplayDrmApi(sourceNativeId ?? '');
55
+ }
56
+
45
57
  /**
46
58
  * Allocates the DRM config instance and its resources natively.
47
59
  */
package/src/events.ts CHANGED
@@ -10,7 +10,7 @@ import { SubtitleTrack } from './subtitleTrack';
10
10
  import { VideoQuality } from './media';
11
11
  import { AudioTrack } from './audioTrack';
12
12
  import { LoadingState } from './source';
13
- import { HttpRequestType } from './network/networkConfig';
13
+ import { HttpRequestType, HttpResponse } from './network/networkConfig';
14
14
  import {
15
15
  DateRangeMetadataEntry,
16
16
  EventMessageMetadataEntry,
@@ -36,6 +36,17 @@ export interface Event {
36
36
  timestamp: number;
37
37
  }
38
38
 
39
+ /**
40
+ * Additional diagnostic information related to an error or warning.
41
+ */
42
+ export interface DeficiencyData {
43
+ /**
44
+ * The HTTP response associated with the error, when the root cause is a network request
45
+ * (e.g. a DRM license or certificate request resulting in a non-2xx status code).
46
+ */
47
+ httpResponse?: HttpResponse;
48
+ }
49
+
39
50
  /**
40
51
  * Base event type for error and warning events.
41
52
  */
@@ -49,9 +60,11 @@ export interface ErrorEvent extends Event {
49
60
  */
50
61
  message: string;
51
62
  /**
52
- * Underlying data emitted with the error or warning.
63
+ * Additional diagnostic information related to the error or warning.
64
+ * Contains details such as an {@link DeficiencyData.httpResponse | HTTP response} when
65
+ * the error is caused by a failed network request.
53
66
  */
54
- data?: Record<string, any>;
67
+ data?: DeficiencyData & Record<string, any>;
55
68
  }
56
69
 
57
70
  /**
@@ -831,3 +844,27 @@ export type MetadataParsedEvent =
831
844
  * Emitted when metadata is encountered during playback.
832
845
  */
833
846
  export type MetadataEvent = MetadataParsedEvent;
847
+
848
+ /**
849
+ * Represents the FairPlay content key request associated with a license acquisition.
850
+ *
851
+ * @platform iOS, tvOS
852
+ */
853
+ export interface FairplayContentKeyRequest {
854
+ /**
855
+ * The URI of the content key (the `skd://` URI from the HLS manifest).
856
+ */
857
+ skdUri: string;
858
+ }
859
+
860
+ /**
861
+ * Emitted when a FairPlay license has been acquired successfully.
862
+ *
863
+ * @platform iOS, tvOS
864
+ */
865
+ export interface FairplayLicenseAcquiredEvent extends Event {
866
+ /**
867
+ * The content key request associated with the acquired license.
868
+ */
869
+ contentKeyRequest: FairplayContentKeyRequest;
870
+ }
package/src/metadata.ts CHANGED
@@ -106,8 +106,7 @@ interface BaseDateRangeMetadataEntry<TPlatform extends 'ios' | 'android'> {
106
106
  *
107
107
  * @platform Android
108
108
  */
109
- export interface AndroidDateRangeMetadataEntry
110
- extends BaseDateRangeMetadataEntry<'android'> {
109
+ export interface AndroidDateRangeMetadataEntry extends BaseDateRangeMetadataEntry<'android'> {
111
110
  /**
112
111
  * Time range of the entry relative to the beginning of the playback, in seconds.
113
112
  */
@@ -130,8 +129,7 @@ export interface AndroidDateRangeMetadataEntry
130
129
  *
131
130
  * @platform iOS, tvOS
132
131
  */
133
- export interface IosDateRangeMetadataEntry
134
- extends BaseDateRangeMetadataEntry<'ios'> {
132
+ export interface IosDateRangeMetadataEntry extends BaseDateRangeMetadataEntry<'ios'> {
135
133
  /**
136
134
  * Time range of the entry relative to Unix Epoch, in seconds.
137
135
  *
@@ -69,6 +69,16 @@ declare class SourceModule extends NativeModule<SourceModuleEvents> {
69
69
  * Returns a thumbnail for the specified playback time.
70
70
  */
71
71
  getThumbnail(nativeId: string, time: number): Promise<Thumbnail | null>;
72
+
73
+ /**
74
+ * Renews an expiring FairPlay license for the given content key request.
75
+ *
76
+ * @platform iOS, tvOS
77
+ */
78
+ drmFairplayRenewExpiringLicense(
79
+ nativeId: string,
80
+ skdUri: string
81
+ ): Promise<void>;
72
82
  }
73
83
 
74
84
  export default requireNativeModule<SourceModule>('SourceModule');
@@ -95,12 +95,12 @@ export class Network extends NativeInstance<NetworkConfig> {
95
95
  ) => {
96
96
  this.config
97
97
  ?.preprocessHttpRequest?.(type, request)
98
- .then((resultRequest) => {
99
- NetworkModule.setPreprocessedHttpRequest(requestId, resultRequest);
100
- })
101
- .catch(() => {
102
- NetworkModule.setPreprocessedHttpRequest(requestId, request);
103
- });
98
+ .then((resultRequest) =>
99
+ NetworkModule.setPreprocessedHttpRequest(requestId, resultRequest)
100
+ )
101
+ .catch(() =>
102
+ NetworkModule.setPreprocessedHttpRequest(requestId, request)
103
+ );
104
104
  };
105
105
 
106
106
  /**
@@ -120,11 +120,11 @@ export class Network extends NativeInstance<NetworkConfig> {
120
120
  ) => {
121
121
  this.config
122
122
  ?.preprocessHttpResponse?.(type, response)
123
- .then((resultResponse) => {
124
- NetworkModule.setPreprocessedHttpResponse(responseId, resultResponse);
125
- })
126
- .catch(() => {
127
- NetworkModule.setPreprocessedHttpResponse(responseId, response);
128
- });
123
+ .then((resultResponse) =>
124
+ NetworkModule.setPreprocessedHttpResponse(responseId, resultResponse)
125
+ )
126
+ .catch(() =>
127
+ NetworkModule.setPreprocessedHttpResponse(responseId, response)
128
+ );
129
129
  };
130
130
  }
@@ -111,7 +111,7 @@ export class OfflineContentManager extends NativeInstance<OfflineContentConfig>
111
111
  this.isDestroyed = true;
112
112
  this.eventSubscription?.remove?.();
113
113
  this.listeners.clear();
114
- this.drm?.destroy();
114
+ await this.drm?.destroy();
115
115
 
116
116
  return OfflineModule.release(this.nativeId);
117
117
  }
@@ -44,8 +44,7 @@ export interface OfflineEvent<T extends OfflineEventType> {
44
44
  * Emitted when the download process has completed.
45
45
  * @platform Android, iOS
46
46
  */
47
- export interface OnCompletedEvent
48
- extends OfflineEvent<OfflineEventType.onCompleted> {
47
+ export interface OnCompletedEvent extends OfflineEvent<OfflineEventType.onCompleted> {
49
48
  /**
50
49
  * The options that are available to download
51
50
  */
@@ -71,8 +70,7 @@ export interface OnErrorEvent extends OfflineEvent<OfflineEventType.onError> {
71
70
  * Emitted when there is a progress change for the process call.
72
71
  * @platform Android, iOS
73
72
  */
74
- export interface OnProgressEvent
75
- extends OfflineEvent<OfflineEventType.onProgress> {
73
+ export interface OnProgressEvent extends OfflineEvent<OfflineEventType.onProgress> {
76
74
  /**
77
75
  * The progress for the current process
78
76
  */
@@ -83,8 +81,7 @@ export interface OnProgressEvent
83
81
  * Emitted when the `OfflineContentOptions` is available after a `OfflineContentManager.getOptions` call.
84
82
  * @platform Android, iOS
85
83
  */
86
- export interface OnOptionsAvailableEvent
87
- extends OfflineEvent<OfflineEventType.onOptionsAvailable> {
84
+ export interface OnOptionsAvailableEvent extends OfflineEvent<OfflineEventType.onOptionsAvailable> {
88
85
  /**
89
86
  * The options that are available to download
90
87
  */
package/src/player.ts CHANGED
@@ -92,10 +92,10 @@ export class Player extends NativeInstance<PlayerConfig> {
92
92
  */
93
93
  destroy = () => {
94
94
  if (!this.isDestroyed) {
95
- PlayerModule.destroy(this.nativeId);
96
- this.source?.destroy();
97
- this.network?.destroy();
98
- this.decoderConfig?.destroy();
95
+ void PlayerModule.destroy(this.nativeId);
96
+ void this.source?.destroy();
97
+ void this.network?.destroy();
98
+ void this.decoderConfig?.destroy();
99
99
  this.onImaBeforeInitializationSubscription?.remove();
100
100
  this.onImaBeforeInitializationSubscription = undefined;
101
101
  this.isDestroyed = true;
@@ -116,7 +116,7 @@ export class Player extends NativeInstance<PlayerConfig> {
116
116
  offlineContentManager: OfflineContentManager,
117
117
  options?: OfflineSourceOptions
118
118
  ) => {
119
- PlayerModule.loadOfflineContent(
119
+ void PlayerModule.loadOfflineContent(
120
120
  this.nativeId,
121
121
  offlineContentManager.nativeId,
122
122
  options
@@ -128,30 +128,30 @@ export class Player extends NativeInstance<PlayerConfig> {
128
128
  */
129
129
  loadSource = (source: Source) => {
130
130
  this.source = source;
131
- source.initialize().then(() => {
132
- PlayerModule.loadSource(this.nativeId, source.nativeId);
133
- });
131
+ void source
132
+ .initialize()
133
+ .then(() => PlayerModule.loadSource(this.nativeId, source.nativeId));
134
134
  };
135
135
 
136
136
  /**
137
137
  * Unloads all {@link Source}s from the player.
138
138
  */
139
139
  unload = () => {
140
- PlayerModule.unload(this.nativeId);
140
+ void PlayerModule.unload(this.nativeId);
141
141
  };
142
142
 
143
143
  /**
144
144
  * Starts or resumes playback after being paused. Has no effect if the player is already playing.
145
145
  */
146
146
  play = () => {
147
- PlayerModule.play(this.nativeId);
147
+ void PlayerModule.play(this.nativeId);
148
148
  };
149
149
 
150
150
  /**
151
151
  * Pauses the video if it is playing. Has no effect if the player is already paused.
152
152
  */
153
153
  pause = () => {
154
- PlayerModule.pause(this.nativeId);
154
+ void PlayerModule.pause(this.nativeId);
155
155
  };
156
156
 
157
157
  /**
@@ -162,7 +162,7 @@ export class Player extends NativeInstance<PlayerConfig> {
162
162
  * @param time - The time to seek to in seconds.
163
163
  */
164
164
  seek = (time: number) => {
165
- PlayerModule.seek(this.nativeId, time);
165
+ void PlayerModule.seek(this.nativeId, time);
166
166
  };
167
167
 
168
168
  /**
@@ -177,21 +177,21 @@ export class Player extends NativeInstance<PlayerConfig> {
177
177
  * @param offset - Target offset from the live edge in seconds.
178
178
  */
179
179
  timeShift = (offset: number) => {
180
- PlayerModule.timeShift(this.nativeId, offset);
180
+ void PlayerModule.timeShift(this.nativeId, offset);
181
181
  };
182
182
 
183
183
  /**
184
184
  * Mutes the player if an audio track is available. Has no effect if the player is already muted.
185
185
  */
186
186
  mute = () => {
187
- PlayerModule.mute(this.nativeId);
187
+ void PlayerModule.mute(this.nativeId);
188
188
  };
189
189
 
190
190
  /**
191
191
  * Unmutes the player if it is muted. Has no effect if the player is already unmuted.
192
192
  */
193
193
  unmute = () => {
194
- PlayerModule.unmute(this.nativeId);
194
+ void PlayerModule.unmute(this.nativeId);
195
195
  };
196
196
 
197
197
  /**
@@ -200,7 +200,7 @@ export class Player extends NativeInstance<PlayerConfig> {
200
200
  * @param volume - The volume level to set.
201
201
  */
202
202
  setVolume = (volume: number) => {
203
- PlayerModule.setVolume(this.nativeId, volume);
203
+ void PlayerModule.setVolume(this.nativeId, volume);
204
204
  };
205
205
 
206
206
  private ensureImaBeforeInitializationListener = () => {
@@ -228,7 +228,7 @@ export class Player extends NativeInstance<PlayerConfig> {
228
228
  } catch {
229
229
  prepared = cloned;
230
230
  }
231
- PlayerModule.setPreparedImaSettings(id, prepared);
231
+ void PlayerModule.setPreparedImaSettings(id, prepared);
232
232
  }
233
233
  );
234
234
  };
@@ -380,7 +380,7 @@ export class Player extends NativeInstance<PlayerConfig> {
380
380
  * @platform iOS, Android
381
381
  */
382
382
  scheduleAd = (adItem: AdItem) => {
383
- PlayerModule.scheduleAd(this.nativeId, adItem);
383
+ void PlayerModule.scheduleAd(this.nativeId, adItem);
384
384
  };
385
385
 
386
386
  /**
@@ -390,7 +390,7 @@ export class Player extends NativeInstance<PlayerConfig> {
390
390
  * @platform iOS, Android
391
391
  */
392
392
  skipAd = () => {
393
- PlayerModule.skipAd(this.nativeId);
393
+ void PlayerModule.skipAd(this.nativeId);
394
394
  };
395
395
 
396
396
  /**
@@ -424,7 +424,7 @@ export class Player extends NativeInstance<PlayerConfig> {
424
424
  * Can be set to `null` for no limitation.
425
425
  */
426
426
  setMaxSelectableBitrate = (bitrate: number | null) => {
427
- PlayerModule.setMaxSelectableBitrate(this.nativeId, bitrate || -1);
427
+ void PlayerModule.setMaxSelectableBitrate(this.nativeId, bitrate || -1);
428
428
  };
429
429
 
430
430
  /**
@@ -467,7 +467,7 @@ export class Player extends NativeInstance<PlayerConfig> {
467
467
  * @platform iOS, Android
468
468
  */
469
469
  castVideo = () => {
470
- PlayerModule.castVideo(this.nativeId);
470
+ void PlayerModule.castVideo(this.nativeId);
471
471
  };
472
472
 
473
473
  /**
@@ -476,7 +476,7 @@ export class Player extends NativeInstance<PlayerConfig> {
476
476
  * @platform iOS, Android
477
477
  */
478
478
  castStop = () => {
479
- PlayerModule.castStop(this.nativeId);
479
+ void PlayerModule.castStop(this.nativeId);
480
480
  };
481
481
 
482
482
  /**
@@ -508,7 +508,7 @@ export class Player extends NativeInstance<PlayerConfig> {
508
508
  );
509
509
  return;
510
510
  }
511
- PlayerModule.setVideoQuality(this.nativeId, qualityId);
511
+ void PlayerModule.setVideoQuality(this.nativeId, qualityId);
512
512
  };
513
513
 
514
514
  /**
@@ -528,7 +528,7 @@ export class Player extends NativeInstance<PlayerConfig> {
528
528
  * @param playbackSpeed - The playback speed to set.
529
529
  */
530
530
  setPlaybackSpeed = (playbackSpeed: number) => {
531
- PlayerModule.setPlaybackSpeed(this.nativeId, playbackSpeed);
531
+ void PlayerModule.setPlaybackSpeed(this.nativeId, playbackSpeed);
532
532
  };
533
533
 
534
534
  /**