@takeoffmedia/react-native-penthera 0.2.66 → 0.2.67

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.
@@ -334,18 +334,22 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
334
334
  val subtitles = JSONArray(metadata["subtitles"] as String)
335
335
  val ancillaryFiles = JSONArray(ancillaries)
336
336
  for (i in 0 until subtitles.length()) {
337
+ val subtitleMap = Arguments.createMap()
337
338
  val subtitle = subtitles.getJSONObject(i)
338
- var url: String = ""
339
+
339
340
  for (j in 0 until ancillaryFiles.length()) {
340
341
  val ancillary = ancillaryFiles.getJSONObject(j)
341
342
  if(ancillary.getString("description") == subtitle.getString("language")) {
342
- url = ancillary.getString("playbackUrl")
343
+ subtitleMap.putString("url", ancillary.getString("playbackUrl").toString())
343
344
  }
344
345
  }
345
- val language: String = subtitle.getString("language")
346
- val label: String = subtitle.getString("label")
347
- val format = "vtt"
348
- sourceItem.addSubtitleTrack(SubtitleTrack(url, language, label, format))
346
+ subtitleMap.putString("language",subtitle.getString("language"))
347
+ subtitleMap.putString("label",subtitle.getString("label"))
348
+ subtitleMap.putString("format","vtt")
349
+
350
+ JsonConverter.toSubtitleTrack(subtitleMap)?.let {
351
+ sourceItem.addSubtitleTrack(it)
352
+ }
349
353
  }
350
354
  if(startOffset != null) {
351
355
  sourceItem.options.startOffset = startOffset
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeoffmedia/react-native-penthera",
3
- "version": "0.2.66",
3
+ "version": "0.2.67",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",