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?
- Clone the latest Bitmovin iOS sample code from GitHub
- Select the scheme
BasicPlayback
and replace the HLS stream link with one like the example above
- Add a method at the bottom of
ViewController.swift
file to force audio track to French
- Switch the test device to English (this is a very important step)
- 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
the following line is displayed on the console "LOG - Current audio: Optional("fra")"
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,