Bug 201068 - iOS 13 beta: HLS not loading the fragments from the redirected url
Summary: iOS 13 beta: HLS not loading the fragments from the redirected url
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Other
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-08-23 03:00 PDT by Massimiliano Mura
Modified: 2019-09-13 20:39 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Massimiliano Mura 2019-08-23 03:00:32 PDT
This bug has been reproduced on different iPhone models running iOS13 beta.

Once asked for a manifest, HLS does not follow the redirects and tries to download the fragments using relatives urls of original manifest.
Comment 1 Lloyd Wallis 2019-08-23 03:29:42 PDT
Steps to reproduce:

1. Visit https://open.live.bbc.co.uk/mediaselector/6/select/version/2.0/mediaset/mobile-phone-main/vpid/p07lbzz4/format/xml/transferformat/hls/proto/http, and select the m3u8 path with supplier="mf_limelight". This URL is valid for a few hours.
2. Create a simple web page with a <video> element pointing to this playback URL
3. Attempt to play the media, recording the HTTP requests made by the device

Expected behaviour:

The client observers a HTTP 302 response is returned when requesting the m3u8 object. The base URL used for resolving relative URLs is updated to be this final destination path rather than the original request.

Actual behaviour:

The client uses the originating request path to make all subsequent requests. This results in each request for a media segment requiring two HTTP requests, a 302 followed by a 200. This adds unnecessary request latency to the client and additional load on the origin servers.

Additional information:
If you follow step 1 in the UK, and instead select mf_bidi's connection, you will see that this CDN does not support segment requests on the originating domain, and the subsequent requests fail with a HTTP 400 response. This is silently absorbed by the client, resulting in bug 201069.
Comment 2 Alexey Proskuryakov 2019-08-23 16:02:41 PDT
> 1. Visit https://open.live.bbc.co.uk/mediaselector/6/select/version/2.0/mediaset/mobile-phone-main/vpid/p07lbzz4/format/xml/transferformat/hls/proto/http, and select the m3u8 path with supplier="mf_limelight". This URL is valid for a few hours.

I'm getting a blank page now.
Comment 3 Radar WebKit Bug Importer 2019-08-23 16:02:57 PDT
<rdar://problem/54658551>
Comment 4 Lloyd Wallis 2019-08-27 03:40:14 PDT
The (In reply to Alexey Proskuryakov from comment #2)
> > 1. Visit https://open.live.bbc.co.uk/mediaselector/6/select/version/2.0/mediaset/mobile-phone-main/vpid/p07lbzz4/format/xml/transferformat/hls/proto/http, and select the m3u8 path with supplier="mf_limelight". This URL is valid for a few hours.
> 
> I'm getting a blank page now.

That URL returns an XML document, and I find some FF Addons (specifically privacy blockers) cause a blank page to be rendered instead when enabled. Is it possible you're using one of those?
Comment 5 Alexey Proskuryakov 2019-08-27 08:58:00 PDT
No, I don't have any content blockers installed.

When you say "visit", do you mean tapping on this URL in MobileSafari?
Comment 6 Lloyd Wallis 2019-08-27 09:08:37 PDT
(In reply to Alexey Proskuryakov from comment #5)
> No, I don't have any content blockers installed.
> 
> When you say "visit", do you mean tapping on this URL in MobileSafari?

I'm using a desktop browser at this point of the instructions - I should have been clearer that only step 3 would then be done on an iOS 13 device.

1. Load https://open.live.bbc.co.uk/mediaselector/6/select/version/2.0/mediaset/mobile-phone-main/vpid/p07lbzz4/format/xml/transferformat/hls/proto/http, and in the XML response, select and note the m3u8 path with supplier="mf_limelight", e.g. http://vod-hls-ww-live.bbcfmt.hs.llnwd.net/usp/auth/vod/piff_abr_full_sd/7ddaf6-p07lbzz4/vf_p07lbzz4_644dabbd-9e95-45e6-ae0d-ec165cc4429f.ism/mobile_wifi_main_sd_abr_v2_hls_master.m3u8?s=1566900007&e=1566943207&h=c1990dbe80d715c8c317e88c9740dcf6

This second URL is time limited, but the first will enable you to generate new access tokens.

2. Create a simple web page with a <video> element pointing to this playback URL. Using the example above, this would look like https://wallil51-pub.s3.eu-west-2.amazonaws.com/wk201068.html.

3. On a device running iOS 13 beta, load this test page (e.g. https://wallil51-pub.s3.eu-west-2.amazonaws.com/wk201068.html), and attempt to play the media