expo-libvlc-player 7.0.23 → 7.0.25

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img alt="VLC icon" src="https://images.videolan.org/images/VLC-IconSmall.png">
2
+ <img alt="VLC icon" src="example/assets/vlc.png">
3
3
  </p>
4
4
 
5
5
  <h1 align="center">LibVLC Player for Expo</h1>
@@ -293,9 +293,9 @@ The current workaround attaches the View back but this causes a brief black scre
293
293
 
294
294
  https://code.videolan.org/videolan/vlc-android/-/issues/1495
295
295
 
296
- On iOS, the `VLCKit` player deselects the current video track after switching screens.
296
+ On iOS, the `VLCKit` player loses the current video track after pausing in the background.
297
297
 
298
- The current workaround selects the previous video track but this causes a brief black screen.
298
+ The current workaround restores the selected video track but this causes a brief black screen.
299
299
 
300
300
  https://code.videolan.org/videolan/VLCKit/-/issues/743
301
301
 
@@ -14,7 +14,6 @@ class LibVlcPlayerView: ExpoView {
14
14
  var vlcDialogRef: NSValue?
15
15
 
16
16
  var oldVolume: Int = MediaPlayerConstants.maxPlayerVolume
17
- var isInBackground: Bool = false
18
17
 
19
18
  var firstPlay: Bool = true
20
19
  private var shouldInit: Bool = true
@@ -299,6 +298,22 @@ class LibVlcPlayerView: ExpoView {
299
298
  return CGSize(width: 0, height: 0)
300
299
  }
301
300
 
301
+ func resetVideoTrack() {
302
+ guard let player = mediaPlayer,
303
+ let videoTrack = player.videoTracks.first(where: { track in track.isSelected }),
304
+ !player.isPlaying
305
+ else { return }
306
+
307
+ videoTrack.isSelected = false
308
+ videoTrack.isSelectedExclusively = true
309
+
310
+ DispatchQueue.main.async {
311
+ if player.isSeekable {
312
+ player.time = VLCTime(int: player.time.intValue)
313
+ }
314
+ }
315
+ }
316
+
302
317
  var hasVideoSize: Bool {
303
318
  let video = getVideoSize()
304
319
  return video.width > 0 && video.height > 0
@@ -432,21 +447,11 @@ class LibVlcPlayerView: ExpoView {
432
447
  }
433
448
 
434
449
  func pauseReset() {
435
- guard let player = mediaPlayer,
436
- let videoTrack = player.videoTracks.first(where: { track in track.isSelected }),
437
- isInBackground
438
- else { return }
439
-
440
- player.pause()
441
-
442
- videoTrack.isSelected = false
443
- videoTrack.isSelectedExclusively = true
444
-
445
- DispatchQueue.main.async {
446
- if player.isSeekable {
447
- player.time = VLCTime(int: player.time.intValue)
448
- }
450
+ if !pictureInPicture {
451
+ mediaPlayer?.pause()
449
452
  }
453
+
454
+ resetVideoTrack()
450
455
  }
451
456
 
452
457
  func stop() {
@@ -540,7 +545,7 @@ class LibVlcPlayerView: ExpoView {
540
545
  }
541
546
 
542
547
  func onStopPictureInPicture() {
543
- pauseReset()
548
+ resetVideoTrack()
544
549
  onPictureInPictureStop()
545
550
  }
546
551
 
@@ -25,19 +25,14 @@ class MediaPlayerManager {
25
25
 
26
26
  func onModuleForeground() {
27
27
  for view in expoViews.allObjects {
28
- view.isInBackground = false
29
28
  view.onForeground()
30
29
  }
31
30
  }
32
31
 
33
32
  func onModuleBackground() {
34
33
  for view in expoViews.allObjects {
35
- view.isInBackground = true
36
34
  view.onBackground()
37
-
38
- if !view.pictureInPicture {
39
- view.pauseReset()
40
- }
35
+ view.pauseReset()
41
36
  }
42
37
  }
43
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-libvlc-player",
3
- "version": "7.0.23",
3
+ "version": "7.0.25",
4
4
  "description": "LibVLC Player for Expo",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  "@types/react": "^19.2.14",
37
37
  "eslint": "^9.39.4",
38
38
  "eslint-config-universe": "^15.0.3",
39
- "expo": "~55.0.20",
39
+ "expo": "~55.0.23",
40
40
  "husky": "^9.1.7",
41
41
  "lint-staged": "^16.4.0",
42
42
  "prettier": "^3.8.3",