Bug 245848

Summary: Playing a mobile web video from espn.com apex domain does not work on iOS16 mobile devices when launching full screen playback.
Product: WebKit Reporter: raymee.ferguson
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Critical CC: bfulgham, karlcow, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari 16   
Hardware: iPhone / iPad   
OS: iOS 16   

Description raymee.ferguson 2022-09-29 14:50:10 PDT
We’ve discovered an issue playing mobile web videos served from parent domain https://www. espn.com on an iPhone device running iOS16. Whenever we attempt to expand a playing video into full screen, the video expands for a brief moment but   immediately contracts out of full screen. 
 
We’ve done various validations and have ruled out our client code as well as our video provider (bright cove) client code.   Our findings have lead us to believe this defect is specific to our https://www.espn.com domain.  
 
To reproduce this defect:
- navigate to https://www.espn.com on an iPhone running iOS 16. 
- remain within the mobile web experience  
- find a video on the site
- initiate playback of the video
- post ad, and once the video is playing, click on the full-screen option 
 
You should see the video launch into full-screen mode but immediately retract in size.  Post these events the browser will become unstable and will eventually crash.  
 
This has been reproduced on iOS16 devices:
iPhone -13, 11 pro max, XS max
Browsers - Safari, Chrome
 
Below is the test we set up that leads us to reach out to Apple for help.
 
Below is a Brightcove test ruling out our front-end client code base.  It is a simple Html file with the Brightcove video player framed in.
https://www.espn.com/test/videos/bc.html 
 
To rule out Brightcove video player a similar Html file was created, but this time a YouTube video was embedded.
https://www.espn.com/test/videos/yt_video.html  
 
To further validate our working theory, running the same test against our QA domains works as expected.
https://www.espnqa.com/test/videos/bc.html?espn=cloud
Https://www.espnqa.com/test/videos/yt_video.html?espn=cloud

This has led us to believe that there is something specific to our apex domain and iOS16 and has resulted in this defect.

In digging through the git repo we stumbled across the following https://github.com/WebKit/WebKit/blob/249fdd9c0f8bf064190f69a2791917b762922bee/Source/WebCore/page/Quirks.cpp#L1516 it is not clear why this is needed but seems to be a likely culprit.
Comment 1 Karl Dubost 2022-09-29 19:28:19 PDT
Thanks for the detailed tests and bug report. First class.

The initial ESPN quirks has been added in Bug 223610


https://github.com/WebKit/WebKit/commit/3a87643e4d004cdbc7b9e4d08dece5e2f381078d#diff-9fb71b6fa7156160059b0216d05933e621d422df2b20f72ad7399eb946b8ba04R8-R13

> A video element entering picture-in-picture from fullscreen 
> will fire a "webkitendfullscreen" event since r266728, 
> but some sites (e.g., espn.com) do not handle the event properly.
> Because they assume the video will resume to inline after 
> exiting fullscreen.

> This patch enables the quirk for espn.com to disable firing
> "webkitendfullscreen" event in that scenario before they fix 
> the issue in the event handler.

Brent, is there a way to deactivate the Quirks on iOS for testing?
Comment 2 Radar WebKit Bug Importer 2022-09-29 19:28:31 PDT
<rdar://problem/100592994>
Comment 3 Karl Dubost 2022-09-29 19:49:55 PDT
with the Quirks on on both devices.

on iPhone 13, running iOS 16.1 on the ESPN website, I was not able to reproduce so far. 
on iPhone 13 Pro running iOS 16.0.2 I was able to reproduce.

so at least that's good news.
Comment 4 raymee.ferguson 2022-10-03 09:01:32 PDT
To help set expectations, are any course of action being considered outside of iOS 16.1 being released to the public?
Comment 5 Karl Dubost 2022-10-03 22:23:34 PDT
Hi Raymee,
Trying to figure this out.
Comment 6 raymee.ferguson 2022-10-10 09:05:30 PDT
Hi, Karl are there any new updates?
Comment 7 Karl Dubost 2022-10-11 17:55:39 PDT
Raymee, thanks for your patience,

Could you check if the public beta of iOS 16 fixed it for you too?
https://beta.apple.com/sp/en/betaprogram/
That would be great.
Comment 8 raymee.ferguson 2022-10-12 11:26:03 PDT
Thank you Karl!  We will take a look and report back
Comment 9 raymee.ferguson 2022-10-14 07:54:18 PDT
Hi Karl, we were able to confirm that it now works! When will it be available to the public?
Comment 10 Karl Dubost 2022-10-16 19:11:18 PDT
Apple doesn't pre-announce when releases will be available.
but the fix is in the public beta, so probably not too long.