@takeoffmedia/react-native-penthera 0.5.9 → 0.6.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.
package/android/build.gradle
CHANGED
|
@@ -81,7 +81,7 @@ dependencies {
|
|
|
81
81
|
implementation "com.facebook.react:react-native:+"
|
|
82
82
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
83
83
|
//penthera
|
|
84
|
-
implementation 'com.penthera:cnc-android-sdk:5.4.
|
|
84
|
+
implementation 'com.penthera:cnc-android-sdk:5.4.4'
|
|
85
85
|
implementation 'com.google.code.gson:gson:2.10.1'
|
|
86
86
|
implementation 'com.penthera:cnc-android-bitmovin-support:5.4.3'
|
|
87
87
|
|
package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/OfflineVideoEngine.kt
CHANGED
|
@@ -290,22 +290,29 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
|
|
|
290
290
|
|
|
291
291
|
// This a workaround to works ancillary files
|
|
292
292
|
val offlineUrl = asset?.playbackURL
|
|
293
|
-
|
|
294
|
-
.
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
293
|
+
if (offlineUrl != null) {
|
|
294
|
+
val request = Request.Builder()
|
|
295
|
+
.url(offlineUrl.toString())
|
|
296
|
+
.build()
|
|
297
|
+
|
|
298
|
+
client.newCall(request).execute().use { response ->
|
|
299
|
+
if (!response.isSuccessful) throw IOException("Unexpected code $response")
|
|
300
|
+
}
|
|
299
301
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
302
|
+
val keyValueMap = HashMap<String, Any>()
|
|
303
|
+
keyValueMap["offlineUrl"] = offlineUrl.toString()
|
|
304
|
+
keyValueMap["metadata"] = asset?.metadata.toString()
|
|
303
305
|
|
|
304
|
-
|
|
306
|
+
val ancillaryFiles = (asset as ISegmentedAsset).getAncillaryFiles(context)
|
|
307
|
+
|
|
308
|
+
// HERE THE ASSET MANIFEST IS REQUESTED
|
|
309
|
+
keyValueMap["ancillary"] = ancillaryFiles
|
|
310
|
+
return gson.toJson(keyValueMap)
|
|
311
|
+
} else {
|
|
312
|
+
// Handle the case where offlineUrl is null
|
|
313
|
+
println("Error: offlineUrl is null")
|
|
314
|
+
}
|
|
305
315
|
|
|
306
|
-
// HERE THE ASSET MANIFEST IS REQUESTED
|
|
307
|
-
keyValueMap["ancillary"] = ancillaryFiles
|
|
308
|
-
return gson.toJson(keyValueMap)
|
|
309
316
|
}
|
|
310
317
|
}
|
|
311
318
|
return null
|