@takeoffmedia/react-native-penthera 0.2.59 → 0.2.60

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
  }
@@ -69,36 +69,36 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
69
69
  }
70
70
 
71
71
  fun setup(
72
- userId: String,
73
- backplaneUrl: String,
74
- publicKey: String,
75
- privateKey: String,
76
- promise: Promise,
77
- ) {
78
- val backplane = getInstanceVirtuoso()
79
- val status = backplane.backplane?.authenticationStatus
80
- val nameDevice = android.os.Build.MODEL
81
- if (status == AuthenticationStatus.NOT_AUTHENTICATED) {
82
- virtuoso.startup(
83
- URL(backplaneUrl),
84
- userId,
72
+ userId: String,
73
+ backplaneUrl: String,
74
+ publicKey: String,
75
+ privateKey: String,
76
+ activity: Activity,
77
+ promise: Promise,
78
+ ) {
79
+ val vir = getVirtuoso(activity)
80
+
81
+ val nameDevice = android.os.Build.MODEL
82
+
83
+ vir.startup(
84
+ URL(backplaneUrl),
85
+ userId,
85
86
  nameDevice,
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
87
+ publicKey,
88
+ privateKey,
89
+ object : IPushRegistrationObserver {
90
+ override fun onServiceAvailabilityResponse(
91
+ pushService: Int,
92
+ errorCode: Int
93
+ ) {
94
+ //callback for push registration. this will be detailed in subsequent tutorials
95
+ }
94
96
  }
97
+ ).let {
98
+ promise.resolve("Penthera initialization successfully")
95
99
  }
96
- )
97
- return promise.resolve("Penthera initialization successfully")
98
- }
99
- return promise.resolve("Penthera initialization failed")
100
- }
101
100
 
101
+ }
102
102
 
103
103
  fun downloadAsset(newItem: String) {
104
104
  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.59",
3
+ "version": "0.2.60",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",