Skip to content

setCodecPreferences() does not work on Android #1946

@Oliver-Zimmerman

Description

@Oliver-Zimmerman

Describe the bug
Calling

await audioTransceiver.setCodecPreferences(codecCapabilities);

Works on iOS and Web, and the resulting SDP after setting codec preferences will only include the desired codecs. However, on Android, the SDP that is generated for an offer always contains all of the available codecs.

This is a minor bug because a workaround is to SDP munge on the Android platform, however it would be nice to not have to do a platform check.

To Reproduce
Call

await audioTransceiver.setCodecPreferences(codecCapabilities);

with a single codec selected, and generate an offer. The SDP that is generated will always contain all available codecs

Expected behavior
Like on Web and iOS, only the preferred codecs should appear on the generated SDP.

Platform information
[✓] Flutter (Channel stable, 3.35.6, on macOS 15.1.1 24B91 darwin-arm64, locale en-UK)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2025.1)
[✓] VS Code (version 1.103.1)
[✓] VS Code (version unknown)
✗ Unable to determine VS Code version.
[✓] Connected device (5 available)
[✓] Network resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions