expo-libvlc-player 7.0.34 → 7.0.36

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.
@@ -60,7 +60,6 @@ class LibVlcPlayerModule : Module() {
60
60
  }
61
61
 
62
62
  OnActivityEntersBackground {
63
- MediaPlayerManager.keepAwakeManager.deactivateKeepAwake()
64
63
  MediaPlayerManager.onModuleBackground()
65
64
  }
66
65
 
@@ -17,7 +17,7 @@ class KeepAwakeManager(
17
17
  view.mediaPlayer?.isPlaying() == true
18
18
  }
19
19
 
20
- fun activateKeepAwake() {
20
+ private fun activateKeepAwake() {
21
21
  activity.let { activity ->
22
22
  activity.runOnUiThread {
23
23
  activity.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
@@ -25,7 +25,7 @@ class KeepAwakeManager(
25
25
  }
26
26
  }
27
27
 
28
- fun deactivateKeepAwake() {
28
+ private fun deactivateKeepAwake() {
29
29
  activity.let { activity ->
30
30
  activity.runOnUiThread {
31
31
  activity.window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
@@ -115,11 +115,7 @@ class PictureInPictureManager(
115
115
 
116
116
  when (controlType) {
117
117
  MediaPlayerConstants.EXTRA_CONTROL_REWIND -> {
118
- val time = player.getTime()
119
-
120
- if (time != -1L) {
121
- player.setTime(time - MediaPlayerConstants.SEEK_STEP_MS)
122
- }
118
+ player.setTime(player.getTime() - MediaPlayerConstants.SEEK_STEP_MS)
123
119
  }
124
120
 
125
121
  MediaPlayerConstants.EXTRA_CONTROL_PLAY -> {
@@ -131,11 +127,7 @@ class PictureInPictureManager(
131
127
  }
132
128
 
133
129
  MediaPlayerConstants.EXTRA_CONTROL_FORWARD -> {
134
- val time = player.getTime()
135
-
136
- if (time != -1L) {
137
- player.setTime(time + MediaPlayerConstants.SEEK_STEP_MS)
138
- }
130
+ player.setTime(player.getTime() + MediaPlayerConstants.SEEK_STEP_MS)
139
131
  }
140
132
  }
141
133
  }
@@ -284,9 +276,6 @@ class PictureInPictureManager(
284
276
 
285
277
  pipView?.let { view ->
286
278
  // Black screen workaround
287
- view.detachPlayerLayout()
288
- view.attachPlayerLayout(pictureLayout)
289
-
290
279
  view.detachPlayerLayout()
291
280
  view.post { view.attachPlayerLayout(pictureLayout) }
292
281
  }
@@ -5,7 +5,6 @@ enum MediaPlayerConstants {
5
5
  static let minPlayerVolume: Int = 0
6
6
  static let maxPlayerVolume: Int = 100
7
7
 
8
- static let resetDelayMs: Double = 1_000.0
9
8
  static let expDelayMultiplier: Double = 1.5
10
9
  static let retryDelayMs: Double = 300.0
11
10
  static let maxRetryCount: Int = 3
@@ -41,7 +41,6 @@ public class LibVlcPlayerModule: Module {
41
41
  }
42
42
 
43
43
  OnAppEntersBackground {
44
- MediaPlayerManager.shared.keepAwakeManager.deactivateKeepAwake()
45
44
  MediaPlayerManager.shared.onModuleBackground()
46
45
  }
47
46
 
@@ -51,10 +51,12 @@ class AudioSessionManager {
51
51
  }
52
52
  }
53
53
 
54
- do {
55
- try audioSession.setActive(anyPlayingView || doNotMixOverride)
56
- } catch {
57
- log.warn("Failed to set the audio session")
54
+ if anyPlayingView || doNotMixOverride {
55
+ do {
56
+ try audioSession.setActive(true)
57
+ } catch {
58
+ log.warn("Failed to set the audio session")
59
+ }
58
60
  }
59
61
  }
60
62
 
@@ -3,13 +3,13 @@ class KeepAwakeManager {
3
3
 
4
4
  private lazy var expoViews = MediaPlayerManager.shared.expoViews
5
5
 
6
- func activateKeepAwake() {
6
+ private func activateKeepAwake() {
7
7
  DispatchQueue.main.async {
8
8
  UIApplication.shared.isIdleTimerDisabled = true
9
9
  }
10
10
  }
11
11
 
12
- func deactivateKeepAwake() {
12
+ private func deactivateKeepAwake() {
13
13
  DispatchQueue.main.async {
14
14
  UIApplication.shared.isIdleTimerDisabled = false
15
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-libvlc-player",
3
- "version": "7.0.34",
3
+ "version": "7.0.36",
4
4
  "description": "LibVLC Player for Expo",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",