expo-libvlc-player 6.1.12 → 6.1.13
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.
|
@@ -671,19 +671,24 @@ class LibVlcPlayerView(
|
|
|
671
671
|
{ copyResult ->
|
|
672
672
|
if (copyResult != PixelCopy.SUCCESS) {
|
|
673
673
|
onEncounteredError(mapOf("error" to "Snapshot could not be taken"))
|
|
674
|
+
return@request
|
|
674
675
|
}
|
|
675
676
|
|
|
676
|
-
|
|
677
|
-
|
|
677
|
+
try {
|
|
678
|
+
val simpleDateFormat = SimpleDateFormat("yyyy-MM-dd-HH'h'mm'm'ss's'")
|
|
679
|
+
val timestamp = simpleDateFormat.format(Calendar.getInstance().time)
|
|
678
680
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
+
val snapshotPath = path + "/vlc-snapshot-$timestamp.jpg"
|
|
682
|
+
val file = File(snapshotPath)
|
|
681
683
|
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
684
|
+
FileOutputStream(file).use { stream ->
|
|
685
|
+
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream)
|
|
686
|
+
}
|
|
685
687
|
|
|
686
|
-
|
|
688
|
+
onSnapshotTaken(mapOf("path" to snapshotPath))
|
|
689
|
+
} catch (_: Exception) {
|
|
690
|
+
onEncounteredError(mapOf("error" to "Snapshot could not be taken"))
|
|
691
|
+
}
|
|
687
692
|
},
|
|
688
693
|
Handler(Looper.getMainLooper()),
|
|
689
694
|
)
|