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

**URL:** <https://community.bitmovin.com/t/ios-tvos-sdk-3-27-0-and-later-cannot-play-our-hls-streams-sourceerror/1659>\
**Category:** Support\
**Tags:** bitmovin, apple-tv\
**Created:** [January 27, 2023, 2:39pm UTC](https://community.bitmovin.com/t/ios-tvos-sdk-3-27-0-and-later-cannot-play-our-hls-streams-sourceerror/1659 "2023-01-27T14:39:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![milan.moucka](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@milan.moucka](https://community.bitmovin.com/u/milan.moucka)\
**Post date:** [January 27, 2023, 2:39pm UTC](https://community.bitmovin.com/t/ios-tvos-sdk-3-27-0-and-later-cannot-play-our-hls-streams-sourceerror/1659/1 "2023-01-27T14:39:44Z")

</div>

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:

```auto
#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.

 ![bitmovin-ios-3.34.0-stacktrace](https://us1.discourse-cdn.com/flex015/uploads/bitmovin/original/1X/a41262fca3905aab7e957b5db545f40bb4d33d33.png)

Thanks a lot for your support

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/daniel/32/121_2.png) [@daniel](https://community.bitmovin.com/u/daniel)\
**Post date:** [January 30, 2023, 7:44am UTC](https://community.bitmovin.com/t/ios-tvos-sdk-3-27-0-and-later-cannot-play-our-hls-streams-sourceerror/1659/2 "2023-01-30T07:44:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![milan.moucka](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@milan.moucka](https://community.bitmovin.com/u/milan.moucka)\
**Post date:** [January 30, 2023, 10:22am UTC](https://community.bitmovin.com/t/ios-tvos-sdk-3-27-0-and-later-cannot-play-our-hls-streams-sourceerror/1659/3 "2023-01-30T10:22:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/daniel/32/121_2.png) [@daniel](https://community.bitmovin.com/u/daniel)\
**Post date:** [January 31, 2023, 8:09am UTC](https://community.bitmovin.com/t/ios-tvos-sdk-3-27-0-and-later-cannot-play-our-hls-streams-sourceerror/1659/4 "2023-01-31T08:09:48Z")

</div>

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](https://github.com/bitmovin/bitmovin-player-ios-samples/tree/main/BasicPlaybackTV) to rule out any app integration issue?

Which tvOS version are you testing on?

---

<div class="post-metadata">

**Author:** ![milan.moucka](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@milan.moucka](https://community.bitmovin.com/u/milan.moucka)\
**Post date:** [February 2, 2023, 4:51pm UTC](https://community.bitmovin.com/t/ios-tvos-sdk-3-27-0-and-later-cannot-play-our-hls-streams-sourceerror/1659/5 "2023-02-02T16:51:52Z")

</div>

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 😊

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/daniel/32/121_2.png) [@daniel](https://community.bitmovin.com/u/daniel)\
**Post date:** [February 2, 2023, 6:46pm UTC](https://community.bitmovin.com/t/ios-tvos-sdk-3-27-0-and-later-cannot-play-our-hls-streams-sourceerror/1659/6 "2023-02-02T18:46:36Z")

</div>

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](https://bitmovin.com/docs/player/api-reference/ios/ios-sdk-api-reference-v3#/player/ios/3/docs/index.html)  
For example, you can get the duration of a source from [Source.duration](https://bitmovin.com/docs/player/api-reference/ios/ios-sdk-api-reference-v3#/player/ios/3/docs/Protocols/Source.html#/c:@M@BitmovinPlayer@objc(pl)BMPSource(py)duration). If you find any information missing from the Bitmovin Player API, please do let us know!
