@takeoffmedia/react-native-penthera 0.2.46 → 0.2.47

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.
@@ -8,6 +8,7 @@ import com.penthera.virtuososdk.client.IIdentifier
8
8
  import com.penthera.virtuososdk.client.Observers
9
9
  import com.penthera.virtuososdk.client.Virtuoso
10
10
  import com.takeoffmediareactnativepenthera.virtuoso.OfflineVideoEngine
11
+ import com.takeoffmediareactnativepenthera.virtuoso.errors.PentheraErrors
11
12
 
12
13
  class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine, virtuoso: Virtuoso) : Observers.IQueueObserver {
13
14
 
@@ -37,11 +38,17 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine, virtuoso: Virtuoso)
37
38
  }
38
39
 
39
40
  override fun engineEncounteredErrorDownloadingAsset(aAsset: IIdentifier) {
41
+ var asset = aAsset as IAsset
42
+ var limit = asset.assetDownloadLimit
43
+ if(limit == -1 || limit == 0){
44
+ EventEmitter.sharedInstance.dispatch("penthera", PentheraEvent.ERROR_DOWNLOAD, asset.assetId, PentheraErrors.DOWNLOAD_DENIED_MAX_DEVICE_DOWNLOADS)
45
+ }
40
46
  Log.e("MiModulo","<<<<<<<<<<engineEncounteredErrorDownloadingAsset>>>>>>>>>>>>")
41
47
  // The base implementation does nothing. See class documentation.
42
48
  }
43
49
 
44
50
  override fun engineEncounteredErrorParsingAsset(mAssetId: String) {
51
+ var asset = mAssetId
45
52
  Log.e("MiModulo","<<<<<<<<<<engineEncounteredErrorParsingAsset>>>>>>>>>>>>")
46
53
  }
47
54
 
@@ -88,15 +95,15 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine, virtuoso: Virtuoso)
88
95
  }
89
96
  Common.AssetStatus.DOWNLOAD_DENIED_ASSET -> {
90
97
  assetStatus = "Queued"
91
- value = "The asset has already been downloaded as many times as permitted. To download this asset again, administrative action is required."
98
+ value = ""
92
99
  }
93
100
  Common.AssetStatus.DOWNLOAD_DENIED_MAX_DEVICE_DOWNLOADS -> {
94
101
  assetStatus = "Queued"
95
- value = "There are already as many downloads as permitted on this account. To continue downloading, the user must delete downloaded assets from one of their devices."
102
+ value = PentheraErrors.DOWNLOAD_DENIED_ASSET
96
103
  }
97
104
  Common.AssetStatus.DOWNLOAD_DENIED_COPIES -> {
98
105
  assetStatus = "Queued"
99
- value = "There are already as many downloaded copies of this asset as permitted on this account. To continue downloading, the user must delete a copy of this asset from one of their devices."
106
+ value = PentheraErrors.DOWNLOAD_DENIED_COPIES
100
107
  }
101
108
  Common.AssetStatus.DOWNLOAD_COMPLETE -> {
102
109
  assetStatus = "complete"
@@ -0,0 +1,7 @@
1
+ package com.takeoffmediareactnativepenthera.virtuoso.errors
2
+
3
+ object PentheraErrors {
4
+ const val DOWNLOAD_DENIED_ASSET = "The asset has already been downloaded as many times as permitted. To download this asset again, administrative action is required."
5
+ const val DOWNLOAD_DENIED_COPIES = "There are already as many downloaded copies of this asset as permitted on this account. To continue downloading, the user must delete a copy of this asset from one of their devices."
6
+ const val DOWNLOAD_DENIED_MAX_DEVICE_DOWNLOADS = "There are already as many downloads as permitted on this account. To continue downloading, the user must delete downloaded assets from one of their devices."
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeoffmedia/react-native-penthera",
3
- "version": "0.2.46",
3
+ "version": "0.2.47",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",