expo-libvlc-player 7.0.28 → 7.0.30

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
@@ -289,13 +289,13 @@ interface MediaInfo {
289
289
 
290
290
  On Android, the `libvlcjni` player detaches from the View after switching screens.
291
291
 
292
- The current workaround attaches the View back but this causes a brief black screen.
292
+ The current workaround attaches the View back to the player but it causes a brief black screen.
293
293
 
294
294
  https://code.videolan.org/videolan/vlc-android/-/issues/1495
295
295
 
296
- On iOS, the `VLCKit` player loses the current video track after pausing in the background.
296
+ On iOS, the `VLCKit` player deselects the video track after pausing in the background.
297
297
 
298
- The current workaround restores the selected video track but this causes a brief black screen.
298
+ The current workaround selects the video track back but it causes a brief black screen.
299
299
 
300
300
  https://code.videolan.org/videolan/VLCKit/-/issues/743
301
301
 
@@ -300,17 +300,14 @@ class LibVlcPlayerView: ExpoView {
300
300
 
301
301
  func resetVideoTrack() {
302
302
  guard let player = mediaPlayer,
303
- let videoTrack = player.videoTracks.first(where: { track in track.isSelected }),
304
- !player.isPlaying
303
+ let videoTrack = player.videoTracks.first(where: { track in track.isSelected })
305
304
  else { return }
306
305
 
307
306
  videoTrack.isSelected = false
308
307
  videoTrack.isSelectedExclusively = true
309
308
 
310
309
  // Black screen workaround
311
- DispatchQueue.main.async {
312
- player.time = VLCTime(int: player.time.intValue)
313
- }
310
+ player.time = VLCTime(int: player.time.intValue)
314
311
  }
315
312
 
316
313
  var hasVideoSize: Bool {
@@ -452,10 +449,7 @@ class LibVlcPlayerView: ExpoView {
452
449
  }
453
450
 
454
451
  func pauseReset() {
455
- if !pictureInPicture {
456
- mediaPlayer?.pause()
457
- }
458
-
452
+ mediaPlayer?.pause()
459
453
  resetVideoTrack()
460
454
  }
461
455
 
@@ -542,7 +536,9 @@ class LibVlcPlayerView: ExpoView {
542
536
  }
543
537
 
544
538
  func onStopPictureInPicture() {
545
- resetVideoTrack()
539
+ if mediaPlayer?.isPlaying == false {
540
+ resetVideoTrack()
541
+ }
546
542
  onPictureInPictureStop()
547
543
  }
548
544
 
@@ -32,7 +32,10 @@ class MediaPlayerManager {
32
32
  func onModuleBackground() {
33
33
  for view in expoViews.allObjects {
34
34
  view.onBackground()
35
- view.pauseReset()
35
+
36
+ if !view.pictureInPicture {
37
+ view.pauseReset()
38
+ }
36
39
  }
37
40
  }
38
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-libvlc-player",
3
- "version": "7.0.28",
3
+ "version": "7.0.30",
4
4
  "description": "LibVLC Player for Expo",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",