react-native-tpstreams 1.1.11 → 1.1.13-beta.1
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.
|
@@ -11,7 +11,10 @@ import com.facebook.react.bridge.WritableMap
|
|
|
11
11
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
12
12
|
import com.tpstreams.player.download.DownloadClient
|
|
13
13
|
import com.tpstreams.player.download.DownloadItem
|
|
14
|
+
import androidx.annotation.OptIn
|
|
15
|
+
import androidx.media3.common.util.UnstableApi
|
|
14
16
|
|
|
17
|
+
@OptIn(UnstableApi::class)
|
|
15
18
|
class TPStreamsDownloadModule(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext), DownloadClient.Listener {
|
|
16
19
|
|
|
17
20
|
private val downloadClient: DownloadClient by lazy {
|
|
@@ -36,7 +39,7 @@ class TPStreamsDownloadModule(private val reactContext: ReactApplicationContext)
|
|
|
36
39
|
val metadataString = metadata?.let { org.json.JSONObject(it.toHashMap()).toString() }
|
|
37
40
|
val metadataMap = JsonUtils.jsonStringToMap(metadataString)
|
|
38
41
|
|
|
39
|
-
val activity =
|
|
42
|
+
val activity =reactApplicationContext.currentActivity?: run {
|
|
40
43
|
promise.reject("DOWNLOAD_START_ERROR", "No current activity available")
|
|
41
44
|
return
|
|
42
45
|
}
|
|
@@ -14,7 +14,10 @@ import androidx.media3.common.PlaybackParameters
|
|
|
14
14
|
import androidx.media3.common.PlaybackException
|
|
15
15
|
import android.media.MediaCodec
|
|
16
16
|
import android.view.View.MeasureSpec
|
|
17
|
+
import androidx.annotation.OptIn
|
|
18
|
+
import androidx.media3.common.util.UnstableApi
|
|
17
19
|
|
|
20
|
+
@OptIn(UnstableApi::class)
|
|
18
21
|
class TPStreamsRNPlayerView(context: ThemedReactContext) : FrameLayout(context) {
|
|
19
22
|
private val playerView: TPStreamsPlayerView = TPStreamsPlayerView(context)
|
|
20
23
|
private var player: TPStreamsPlayer? = null
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-tpstreams",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.13-beta.1",
|
|
4
4
|
"description": "Video component for TPStreams",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -170,4 +170,4 @@
|
|
|
170
170
|
"type": "fabric-view",
|
|
171
171
|
"version": "0.50.3"
|
|
172
172
|
}
|
|
173
|
-
}
|
|
173
|
+
}
|