@takeoffmedia/react-native-penthera 0.5.0 → 0.5.3
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/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/OfflineVideoEngine.kt +22 -42
- package/ios/Penthera.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Penthera.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/Penthera.xcodeproj/project.xcworkspace/xcuserdata/joseguerreroot.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Penthera.xcodeproj/xcuserdata/joseguerreroot.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +104 -0
- package/ios/Penthera.xcodeproj/xcuserdata/joseguerreroot.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/package.json +1 -1
package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/OfflineVideoEngine.kt
CHANGED
|
@@ -31,8 +31,6 @@ import org.json.JSONObject
|
|
|
31
31
|
import java.io.IOException
|
|
32
32
|
import java.net.MalformedURLException
|
|
33
33
|
import java.net.URL
|
|
34
|
-
import java.text.SimpleDateFormat
|
|
35
|
-
import java.util.Calendar
|
|
36
34
|
import com.penthera.common.Common
|
|
37
35
|
import com.penthera.virtuososdk.client.IService
|
|
38
36
|
import com.takeoffmediareactnativepenthera.EventEmitter
|
|
@@ -220,10 +218,8 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
|
|
|
220
218
|
dataMap["isCompleted"] = isComplete
|
|
221
219
|
}
|
|
222
220
|
if (columnName == "firstPlayTime") {
|
|
223
|
-
val eadFormated = dateToString(ead)
|
|
224
|
-
val eapFormated = dateToString(eap)
|
|
225
221
|
(dataMap["data"] as? MutableMap<String, Any> ?: mutableMapOf()).apply {
|
|
226
|
-
put("effectiveExpiryDate", if (value == "0")
|
|
222
|
+
put("effectiveExpiryDate", if (value == "0") ead else eap);
|
|
227
223
|
put("isReproduced", value != "0");
|
|
228
224
|
}.also { dataMap["data"] = it }
|
|
229
225
|
}
|
|
@@ -256,20 +252,6 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
|
|
|
256
252
|
}
|
|
257
253
|
}
|
|
258
254
|
|
|
259
|
-
private fun dateToString(seconds: String): String {
|
|
260
|
-
val dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
|
|
261
|
-
return try {
|
|
262
|
-
val secondsLong = seconds.toLong()
|
|
263
|
-
Calendar.getInstance().let {
|
|
264
|
-
it.add(Calendar.SECOND, secondsLong.toInt())
|
|
265
|
-
dateFormat.format(it.time)
|
|
266
|
-
}
|
|
267
|
-
} catch (e: NumberFormatException) {
|
|
268
|
-
// Handle the exception here, for example, return an empty string or throw the exception
|
|
269
|
-
""
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
255
|
class AssetParseObserver(activity: Context) : ISegmentedAssetFromParserObserver {
|
|
274
256
|
private val mActivity: Context = activity
|
|
275
257
|
|
|
@@ -298,35 +280,33 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
|
|
|
298
280
|
}
|
|
299
281
|
|
|
300
282
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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)
|
|
304
287
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
288
|
+
list.let {
|
|
289
|
+
if (it.isNotEmpty()) {
|
|
290
|
+
asset = list[0] as VirtuosoSegmentedFile
|
|
308
291
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
val request = Request.Builder()
|
|
312
|
-
.url(offlineUrl.toString())
|
|
313
|
-
.build()
|
|
314
|
-
client.newCall(request).execute().use { response ->
|
|
315
|
-
if (!response.isSuccessful) throw IOException("Unexpected code $response")
|
|
316
|
-
}
|
|
292
|
+
// This a workaround to works ancillary files
|
|
293
|
+
val offlineUrl = asset?.playbackURL
|
|
317
294
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
295
|
+
val keyValueMap = HashMap<String, Any>()
|
|
296
|
+
keyValueMap["offlineUrl"] = offlineUrl.toString()
|
|
297
|
+
keyValueMap["metadata"] = asset?.metadata.toString()
|
|
321
298
|
|
|
322
|
-
|
|
299
|
+
val ancillaryFiles = (asset as ISegmentedAsset).getAncillaryFiles(context)
|
|
323
300
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
301
|
+
// HERE THE ASSET MANIFEST IS REQUESTED
|
|
302
|
+
keyValueMap["ancillary"] = ancillaryFiles
|
|
303
|
+
return gson.toJson(keyValueMap)
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
} catch (e: Exception) {
|
|
307
|
+
e.printStackTrace()
|
|
327
308
|
}
|
|
328
|
-
|
|
329
|
-
return null
|
|
309
|
+
return null
|
|
330
310
|
}
|
|
331
311
|
|
|
332
312
|
private fun toSubtitleMimeType(format: String?): String? {
|
|
Binary file
|
|
@@ -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>
|