mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-05 19:28:46 +02:00
Fix: ensure audio session allows AirPlay routing during media playback
The audio session category options include .allowBluetoothA2DP for certain playback types but omit .allowAirPlay, preventing proper AirPlay audio routing during media playback. This adds .allowAirPlay to the .play and .playWithPossiblePortOverride session types for consistency with other wireless audio routing options. Also explicitly sets allowsExternalPlayback = true on AVPlayer instances in PlatformVideoContent and SystemVideoContent to document external playback intent and prevent potential regressions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
be6c32ef9c
commit
5314c6c4d4
3 changed files with 4 additions and 0 deletions
|
|
@ -866,12 +866,14 @@ public final class ManagedAudioSessionImpl: NSObject, ManagedAudioSession {
|
|||
if mixWithOthers {
|
||||
options.insert(.mixWithOthers)
|
||||
}
|
||||
options.insert(.allowAirPlay)
|
||||
case .ambient:
|
||||
options.insert(.mixWithOthers)
|
||||
case .playWithPossiblePortOverride:
|
||||
if case .playAndRecord = nativeCategory {
|
||||
options.insert(.allowBluetoothA2DP)
|
||||
}
|
||||
options.insert(.allowAirPlay)
|
||||
case .voiceCall, .videoCall:
|
||||
#if canImport(AlarmKit) //Xcode 26
|
||||
options.insert(.allowBluetoothHFP)
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@ private final class PlatformVideoContentNode: ASDisplayNode, UniversalVideoConte
|
|||
self.imageNode = TransformImageNode()
|
||||
|
||||
let player = AVPlayer(playerItem: nil)
|
||||
player.allowsExternalPlayback = true
|
||||
self.player = player
|
||||
|
||||
self.playerNode = ASDisplayNode()
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ private final class SystemVideoContentNode: ASDisplayNode, UniversalVideoContent
|
|||
|
||||
self.playerItem = AVPlayerItem(url: URL(string: url)!)
|
||||
let player = AVPlayer(playerItem: self.playerItem)
|
||||
player.allowsExternalPlayback = true
|
||||
self.player = player
|
||||
|
||||
self.playerNode = ASDisplayNode()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue