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.
package/android/build.gradle
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
224
|
-
|
|
225
|
-
uiManager
|
|
226
|
-
|
|
227
|
-
view
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
|