Skip to content

Commit f25b9ec

Browse files
authored
Fix the video attachments now fetch the URL once on appear and pause when swiping to another item in the gallery. (#934)
* Fix the video attachments now fetch the URL once on appear and pause when swiping to another item in the gallery. * Resume playback once the video appears
1 parent 7833297 commit f25b9ec

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1111
- Show attachment title instead of URL in the `FileAttachmentPreview` view [#930](https://github.com/GetStream/stream-chat-swiftui/pull/930)
1212
- Fix overriding title color in `ChannelTitleView` [#931](https://github.com/GetStream/stream-chat-swiftui/pull/931)
1313
- Use channel capabilities for validating delete message action [#933](https://github.com/GetStream/stream-chat-swiftui/pull/933)
14+
- Fix the video attachments now fetch the URL once on appear and pause when swiping to another item in the gallery [#934](https://github.com/GetStream/stream-chat-swiftui/pull/934)
1415

1516
# [4.86.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.86.0)
1617
_August 21, 2025_

Sources/StreamChatSwiftUI/ChatChannel/Gallery/GalleryView.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ struct StreamVideoPlayer: View {
168168
}
169169
}
170170
.onAppear {
171+
guard avPlayer == nil else {
172+
avPlayer?.play()
173+
return
174+
}
171175
fileCDN.adjustedURL(for: url) { result in
172176
switch result {
173177
case let .success(url):
@@ -179,5 +183,8 @@ struct StreamVideoPlayer: View {
179183
}
180184
}
181185
}
186+
.onDisappear {
187+
avPlayer?.pause()
188+
}
182189
}
183190
}

0 commit comments

Comments
 (0)