@takeoffmedia/react-native-penthera 0.2.55 → 0.2.56

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.
@@ -129,9 +129,11 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine, virtuoso: Virtuoso)
129
129
  } else if(assetStatus == "Downloading") {
130
130
  Util.manageInternetSpeed(it.assetURL) { speedInMbps ->
131
131
  val speedInKbps = speedInMbps * 1000
132
- if (speedInMbps != -1.0 && speedInKbps < mOfflineVideo.minimumLowBandWidth) {
133
- runOnUiThread {
134
- EventEmitter.sharedInstance.dispatch("penthera", PentheraEvent.ERROR_DOWNLOAD, it.assetId, PentheraErrors.LOW_BAND_WIDTH)
132
+ if (speedInMbps > 0) {
133
+ if(speedInKbps <= mOfflineVideo.minimumLowBandWidth){
134
+ runOnUiThread {
135
+ EventEmitter.sharedInstance.dispatch("penthera", PentheraEvent.ERROR_DOWNLOAD, it.assetId, PentheraErrors.LOW_BAND_WIDTH)
136
+ }
135
137
  }
136
138
  }
137
139
  }
@@ -44,7 +44,7 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
44
44
  var asset: IAsset? = null
45
45
  var assetId: MutableList<String> = mutableListOf()
46
46
  private val gson = Gson()
47
- var minimumLowBandWidth: Int = 100
47
+ var minimumLowBandWidth: Double = 0.00010
48
48
 
49
49
  private val enginePauseObserver: Observers.IEngineObserver = object : EngineObserver() {
50
50
  override fun engineStatusChanged(status: Int) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeoffmedia/react-native-penthera",
3
- "version": "0.2.55",
3
+ "version": "0.2.56",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",