react-native-tpstreams 0.1.11 → 0.1.13

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
@@ -217,7 +217,15 @@ subscription.remove();
217
217
  ## Available Events
218
218
 
219
219
  ### onPlaybackStateChanged
220
- Triggered when the playback state changes.
220
+ This event notifies us when the player's playback state changes:
221
+
222
+ | State | Value | Description |
223
+ |--------|-------|------------|
224
+ | `STATE_IDLE` | `1` | The player is idle and not ready to play. |
225
+ | `STATE_BUFFERING` | `2` | The player is buffering (waiting for enough data). |
226
+ | `STATE_READY` | `3` | The player is ready to play. |
227
+ | `STATE_ENDED` | `4` | The playback has finished. |
228
+
221
229
 
222
230
  ```js
223
231
  eventEmitter.addListener('onPlaybackStateChanged', (state) => {
@@ -265,7 +273,8 @@ eventEmitter.addListener('onFullScreenChanged', (isFullscreen) => {
265
273
  ```
266
274
 
267
275
  ### onIsLoadingChanged
268
- Triggered when the player’s loading state changes.
276
+ - `true`: The player is currently loading or buffering new data from the network.
277
+ - `false`: The player has sufficient buffered content and can play without interruption.
269
278
 
270
279
  ```js
271
280
  eventEmitter.addListener('onIsLoadingChanged', (isLoading) => {
@@ -110,7 +110,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
110
110
  dependencies {
111
111
  implementation "com.facebook.react:react-android"
112
112
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
113
- implementation "com.tpstreams.player:player:3.1.5"
113
+ implementation "com.tpstreams.player:player:3.1.6"
114
114
  }
115
115
 
116
116
  if (isNewArchitectureEnabled()) {
@@ -31,7 +31,7 @@ class PlayerFragment : Fragment() {
31
31
  private var enableDownloadSupport :Boolean = true
32
32
  private var setAutoPlay :Boolean = true
33
33
  private var startAt :Int = 0
34
- private var offlineLicenseExpireTime :Int = 15
34
+ private var offlineLicenseExpireTime :Int = 60 * 60 * 24 * 15 //15 days
35
35
 
36
36
  private var accessTokenCallback : onAccessTokenCallbase? = null
37
37
 
@@ -48,7 +48,7 @@ class PlayerFragment : Fragment() {
48
48
  enableDownloadSupport = bundle.getBoolean("ENABLE_DOWNLOAD_SUPPORT", true)
49
49
  setAutoPlay = bundle.getBoolean("AUTO_PLAY", true)
50
50
  startAt = bundle.getInt("START_AT", 0)
51
- offlineLicenseExpireTime = bundle.getInt("OFFLINE_LICENSE_EXPIRE_TIME", 15)
51
+ offlineLicenseExpireTime = bundle.getInt("OFFLINE_LICENSE_EXPIRE_TIME", offlineLicenseExpireTime)
52
52
 
53
53
  }
54
54
  }
@@ -18,7 +18,7 @@ class TpStreamsPlayerView @JvmOverloads constructor(
18
18
  private var enableDownload: Boolean = true
19
19
  private var autoPlay :Boolean = true
20
20
  private var startAt :Int = 0
21
- private var offlineLicenseExpireTime :Int = 15
21
+ private var offlineLicenseExpireTime :Int = 60 * 60 * 24 * 15
22
22
  private var fragmentModule: FragmentModule? = null
23
23
 
24
24
  private val job = SupervisorJob()
@@ -62,7 +62,7 @@ class TpStreamsPlayerView @JvmOverloads constructor(
62
62
  }
63
63
 
64
64
  fun setOfflineLicenseExpireTime(offlineLicenseExpireTime: Int?) {
65
- this.offlineLicenseExpireTime = offlineLicenseExpireTime ?: 15
65
+ this.offlineLicenseExpireTime = offlineLicenseExpireTime ?: 60 * 60 * 24 * 15
66
66
  updateFragment()
67
67
  }
68
68
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tpstreams",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Video Component for TPStreams",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",