···8080+ }
8181+}
8282\ No newline at end of file
8383+diff --git a/node_modules/expo-video/android/src/main/java/expo/modules/video/VideoManager.kt b/node_modules/expo-video/android/src/main/java/expo/modules/video/VideoManager.kt
8484+index 4b6c6d8..e20f51a 100644
8585+--- a/node_modules/expo-video/android/src/main/java/expo/modules/video/VideoManager.kt
8686++++ b/node_modules/expo-video/android/src/main/java/expo/modules/video/VideoManager.kt
8787+@@ -1,5 +1,6 @@
8888+ package expo.modules.video
8989+9090++import android.provider.MediaStore.Video
9191+ import androidx.annotation.OptIn
9292+ import androidx.media3.common.util.UnstableApi
9393+ import expo.modules.kotlin.AppContext
9494+@@ -15,6 +16,8 @@ object VideoManager {
9595+ // Keeps track of all existing VideoPlayers, and whether they are attached to a VideoView
9696+ private var videoPlayersToVideoViews = mutableMapOf<VideoPlayer, MutableList<VideoView>>()
9797+9898++ private var previouslyPlayingViews: MutableList<VideoView>? = null
9999++
100100+ private lateinit var audioFocusManager: AudioFocusManager
101101+102102+ fun onModuleCreated(appContext: AppContext) {
103103+@@ -69,16 +72,24 @@ object VideoManager {
104104+ return videoPlayersToVideoViews[videoPlayer]?.isNotEmpty() ?: false
105105+ }
106106+107107+- fun onAppForegrounded() = Unit
108108++ fun onAppForegrounded() {
109109++ val previouslyPlayingViews = this.previouslyPlayingViews ?: return
110110++ for (videoView in previouslyPlayingViews) {
111111++ val player = videoView.videoPlayer?.player ?: continue
112112++ player.play()
113113++ }
114114++ this.previouslyPlayingViews = null
115115++ }
116116+117117+ fun onAppBackgrounded() {
118118++ val previouslyPlayingViews = mutableListOf<VideoView>()
119119+ for (videoView in videoViews.values) {
120120+- if (videoView.videoPlayer?.staysActiveInBackground == false &&
121121+- !videoView.willEnterPiP &&
122122+- !videoView.isInFullscreen
123123+- ) {
124124+- videoView.videoPlayer?.player?.pause()
125125++ val player = videoView.videoPlayer?.player ?: continue
126126++ if (player.isPlaying) {
127127++ player.pause()
128128++ previouslyPlayingViews.add(videoView)
129129+ }
130130+ }
131131++ this.previouslyPlayingViews = previouslyPlayingViews
132132+ }
133133+ }
83134diff --git a/node_modules/expo-video/android/src/main/java/expo/modules/video/VideoModule.kt b/node_modules/expo-video/android/src/main/java/expo/modules/video/VideoModule.kt
84135index ec3da2a..5a1397a 100644
85136--- a/node_modules/expo-video/android/src/main/java/expo/modules/video/VideoModule.kt
···220271 //# sourceMappingURL=VideoView.types.d.ts.map
221272\ No newline at end of file
222273diff --git a/node_modules/expo-video/ios/VideoManager.swift b/node_modules/expo-video/ios/VideoManager.swift
223223-index 094a8b0..412fd0c 100644
274274+index 094a8b0..3f00525 100644
224275--- a/node_modules/expo-video/ios/VideoManager.swift
225276+++ b/node_modules/expo-video/ios/VideoManager.swift
226226-@@ -51,45 +51,45 @@ class VideoManager {
277277+@@ -12,6 +12,7 @@ class VideoManager {
278278+279279+ private var videoViews = NSHashTable<VideoView>.weakObjects()
280280+ private var videoPlayers = NSHashTable<VideoPlayer>.weakObjects()
281281++ private var previouslyPlayingPlayers: [VideoPlayer]?
282282+283283+ func register(videoPlayer: VideoPlayer) {
284284+ videoPlayers.add(videoPlayer)
285285+@@ -33,63 +34,70 @@ class VideoManager {
286286+ for videoPlayer in videoPlayers.allObjects {
287287+ videoPlayer.setTracksEnabled(true)
288288+ }
289289++
290290++ if let previouslyPlayingPlayers = self.previouslyPlayingPlayers {
291291++ previouslyPlayingPlayers.forEach { player in
292292++ player.pointer.play()
293293++ }
294294++ }
295295+ }
296296+297297+ func onAppBackgrounded() {
298298++ var previouslyPlayingPlayers: [VideoPlayer] = []
299299+ for videoView in videoViews.allObjects {
300300+ guard let player = videoView.player else {
301301+ continue
302302+ }
303303+- if player.staysActiveInBackground == true {
304304+- player.setTracksEnabled(videoView.isInPictureInPicture)
305305+- } else if !videoView.isInPictureInPicture {
306306++ if player.isPlaying {
307307+ player.pointer.pause()
308308++ previouslyPlayingPlayers.append(player)
309309+ }
310310+ }
311311++ self.previouslyPlayingPlayers = previouslyPlayingPlayers
312312+ }
313313+227314 // MARK: - Audio Session Management
228228-315315+229316 internal func setAppropriateAudioSessionOrWarn() {
230317- let audioSession = AVAudioSession.sharedInstance()
231318- var audioSessionCategoryOptions: AVAudioSession.CategoryOptions = []
+10-1
patches/expo-video+1.2.4.patch.md
···2233## `expo-video` Patch
4455-This patch adds two props to `VideoView`: `onEnterFullscreen` and `onExitFullscreen` which do exactly what they say on
55+### `onEnterFullScreen`/`onExitFullScreen`
66+Adds two props to `VideoView`: `onEnterFullscreen` and `onExitFullscreen` which do exactly what they say on
67the tin.
7899+### Removing audio session management
1010+811This patch also removes the audio session management that Expo does on its own, as we handle audio session management
912ourselves.
1313+1414+### Pausing/playing on background/foreground
1515+1616+Instead of handling the pausing/playing of videos in React, we'll handle them here. There's some logic that we do not
1717+need (around PIP mode) that we can remove, and just pause any playing players on background and then resume them on
1818+foreground.