@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
|
|
133
|
-
|
|
134
|
-
|
|
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
|
}
|
package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/OfflineVideoEngine.kt
CHANGED
|
@@ -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:
|
|
47
|
+
var minimumLowBandWidth: Double = 0.00010
|
|
48
48
|
|
|
49
49
|
private val enginePauseObserver: Observers.IEngineObserver = object : EngineObserver() {
|
|
50
50
|
override fun engineStatusChanged(status: Int) {
|