Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Audio routes through call speaker instead of media speaker when joining as a viewer-only participant

未关闭
#1,063 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
flutter

调研方向

Start by reading the audio-routing setup around RoomOptions and Hardware.instance, then trace how the SDK handles audio sessions on Android and iOS when a viewer joins without publishing tracks. The issue does not name files or tests, so first locate those entry points and relevant platform tests. Done means receive-only participants use media playback routing without breaking audio for participants who publish tracks.

由索引模型根据 Issue 内容生成。

描述

Is your feature request related to a problem? Please describe.
When joining a livestream session as a pure viewer (no microphone, no camera), the audio is incorrectly routed through the device's call/earpiece speaker instead of the media/loudspeaker — the same routing used for phone calls.

This occurs even though the viewer is not publishing any audio or video track. The expected behavior is that a participant in a receive-only role should use media playback audio routing, consistent with how any video player or media app behaves. Instead, LiveKit appears to initialize WebRTC in MODE_IN_COMMUNICATION (Android) / AVAudioSessionCategory.playAndRecord (iOS) regardless of whether the local participant is actually publishing.

Describe the solution you'd like
When a participant joins with no published tracks (viewer-only / subscriber-only role), LiveKit should automatically apply media playback audio routing:

• Android: Use AudioManager.MODE_NORMAL with loudspeaker, not MODE_IN_COMMUNICATION
• iOS: Use AVAudioSessionCategory.playback instead of playAndRecord

Ideally, expose a participant role hint (e.g. ParticipantKind.viewer or a audioMode option in RoomOptions) so developers can explicitly declare the intended audio routing behavior at connection time, before WebRTC initializes the audio session.

Describe alternatives you've considered
• Calling Hardware.instance.setSpeakerphoneOn(true) before room.connect() — overridden internally when WebRTC initializes the audio session on first track subscription.

• Manually reconfiguring AudioSession after the first remote audio track is subscribed — partially works but requires a delay and is fragile, as LiveKit re-acquires the audio session asynchronously.

• Using AudioOutputOptions(speakerOn: true) in RoomOptions — does not change the underlying audio mode from communication to media playback.

Additional context
• SDK: livekit_client (Flutter)
• Platforms affected: Android & iOS
• Use case: Livestreaming with a single host and many viewer-only participants
• Root cause: WebRTC initializes the audio stack in voice communication mode unconditionally, even for receive-only participants. This is by design in WebRTC but should be overridden by LiveKit when no local tracks are published.

主要语言
Dart
星标
421
派生
260
平均合并
3 天 9 小时
30 天内合并 PR
11

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

livekit/client-sdk-flutter 的其他 Issue

查看 livekit/client-sdk-flutter 的全部 Issue

相似的 Issue

更多 Dart Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。