Bug 270772

Summary: REGRESSION (iOS 17.4): HTMLMediaElement#load() doesn't trigger some events for blob URLs
Product: WebKit Reporter: Gustavo H <guhenke>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, brad, jean-yves.avenard, webkit-bug-importer, xidorn-webkit
Priority: P2 Keywords: CanvaBug, InRadar
Version: Safari 17   
Hardware: iPhone / iPad   
OS: iOS 17   
See Also: https://bugs.webkit.org/show_bug.cgi?id=245428
https://bugs.webkit.org/show_bug.cgi?id=272502

Description Gustavo H 2024-03-10 16:58:08 PDT
On iOS 17.4, calling load() on a media element whose src property is set to a blob URL created by URL.createObjectURL() doesn't trigger some events.
The issue does not occur when src is set to an HTTP URL.

Steps to reproduce:
1. On iOS 17.4 Safari, access https://codepen.io/gustavohenke/pen/KKYzqYr
2. Using the file selector, select a video file on the device. Observe that the log only goes up to loadedmetadata.
3. Play the video. Notice that the log now contains play, waiting, loadeddata, etc.
4. Click "Load Big Buck Bunny". Observe that the log contains loadeddata, canplay, etc just from the call to load()

Expected result:
The media element behaves the same with both HTTP and blob URLs

Actual result:
The media element doesn't fire loadeddata, canplay and canplaythrough events
Comment 1 Alexey Proskuryakov 2024-03-11 14:51:50 PDT
Thank you for the report! Do you happen to know if this worked prior to iOS 17.4?
Comment 2 Gustavo H 2024-03-11 14:58:12 PDT
Yes, seems to be working on iOS 17.3.1.
Comment 3 Radar WebKit Bug Importer 2024-03-11 15:26:11 PDT
<rdar://problem/124411454>
Comment 4 Jean-Yves Avenard [:jya] 2024-04-01 19:39:40 PDT
It is very doubtful that loading via a blob url worked before 17.4. 

We only just added support to blob url playback in the last month or so to the WebKit tree.

*** This bug has been marked as a duplicate of bug 245428 ***
Comment 5 Gustavo H 2024-04-01 21:43:02 PDT
It's how we've been doing some operations/assertions on videos uploaded to canva.com for about 5 years.