fix: remove audioMix pre-install in playIndex - breaks HLS playback

Setting audioMix with MTAudioProcessingTap on HLS playerItem before
stream is ready blocks the audio pipeline entirely, preventing m3u8
streams from playing at all.

Revert to lazy install in startRecording() only.
This commit is contained in:
yumoqing 2026-06-28 15:21:10 +08:00
parent f68476d57f
commit 70337add95

View File

@ -186,9 +186,6 @@ final class PlayerBridge: ObservableObject {
let output = AVPlayerItemVideoOutput(pixelBufferAttributes: pixelBufferAttributes) let output = AVPlayerItemVideoOutput(pixelBufferAttributes: pixelBufferAttributes)
playerItem.add(output) playerItem.add(output)
videoOutput = output videoOutput = output
// 预装音频 Tap(在播放前设置 audioMix,避免播放中设置导致视频卡顿)
screenRecorder.installAudioTap(on: playerItem)
#endif #endif
player.replaceCurrentItem(with: playerItem) player.replaceCurrentItem(with: playerItem)