iOS set AudioTrack not working on Bitmovin SDK 3.27.0 and 3.28.0

Hello everyone,

I’ve updated iOS SDK to versions 3.27.0 and 3.28.0. The idea is to set one AudioTrack when the player is ready (I’ve even delayed 5 to 10 seconds).

After setting the AudioTrack:

  • I get current playing audio, I can see it is changing as expected. :white_check_mark:
  • However, the sound of the video is still the original version :x:

I’ve tried iPhone 7 (iOS 15.5) and iPhone 12 (iOS 16.0.2). Both of them have the same issue.

On Bitmvoin SDK version <3.26.0 is working fine.

Have anyone faced the same issue?

Thank you very much.

Hey,
thank you for reporting the issue.

I had a quick look at it but was not able to reproduce this on 3.28.0 and our internal test streams.

Could you maybe share additional information?

  • The stream you are using (if you can share it)
  • The exact setup of your onReady and how you access the audio track

Hi @davidsteinacher,
Thanks for your reply.

I would like to add more information that would help you to reproduce this issue. Unfortunately I won’t be able to provide any HLS stream link as ours are proprietary. Here is a sample of what we are dealing with:

#EXTM3U
#EXT-X-VERSION:7

# Audio
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio_aac",NAME="fra",LANGUAGE="fra",AUTOSELECT=YES,DEFAULT=YES,URI="audio/aac/fra/stream.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio_aac",NAME="eng",LANGUAGE="eng",AUTOSELECT=YES,URI="audio/aac/eng/stream.m3u8"

# Media Playlists
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=1465982,BANDWIDTH=2000101,CODECS="avc1.4D401F,mp4a.40.2",RESOLUTION=640x360,AUDIO="audio_aac",SUBTITLES="subtitles",CLOSED-CAPTIONS=NONE
media-1/stream.m3u8

# I-Frame Playlists
#EXT-X-I-FRAME-STREAM-INF:AVERAGE-BANDWIDTH=120922,BANDWIDTH=755759,CODECS="avc1.4D401F",RESOLUTION=640x360,URI="media-1/iframes.m3u8"

What is the regression?
The regression actually occurs when upgrading Bitmovin Player iOS SDK from version 3.26.0 to 3.27.0 (and still occurs on 3.28.0).

According to our investigation, the regression seems to be on the way AUTOSELECT attribute is handled inside HLS manifest.

Here is the definition from Apple documentation:

AUTOSELECT

(Optional) A string that indicates that the client may play the media selection in the absence of explicit user preference. Valid values are YES and NO. If the value of DEFAULT is YES, this value must also be YES.

In our case, we expect setting the audio track programmatically override the AUTOSELECT value.

How to reproduce this issue?

  1. Clone the latest Bitmovin iOS sample code from GitHub
  2. Select the scheme BasicPlayback and replace the HLS stream link with one like the example above
  3. Add a method at the bottom of ViewController.swift file to force audio track to French
  4. Switch the test device to English (this is a very important step)
  5. Run the project and play the content
func onReady(_ event: ReadyEvent, player: Player) {
    let audios: [AudioTrack] = player.availableAudio
    for audio in audios {
        if audio.language == "fra" {
            player.setAudio(trackIdentifier: audio.identifier)
        }
    }
    print("LOG - Current audio: \(player.audio?.language)")
}

Results

Expected

  • the following line is displayed on the console "LOG - Current audio: Optional("fra")"
  • The French audio track is played on the player

Actual

  • :white_check_mark: the following line is displayed on the console "LOG - Current audio: Optional("fra")"
  • :x: The English audio track is played on the player (it works on SDK 3.26.0, but not on 3.27.0 and 3.28.0)

Please let me know if you need more information.
Best regards,

Hi everyone,

Does anyone is facing the same issue or has been able to reproduce it? Or the only solution would be stay on version 3.26.0 of iOS Bitmovin Player SDK?
Thank you.

Best regards,