react-native-spalla-player 0.19.2 → 0.19.3

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.
@@ -109,7 +109,7 @@ dependencies {
109
109
  implementation "com.facebook.react:react-native:+"
110
110
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
111
111
  implementation "androidx.mediarouter:mediarouter:1.2.0"
112
- implementation "stream.spalla:spalla-android-sdk:1.13.2"
112
+ implementation "stream.spalla:spalla-android-sdk:1.13.4"
113
113
  implementation "com.google.android.gms:play-services-cast-framework:21.3.0"
114
114
  implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.36.0'
115
115
  }
@@ -1,5 +1,7 @@
1
1
  package com.spallaplayer
2
2
 
3
+ import android.os.Handler
4
+ import android.os.Looper
3
5
  import com.facebook.react.bridge.LifecycleEventListener
4
6
  import com.facebook.react.bridge.ReactApplicationContext
5
7
  import com.facebook.react.bridge.ReactContextBaseJavaModule
@@ -220,12 +222,13 @@ class SpallaPlayerModule(reactContext: ReactApplicationContext) :
220
222
  @ReactMethod
221
223
  fun unmount(tag: Int) {
222
224
  if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
223
- val uiManager = UIManagerHelper.getUIManager(_reactContext, UIManagerType.FABRIC)
224
- if (uiManager is UIManager) {
225
- uiManager.resolveView(tag)?.let { view ->
226
- if (view is SpallaPlayerContainerView) {
227
- view.post {
228
- view.spallaPlayerView.pause()
225
+ Handler(Looper.getMainLooper()).post {
226
+ val uiManager = UIManagerHelper.getUIManager(_reactContext, UIManagerType.FABRIC)
227
+ if (uiManager is UIManager) {
228
+ uiManager.resolveView(tag)?.let { view ->
229
+ if (view is SpallaPlayerContainerView) {
230
+ //view.spallaPlayerView.pause()
231
+ view.spallaPlayerView.onDestroy()
229
232
  }
230
233
  }
231
234
  }
@@ -124,14 +124,13 @@ class RNSpallaPlayerManager() : ViewGroupManager<SpallaPlayerContainerView>(),
124
124
  // Unregister this manager
125
125
  SpallaPlayerPipModule.unregisterPlayerManager(this)
126
126
 
127
- view.post {
128
- try {
129
- loadTimer?.cancel()
130
- view.spallaPlayerView.onDestroy()
131
- } catch (e: Exception) {
132
- e.printStackTrace()
133
- }
127
+ try {
128
+ loadTimer?.cancel()
129
+ view.spallaPlayerView.onDestroy()
130
+ } catch (e: Exception) {
131
+ e.printStackTrace()
134
132
  }
133
+
135
134
  super.onDropViewInstance(view)
136
135
  }
137
136
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-spalla-player",
3
- "version": "0.19.2",
3
+ "version": "0.19.3",
4
4
  "description": "Spalla SDK for RN",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",