From b15c746d5b2b197d6d7b5ae55d85d494936c5351 Mon Sep 17 00:00:00 2001 From: martinmitrevski Date: Mon, 25 Sep 2023 16:19:12 +0200 Subject: [PATCH] Play audio in videos when in silent mode --- CHANGELOG.md | 3 +++ .../ChatChannel/Gallery/VideoPlayerView.swift | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 370b3b72..6ef4a608 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### ✅ Added - Config for changing supported media types in the composer +### 🐞 Fixed +- Play audio in videos when in silent mode + # [4.37.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.37.0) _September 18, 2023_ diff --git a/Sources/StreamChatSwiftUI/ChatChannel/Gallery/VideoPlayerView.swift b/Sources/StreamChatSwiftUI/ChatChannel/Gallery/VideoPlayerView.swift index 8574d39d..7e86c66b 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/Gallery/VideoPlayerView.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/Gallery/VideoPlayerView.swift @@ -48,6 +48,7 @@ public struct VideoPlayerView: View { .foregroundColor(Color(colors.text)) } .onAppear { + try? AVAudioSession.sharedInstance().setCategory(.playback, options: []) avPlayer.play() } }