@takeoffmedia/react-native-penthera 0.5.4 → 0.5.5

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.
@@ -12,6 +12,7 @@ import com.facebook.react.bridge.ReadableArray
12
12
  import com.facebook.react.bridge.ReadableMap
13
13
  import com.facebook.react.bridge.UiThreadUtil
14
14
  import com.google.gson.Gson
15
+ import com.penthera.common.Common
15
16
  import com.penthera.virtuososdk.client.AncillaryFile
16
17
  import com.penthera.virtuososdk.client.EngineObserver
17
18
  import com.penthera.virtuososdk.client.IAsset
@@ -19,23 +20,22 @@ import com.penthera.virtuososdk.client.IIdentifier
19
20
  import com.penthera.virtuososdk.client.IPushRegistrationObserver
20
21
  import com.penthera.virtuososdk.client.ISegmentedAsset
21
22
  import com.penthera.virtuososdk.client.ISegmentedAssetFromParserObserver
23
+ import com.penthera.virtuososdk.client.IService
22
24
  import com.penthera.virtuososdk.client.Virtuoso
23
25
  import com.penthera.virtuososdk.client.bitmovin.BitmovinSourceManager
24
26
  import com.penthera.virtuososdk.client.builders.MPDAssetBuilder
25
27
  import com.penthera.virtuososdk.interfaces.toolkit.VirtuosoSegmentedFile
26
28
  import com.takeoffmediareactnativepenthera.AssetQueueObserver
27
- import okhttp3.OkHttpClient
28
- import okhttp3.Request
29
+ import com.takeoffmediareactnativepenthera.EventEmitter
30
+ import com.takeoffmediareactnativepenthera.PentheraEvent
31
+ import com.takeoffmediareactnativepenthera.virtuoso.errors.PentheraErrors
29
32
  import org.json.JSONArray
30
33
  import org.json.JSONObject
31
- import java.io.IOException
34
+ import java.net.HttpURLConnection
32
35
  import java.net.MalformedURLException
33
36
  import java.net.URL
34
- import com.penthera.common.Common
35
- import com.penthera.virtuososdk.client.IService
36
- import com.takeoffmediareactnativepenthera.EventEmitter
37
- import com.takeoffmediareactnativepenthera.PentheraEvent
38
- import com.takeoffmediareactnativepenthera.virtuoso.errors.PentheraErrors
37
+ import java.text.SimpleDateFormat
38
+ import java.util.Calendar
39
39
  import java.util.UUID
40
40
 
41
41
  class OfflineVideoEngine(private val context: ReactApplicationContext) {
@@ -44,7 +44,6 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
44
44
  var asset: IAsset? = null
45
45
  val assetId: MutableList<String> = mutableListOf()
46
46
  private val gson = Gson()
47
- private val client = OkHttpClient()
48
47
  var minimumLowBandWidth: Double = 0.5 // 500kbps
49
48
  val mService: IService = virtuoso.service
50
49
  private val enginePauseObserver = object: EngineObserver() {
@@ -280,33 +279,36 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
280
279
  }
281
280
 
282
281
 
283
- fun getByAssetId(assetId: String): String? {
284
- try {
285
- // load asset if it has already been downloaded
286
- val list: MutableList<IIdentifier> = virtuoso.assetManager.getByAssetId(assetId)
282
+ fun getByAssetId(assetId: String): String? {
283
+ try {
284
+ // load asset if it has already been downloaded
285
+ val list: MutableList<IIdentifier> = virtuoso.assetManager.getByAssetId(assetId)
287
286
 
288
- list.let {
289
- if (it.isNotEmpty()) {
290
- asset = list[0] as VirtuosoSegmentedFile
287
+ list.let {
288
+ if (it.isNotEmpty()) {
289
+ asset = list[0] as VirtuosoSegmentedFile
291
290
 
292
- // This a workaround to works ancillary files
293
- val offlineUrl = asset?.playbackURL
291
+ // This a workaround to work with ancillary files
292
+ val offlineUrl = asset?.playbackURL
294
293
 
295
- val keyValueMap = HashMap<String, Any>()
296
- keyValueMap["offlineUrl"] = offlineUrl.toString()
297
- keyValueMap["metadata"] = asset?.metadata.toString()
294
+ (offlineUrl?.openConnection() as HttpURLConnection).connect()
298
295
 
299
- val ancillaryFiles = (asset as ISegmentedAsset).getAncillaryFiles(context)
296
+ val keyValueMap = HashMap<String, Any>()
297
+ keyValueMap["offlineUrl"] = offlineUrl.toString()
298
+ keyValueMap["metadata"] = asset?.metadata.toString()
300
299
 
301
- // HERE THE ASSET MANIFEST IS REQUESTED
302
- keyValueMap["ancillary"] = ancillaryFiles
303
- return gson.toJson(keyValueMap)
304
- }
300
+ val ancillaryFiles = (asset as ISegmentedAsset).getAncillaryFiles(context)
301
+
302
+ keyValueMap["ancillary"] = ancillaryFiles
303
+
304
+
305
+ return gson.toJson(keyValueMap)
305
306
  }
306
- } catch (e: Exception) {
307
- e.printStackTrace()
308
307
  }
309
- return null
308
+ } catch (e: Exception) {
309
+ e.printStackTrace()
310
+ }
311
+ return null
310
312
  }
311
313
 
312
314
  private fun toSubtitleMimeType(format: String?): String? {
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>IDEDidComputeMac32BitWarning</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
@@ -0,0 +1,104 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Bucket
3
+ uuid = "3AE98629-7421-4561-B12C-C06B8B6A3023"
4
+ type = "1"
5
+ version = "2.0">
6
+ <Breakpoints>
7
+ <BreakpointProxy
8
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
9
+ <BreakpointContent
10
+ uuid = "A5D166B0-3C57-4F4D-A845-BDB81498DA0F"
11
+ shouldBeEnabled = "No"
12
+ ignoreCount = "0"
13
+ continueAfterRunningActions = "No"
14
+ filePath = "Penthera.swift"
15
+ startingColumnNumber = "9223372036854775807"
16
+ endingColumnNumber = "9223372036854775807"
17
+ startingLineNumber = "18"
18
+ endingLineNumber = "18"
19
+ landmarkName = "Penthera"
20
+ landmarkType = "3">
21
+ </BreakpointContent>
22
+ </BreakpointProxy>
23
+ <BreakpointProxy
24
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
25
+ <BreakpointContent
26
+ uuid = "5D7AE47B-D5FC-4468-A75B-C414F3F8A58C"
27
+ shouldBeEnabled = "No"
28
+ ignoreCount = "0"
29
+ continueAfterRunningActions = "No"
30
+ filePath = "Penthera.swift"
31
+ startingColumnNumber = "9223372036854775807"
32
+ endingColumnNumber = "9223372036854775807"
33
+ startingLineNumber = "25"
34
+ endingLineNumber = "25"
35
+ landmarkName = "updateStatusInfo()"
36
+ landmarkType = "7">
37
+ </BreakpointContent>
38
+ </BreakpointProxy>
39
+ <BreakpointProxy
40
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
41
+ <BreakpointContent
42
+ uuid = "E3C50B30-46CF-4D56-8C49-C257C70E0ACC"
43
+ shouldBeEnabled = "No"
44
+ ignoreCount = "0"
45
+ continueAfterRunningActions = "No"
46
+ filePath = "Penthera.swift"
47
+ startingColumnNumber = "9223372036854775807"
48
+ endingColumnNumber = "9223372036854775807"
49
+ startingLineNumber = "26"
50
+ endingLineNumber = "26"
51
+ landmarkName = "updateStatusInfo()"
52
+ landmarkType = "7">
53
+ </BreakpointContent>
54
+ </BreakpointProxy>
55
+ <BreakpointProxy
56
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
57
+ <BreakpointContent
58
+ uuid = "75EF43BF-56FF-4727-B372-E1A0EBC02C61"
59
+ shouldBeEnabled = "Yes"
60
+ ignoreCount = "0"
61
+ continueAfterRunningActions = "No"
62
+ filePath = "Penthera.swift"
63
+ startingColumnNumber = "9223372036854775807"
64
+ endingColumnNumber = "9223372036854775807"
65
+ startingLineNumber = "101"
66
+ endingLineNumber = "101"
67
+ landmarkName = "initializeSdk(user:backplaneUrl:publicKey:privateKey:resolve:reject:)"
68
+ landmarkType = "7">
69
+ </BreakpointContent>
70
+ </BreakpointProxy>
71
+ <BreakpointProxy
72
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
73
+ <BreakpointContent
74
+ uuid = "EF36B51B-4FC2-4989-A791-180E3212EFE3"
75
+ shouldBeEnabled = "Yes"
76
+ ignoreCount = "0"
77
+ continueAfterRunningActions = "No"
78
+ filePath = "Penthera.swift"
79
+ startingColumnNumber = "9223372036854775807"
80
+ endingColumnNumber = "9223372036854775807"
81
+ startingLineNumber = "149"
82
+ endingLineNumber = "149"
83
+ landmarkName = "getDownloadedAsset(assetID:)"
84
+ landmarkType = "7">
85
+ </BreakpointContent>
86
+ </BreakpointProxy>
87
+ <BreakpointProxy
88
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
89
+ <BreakpointContent
90
+ uuid = "C467C00E-2428-4D24-843A-E7CDF28CB553"
91
+ shouldBeEnabled = "Yes"
92
+ ignoreCount = "0"
93
+ continueAfterRunningActions = "No"
94
+ filePath = "Penthera.swift"
95
+ startingColumnNumber = "9223372036854775807"
96
+ endingColumnNumber = "9223372036854775807"
97
+ startingLineNumber = "148"
98
+ endingLineNumber = "148"
99
+ landmarkName = "getDownloadedAsset(assetID:)"
100
+ landmarkType = "7">
101
+ </BreakpointContent>
102
+ </BreakpointProxy>
103
+ </Breakpoints>
104
+ </Bucket>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>Penthera.xcscheme_^#shared#^_</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ </dict>
14
+ </plist>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeoffmedia/react-native-penthera",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",