iOS/tvOS SDK 3.27.0 and later cannot play our HLS streams (SourceError)

We cannot play any HLS content in our tvOS app using SDK 3.27.0 or newer (the last SDK that works is 3.26.0). Instead of starting playback, the player calls onSourceError method of PlayerListener immediately after initialization. The SourceError does not contain any additional information. Here is the sample of our HLS manifest:

#EXTM3U
#EXT-X-VERSION:2
## Created with Unified Streaming Platform(version=1.7.32)

# variants
#EXT-X-STREAM-INF:BANDWIDTH=1013000,CODECS="mp4a.40.2,avc1.4D401F",RESOLUTION=704x396,FRAME-RATE=25
vf_m001frvc_13ec3142-fc88-4a22-aa13-9f65e00b0884.ism.hlsv2-audio_eng_1=128000-video=827000.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1800000,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=704x396,FRAME-RATE=50
vf_m001frvc_13ec3142-fc88-4a22-aa13-9f65e00b0884.ism.hlsv2-audio_eng_1=128000-video=1570000.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=3117000,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=960x540,FRAME-RATE=50
vf_m001frvc_13ec3142-fc88-4a22-aa13-9f65e00b0884.ism.hlsv2-audio_eng_1=128000-video=2812000.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=5510000,CODECS="mp4a.40.2,avc1.640020",RESOLUTION=1280x720,FRAME-RATE=50
vf_m001frvc_13ec3142-fc88-4a22-aa13-9f65e00b0884.ism.hlsv2-audio_eng_1=128000-video=5070000.m3u8

I am also attaching the stack trace of the moment when onSourceError is called by SDK 3.34.0.

Thanks a lot for your support

Hey @milan.moucka,
So older player versions (e.g. 3.26.0) work fine with this stream?

From just the multivariant playlist, it’s hard to say what the problem is. The only thing I noticed from this is that this stream uses EXT-X-VERSION:2, which is very old version of HLS. Is there a technical reason you’re using that? Unified Streaming should be able to easily provide newer versions as well.

Is it possible for you to provide a link to this stream in order to runs some tests? If you don’t want to or can’t share it publicly, feel free to send me a direct message with it.

Hi @daniel,

thanks a lot for your response.

We also checked these two streams:
https://vs-hls-pushb-ww.live.cf.md.bbci.co.uk/x=3/i=urn:bbc:pips:service:bbc_persian_tv/pc_hd_abr_v2.m3u8
it uses version 3 and
http://vs-hls-pushb-ww.live.cf.md.bbci.co.uk/x=3/i=urn:bbc:pips:service:bbc_persian_tv/pc_hd_abr_v2.m3u8

Both URLs cannot be played in Bitmovin 3.27.0 and newer but can be played in Bitmovin 3.26.0.

If you need additional information about something, I can provide.

Thanks a lot

Hi @milan.moucka,

I tested and could play both streams just fine with Bitmovin Player 3.27.0 as well as with the latest 3.34.1 on tvOS. A note for these second URL: you might need to change http: to https: in order to play it.

Can you please test if you are able to play those two streams in bitmovin-player-ios-samples/BasicPlaybackTV at main · bitmovin/bitmovin-player-ios-samples · GitHub to rule out any app integration issue?

Which tvOS version are you testing on?

Hi @daniel

Thank you for sharing the link to the sample app with sample HLS stream. We noticed that we are unable to play any HLS stream in our app (tested on tvOS 16.1).
The cause was found in reading the duration property of the AVURLAsset of the currently played item. In SDK 3.27.0 and later accessing AVAsset.duration property freezes the app for a few seconds and then we get SourceError mentioned earlier. For your information, we read the duration of AVURLAsset when _BMPAVPlayer.status (observed using KVO) changes to .readyToPlay .

We will fix the issue on our side.

Once again. Thank you :blush:

Hi @milan.moucka,
Glad you could figure it out.

However, I wanted to highlight that we strongly discourage using or accessing the Bitmovin Player’s underlying AVPlayer instance directly. This isn’t a supported use case and can lead to many unforeseen side effects (like the one you just encountered)! Access to it might also be removed completely in the future, without further notice.

Please use the Bitmovin Player’s API instead, you can find the API reference here: Bitmovin Docs - Player iOS SDK API Reference v3
For example, you can get the duration of a source from Source.duration. If you find any information missing from the Bitmovin Player API, please do let us know!