@takeoffmedia/react-native-penthera 0.5.0 → 0.5.1
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.
package/android/src/main/java/com/takeoffmediareactnativepenthera/virtuoso/OfflineVideoEngine.kt
CHANGED
|
@@ -31,8 +31,6 @@ import org.json.JSONObject
|
|
|
31
31
|
import java.io.IOException
|
|
32
32
|
import java.net.MalformedURLException
|
|
33
33
|
import java.net.URL
|
|
34
|
-
import java.text.SimpleDateFormat
|
|
35
|
-
import java.util.Calendar
|
|
36
34
|
import com.penthera.common.Common
|
|
37
35
|
import com.penthera.virtuososdk.client.IService
|
|
38
36
|
import com.takeoffmediareactnativepenthera.EventEmitter
|
|
@@ -220,10 +218,8 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
|
|
|
220
218
|
dataMap["isCompleted"] = isComplete
|
|
221
219
|
}
|
|
222
220
|
if (columnName == "firstPlayTime") {
|
|
223
|
-
val eadFormated = dateToString(ead)
|
|
224
|
-
val eapFormated = dateToString(eap)
|
|
225
221
|
(dataMap["data"] as? MutableMap<String, Any> ?: mutableMapOf()).apply {
|
|
226
|
-
put("effectiveExpiryDate", if (value == "0")
|
|
222
|
+
put("effectiveExpiryDate", if (value == "0") ead else eap);
|
|
227
223
|
put("isReproduced", value != "0");
|
|
228
224
|
}.also { dataMap["data"] = it }
|
|
229
225
|
}
|
|
@@ -256,20 +252,6 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
|
|
|
256
252
|
}
|
|
257
253
|
}
|
|
258
254
|
|
|
259
|
-
private fun dateToString(seconds: String): String {
|
|
260
|
-
val dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
|
|
261
|
-
return try {
|
|
262
|
-
val secondsLong = seconds.toLong()
|
|
263
|
-
Calendar.getInstance().let {
|
|
264
|
-
it.add(Calendar.SECOND, secondsLong.toInt())
|
|
265
|
-
dateFormat.format(it.time)
|
|
266
|
-
}
|
|
267
|
-
} catch (e: NumberFormatException) {
|
|
268
|
-
// Handle the exception here, for example, return an empty string or throw the exception
|
|
269
|
-
""
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
255
|
class AssetParseObserver(activity: Context) : ISegmentedAssetFromParserObserver {
|
|
274
256
|
private val mActivity: Context = activity
|
|
275
257
|
|