react-native-tpstreams 1.0.7-debug.1 → 1.0.8-debug.1

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.
@@ -140,7 +140,6 @@ class TPStreamsRNPlayerView(context: ThemedReactContext) : FrameLayout(context)
140
140
  // Send initial events
141
141
  emitEvent("onPlayerStateChanged", mapOf("playbackState" to 0))
142
142
  emitEvent("onIsPlayingChanged", mapOf("isPlaying" to false))
143
- // emitEvent("onPlaybackSpeedChanged", mapOf("speed" to 1.0))
144
143
  emitEvent("onIsLoadingChanged", mapOf("isLoading" to false))
145
144
  } catch (e: Exception) {
146
145
  Log.e("TPStreamsRN", "Error creating player", e)
@@ -35,6 +35,11 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
35
35
  downloadManager.setTPStreamsDownloadDelegate(tpStreamsDownloadDelegate: self)
36
36
  }
37
37
 
38
+ @objc
39
+ func initializeModule() {
40
+ //no-op method to ensure the module is initialized
41
+ }
42
+
38
43
  func setAccessTokenDelegate(_ delegate: TokenRequestDelegate) {
39
44
  self.tokenDelegate = delegate
40
45
  }
@@ -116,7 +121,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
116
121
  }
117
122
 
118
123
  func onRequestNewAccessToken(assetId: String, completion: @escaping (String?) -> Void) {
119
- if let delegate = tokenDelegate {
124
+ if let delegate = tokenDelegate {
120
125
  delegate.requestToken(for: assetId, completion: completion)
121
126
  } else {
122
127
  completion(nil)
@@ -30,7 +30,7 @@ class TPStreamsRNPlayerView: UIView {
30
30
  @objc var shouldAutoPlay: Bool = true
31
31
  @objc var startAt: Double = 0
32
32
  @objc var enableDownload: Bool = false
33
- @objc var offlineLicenseExpireTime: Double = 0
33
+ @objc var offlineLicenseExpireTime: Double = 15 * 24 * 60 * 60
34
34
  @objc var showDefaultCaptions: Bool = false
35
35
  @objc var downloadMetadata: NSString?
36
36
 
@@ -6,12 +6,23 @@ import AVFoundation
6
6
  @objc(TPStreamsRNPlayerViewManager)
7
7
  class TPStreamsRNPlayerViewManager: RCTViewManager {
8
8
  override func view() -> UIView! {
9
+ ensureDownloadModuleInitialized()
9
10
  return TPStreamsRNPlayerView()
10
11
  }
11
12
 
12
13
  override static func requiresMainQueueSetup() -> Bool {
13
14
  return true
14
15
  }
16
+
17
+ private func ensureDownloadModuleInitialized() {
18
+ guard let bridge = self.bridge else {
19
+ return
20
+ }
21
+
22
+ if let module = bridge.module(for: TPStreamsDownloadModule.self) as? TPStreamsDownloadModule {
23
+ module.initializeModule()
24
+ }
25
+ }
15
26
 
16
27
  // MARK: - Player Commands - Simply delegate to the view
17
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tpstreams",
3
- "version": "1.0.7-debug.1",
3
+ "version": "1.0.8-debug.1",
4
4
  "description": "Video component for TPStreams",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -166,8 +166,5 @@
166
166
  "languages": "kotlin-objc",
167
167
  "type": "fabric-view",
168
168
  "version": "0.50.3"
169
- },
170
- "dependencies": {
171
- "react-native-tpstreams": "^1.0.7"
172
169
  }
173
170
  }