@takeoffmedia/react-native-penthera 0.2.59 → 0.2.61
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.
|
@@ -22,6 +22,9 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine, virtuoso: Virtuoso)
|
|
|
22
22
|
override fun engineStartedDownloadingAsset(aAsset: IIdentifier) {
|
|
23
23
|
val updateAsset = aAsset as IAsset
|
|
24
24
|
val assetId = updateAsset.assetId
|
|
25
|
+
if (!mOfflineVideo.assetId.contains(assetId)) {
|
|
26
|
+
mOfflineVideo.assetId.add(assetId)
|
|
27
|
+
}
|
|
25
28
|
lastProgress = -1
|
|
26
29
|
updateItem(aAsset, true)
|
|
27
30
|
EventEmitter.sharedInstance.dispatch("penthera", PentheraEvent.DID_START_DOWNLOADING, assetId, "")
|
|
@@ -66,8 +69,6 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine, virtuoso: Virtuoso)
|
|
|
66
69
|
// Progress is for catalog item
|
|
67
70
|
if (assetId.isNotEmpty() && assetId in mOfflineVideo.assetId) {
|
|
68
71
|
//update our asset status
|
|
69
|
-
//mActivity.runOnUiThread{ updateItemStatus(updateAsset, forceUpdate) }
|
|
70
|
-
//mOfflineVideo { updateItemStatus(updateAsset, forceUpdate) }
|
|
71
72
|
updateItemStatus(updateAsset, forceUpdate)
|
|
72
73
|
}
|
|
73
74
|
}
|
package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/OfflineVideoEngine.kt
CHANGED
|
@@ -69,36 +69,35 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
fun setup(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
72
|
+
userId: String,
|
|
73
|
+
backplaneUrl: String,
|
|
74
|
+
publicKey: String,
|
|
75
|
+
privateKey: String,
|
|
76
|
+
promise: Promise,
|
|
77
|
+
) {
|
|
78
|
+
val vir = getInstanceVirtuoso()
|
|
79
|
+
|
|
80
|
+
val nameDevice = android.os.Build.MODEL
|
|
81
|
+
|
|
82
|
+
vir.startup(
|
|
83
|
+
URL(backplaneUrl),
|
|
84
|
+
userId,
|
|
85
85
|
nameDevice,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
publicKey,
|
|
87
|
+
privateKey,
|
|
88
|
+
object : IPushRegistrationObserver {
|
|
89
|
+
override fun onServiceAvailabilityResponse(
|
|
90
|
+
pushService: Int,
|
|
91
|
+
errorCode: Int
|
|
92
|
+
) {
|
|
93
|
+
//callback for push registration. this will be detailed in subsequent tutorials
|
|
94
|
+
}
|
|
94
95
|
}
|
|
96
|
+
).let {
|
|
97
|
+
promise.resolve("Penthera initialization successfully")
|
|
95
98
|
}
|
|
96
|
-
)
|
|
97
|
-
return promise.resolve("Penthera initialization successfully")
|
|
98
|
-
}
|
|
99
|
-
return promise.resolve("Penthera initialization failed")
|
|
100
|
-
}
|
|
101
99
|
|
|
100
|
+
}
|
|
102
101
|
|
|
103
102
|
fun downloadAsset(newItem: String) {
|
|
104
103
|
val data = JSONObject(newItem)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeoffmedia/react-native-penthera",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.61",
|
|
4
4
|
"description": "test",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -166,4 +166,4 @@
|
|
|
166
166
|
"dependencies": {
|
|
167
167
|
"zustand": "^4.4.0"
|
|
168
168
|
}
|
|
169
|
-
}
|
|
169
|
+
}
|