@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.
@@ -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.3'
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
 
@@ -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
- val request = Request.Builder()
294
- .url(offlineUrl.toString())
295
- .build()
296
- client.newCall(request).execute().use { response ->
297
- if (!response.isSuccessful) throw IOException("Unexpected code $response")
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
- val keyValueMap = HashMap<String, Any>()
301
- keyValueMap["offlineUrl"] = offlineUrl.toString()
302
- keyValueMap["metadata"] = asset?.metadata.toString()
302
+ val keyValueMap = HashMap<String, Any>()
303
+ keyValueMap["offlineUrl"] = offlineUrl.toString()
304
+ keyValueMap["metadata"] = asset?.metadata.toString()
303
305
 
304
- val ancillaryFiles = (asset as ISegmentedAsset).getAncillaryFiles(context)
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeoffmedia/react-native-penthera",
3
- "version": "0.5.9",
3
+ "version": "0.6.1",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",