react-native-tpstreams 1.0.3-debug.7 → 1.0.3-debug.9

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.
package/README.md CHANGED
@@ -41,14 +41,14 @@ import { TPStreamsPlayerView } from "react-native-tpstreams";
41
41
 
42
42
  | Prop | Type | Required | Description |
43
43
  |------|------|----------|-------------|
44
- | `videoId` | `string` | | Video ID to play |
45
- | `accessToken` | `string` | | Access token for the video |
46
- | `startAt` | `number` | | Start position in seconds (default: 0) |
47
- | `shouldAutoPlay` | `boolean` | | Auto-play on load (default: true) |
48
- | `showDefaultCaptions` | `boolean` | | Show captions if available (default: false) |
49
- | `enableDownload` | `boolean` | | Enable download functionality (default: false) |
50
- | `offlineLicenseExpireTime` | `number` | | License expiration in seconds (default: 15 days) |
51
- | `downloadMetadata` | `object` | | Custom metadata for downloads |
44
+ | `videoId` | `string` | Yes | Video ID to play |
45
+ | `accessToken` | `string` | Yes | Access token for the video |
46
+ | `startAt` | `number` | No | Start position in seconds (default: 0) |
47
+ | `shouldAutoPlay` | `boolean` | No | Auto-play on load (default: true) |
48
+ | `showDefaultCaptions` | `boolean` | No | Show captions if available (default: false) |
49
+ | `enableDownload` | `boolean` | No | Enable download functionality (default: false) |
50
+ | `offlineLicenseExpireTime` | `number` | No | License expiration in seconds (default: 15 days) |
51
+ | `downloadMetadata` | `object` | No | Custom metadata for downloads |
52
52
 
53
53
  ### Player Methods
54
54
 
@@ -21,7 +21,7 @@ protocol TokenRequestDelegate: AnyObject {
21
21
  class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
22
22
 
23
23
  private let downloadManager = TPStreamsDownloadManager.shared
24
- private var isListening = true
24
+ private var isListening = false
25
25
  private var tokenDelegate: TokenRequestDelegate?
26
26
  private static var _shared: TPStreamsDownloadModule?
27
27
 
@@ -48,6 +48,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
48
48
  @objc
49
49
  func addDownloadProgressListener(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
50
50
  isListening = true
51
+ notifyDownloadsChange()
51
52
  print("TPStreamsDownloadModule addDownloadProgressListener")
52
53
  resolve(nil)
53
54
  }
@@ -60,7 +61,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
60
61
  }
61
62
 
62
63
  func onProgressChange(assetId: String, percentage: Double) {
63
- print("TPStreamsDownloadModule onProgressChange")
64
+ print("TPStreamsDownloadModule onProgressChange isListening: \(isListening)")
64
65
  if isListening {
65
66
  print("TPStreamsDownloadModule onProgressChange notifyDownloadsChange")
66
67
  notifyDownloadsChange()
@@ -68,7 +69,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
68
69
  }
69
70
 
70
71
  func onStateChange(status: Status, offlineAsset: OfflineAsset) {
71
- print("TPStreamsDownloadModule onStateChange")
72
+ print("TPStreamsDownloadModule onStateChange isListening: \(isListening)")
72
73
  if isListening {
73
74
  print("TPStreamsDownloadModule onStateChange notifyDownloadsChange")
74
75
  notifyDownloadsChange()
@@ -76,7 +77,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
76
77
  }
77
78
 
78
79
  func onDelete(assetId: String) {
79
- print("TPStreamsDownloadModule onDelete")
80
+ print("TPStreamsDownloadModule onDelete isListening: \(isListening)")
80
81
  if isListening {
81
82
  print("TPStreamsDownloadModule onDelete notifyDownloadsChange")
82
83
  if let offlineAsset = getOfflineAsset(assetId: assetId) {
@@ -87,7 +88,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
87
88
  }
88
89
 
89
90
  func onStart(offlineAsset: OfflineAsset) {
90
- print("TPStreamsDownloadModule onStart")
91
+ print("TPStreamsDownloadModule onStart isListening: \(isListening)")
91
92
  if isListening {
92
93
  print("TPStreamsDownloadModule onStart notifyDownloadsChange")
93
94
  notifyDownloadStateChanged(offlineAsset: offlineAsset)
@@ -96,7 +97,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
96
97
  }
97
98
 
98
99
  func onComplete(offlineAsset: OfflineAsset) {
99
- print("TPStreamsDownloadModule onComplete")
100
+ print("TPStreamsDownloadModule onComplete isListening: \(isListening)")
100
101
  if isListening {
101
102
  print("TPStreamsDownloadModule onComplete notifyDownloadsChange")
102
103
  notifyDownloadStateChanged(offlineAsset: offlineAsset)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tpstreams",
3
- "version": "1.0.3-debug.7",
3
+ "version": "1.0.3-debug.9",
4
4
  "description": "Video component for TPStreams",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",