react-native-tpstreams 1.1.5 → 1.1.7

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.
@@ -3,4 +3,4 @@ Tpstreams_minSdkVersion=24
3
3
  Tpstreams_targetSdkVersion=34
4
4
  Tpstreams_compileSdkVersion=35
5
5
  Tpstreams_ndkVersion=27.1.12297006
6
- Tpstreams_tpstreamsAndroidPlayerVersion=1.1.4
6
+ Tpstreams_tpstreamsAndroidPlayerVersion=1.1.6
@@ -13,6 +13,7 @@ import androidx.media3.common.Player
13
13
  import androidx.media3.common.PlaybackParameters
14
14
  import androidx.media3.common.PlaybackException
15
15
  import android.media.MediaCodec
16
+ import android.view.View.MeasureSpec
16
17
 
17
18
  class TPStreamsRNPlayerView(context: ThemedReactContext) : FrameLayout(context) {
18
19
  private val playerView: TPStreamsPlayerView = TPStreamsPlayerView(context)
@@ -35,11 +36,27 @@ class TPStreamsRNPlayerView(context: ThemedReactContext) : FrameLayout(context)
35
36
  private var downloadMetadata: Map<String, Any>? = null
36
37
  private var offlineLicenseExpireTime: Long = DEFAULT_OFFLINE_LICENSE_EXPIRE_TIME
37
38
  private var accessTokenCallback: ((String) -> Unit)? = null
39
+ private var isLayoutUpdatePosted = false
38
40
 
39
41
  init {
40
42
  addView(playerView, LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT))
41
43
  }
42
44
 
45
+ override fun requestLayout() {
46
+ super.requestLayout()
47
+ if (!isLayoutUpdatePosted) {
48
+ isLayoutUpdatePosted = true
49
+ post {
50
+ isLayoutUpdatePosted = false
51
+ measure(
52
+ MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
53
+ MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)
54
+ )
55
+ layout(left, top, right, bottom)
56
+ }
57
+ }
58
+ }
59
+
43
60
  // Emit React Native events
44
61
  private fun emitEvent(eventName: String, data: Map<String, Any>) {
45
62
  val event = Arguments.createMap()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tpstreams",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "Video component for TPStreams",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",