expo-libvlc-player 6.1.9 → 6.1.11

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.
@@ -669,7 +669,9 @@ class LibVlcPlayerView(
669
669
  surface,
670
670
  bitmap,
671
671
  { copyResult ->
672
- if (copyResult != PixelCopy.SUCCESS) throw Exception()
672
+ if (copyResult != PixelCopy.SUCCESS) {
673
+ onEncounteredError(mapOf("error" to "Snapshot could not be taken"))
674
+ }
673
675
 
674
676
  val simpleDateFormat = SimpleDateFormat("yyyy-MM-dd-HH'h'mm'm'ss's'")
675
677
  val timestamp = simpleDateFormat.format(Calendar.getInstance().time)
@@ -484,6 +484,10 @@ class LibVlcPlayerView: ExpoView {
484
484
  }
485
485
  }
486
486
 
487
+ private func snapshotExists(_ path: String) -> Bool {
488
+ FileManager.default.fileExists(atPath: path)
489
+ }
490
+
487
491
  func snapshot(_ path: String) {
488
492
  if hasVideoSize {
489
493
  let dateFormatter = DateFormatter()
@@ -495,10 +499,23 @@ class LibVlcPlayerView: ExpoView {
495
499
 
496
500
  mediaPlayer?.saveVideoSnapshot(at: snapshotPath, withWidth: Int32(video.width), andHeight: Int32(video.height))
497
501
 
498
- onSnapshotTaken(["path": snapshotPath])
502
+ retryUntil { [weak self] isLastAttempt in
503
+ guard let self else { return true }
504
+
505
+ let hasSnapshot = snapshotExists(snapshotPath)
506
+
507
+ if hasSnapshot {
508
+ onSnapshotTaken(["path": snapshotPath])
509
+ } else if !isLastAttempt {
510
+ mediaPlayer?.saveVideoSnapshot(at: snapshotPath, withWidth: Int32(0), andHeight: Int32(0))
511
+ } else {
512
+ onEncounteredError(["error": "Snapshot could not be taken"])
513
+ }
514
+
515
+ return hasSnapshot
516
+ }
499
517
  } else {
500
518
  onEncounteredError(["error": "Snapshot could not be taken"])
501
- return
502
519
  }
503
520
  }
504
521
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-libvlc-player",
3
- "version": "6.1.9",
3
+ "version": "6.1.11",
4
4
  "description": "LibVLC Player for Expo",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -39,12 +39,12 @@
39
39
  "@eslint/js": "^9.39.4",
40
40
  "@types/react": "~19.2.10",
41
41
  "eslint": "^9.39.4",
42
- "expo": "^55.0.5",
42
+ "expo": "~55.0.11",
43
43
  "expo-module-scripts": "^55.0.2",
44
44
  "globals": "^16.5.0",
45
45
  "husky": "^9.1.7",
46
46
  "lint-staged": "^16.3.2",
47
- "react-native": "0.83.2"
47
+ "react-native": "0.83.4"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "expo": "*",