Skip to content

Commit c32a685

Browse files
Fixed video playing after being dismissed on iOS 17.1
1 parent 3606716 commit c32a685

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
33

44
# Upcoming
55

6-
### 🔄 Changed
6+
### 🐞 Fixed
7+
- Video playing after being dismissed on iOS 17.1
78

89
# [4.40.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.40.0)
910
_October 26, 2023_

Sources/StreamChatSwiftUI/ChatChannel/Gallery/VideoPlayerView.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public struct VideoPlayerView: View {
5151
try? AVAudioSession.sharedInstance().setCategory(.playback, options: [])
5252
avPlayer.play()
5353
}
54+
.onDisappear {
55+
avPlayer.replaceCurrentItem(with: nil)
56+
}
5457
}
5558
}
5659

0 commit comments

Comments
 (0)