Bug 190831
Summary: | JavaScript does not throw error when video tag has attributes `autoplay`, `muted`, and `controls` on all iOS 12 iPhone/iPad devices except iPhone X | ||
---|---|---|---|
Product: | WebKit | Reporter: | zack.honig |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Major | CC: | cdumez, jer.noble, webkit-bug-importer |
Priority: | P2 | Keywords: | HTML5, InRadar |
Version: | Safari 12 | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 12 | ||
URL: | https://www.w3schools.com/code/tryit.asp?filename=FWIV6SAKAGJ1 |
zack.honig
Autoplay does not require attributes `autoplay`, `muted`, and `controls` in video tag on all iOS 12 iPhone/iPad devices except iPhone X
*On iPhone X iOS 12.0.1 in Safari*
- Expected results: When the user loads page, the video should autoplay with no sound
- Actual results: When the user loads page, the video does not autoplay. To play the video, the user has to click the play button
The provided example below illustrates the issue:
<video autoplay muted playsinline src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"></video>
Example below does not work on iPhone X iOS 12.0.1. It works on all other iPhones and iPads with iOS 12.0.1:
https://www.w3schools.com/code/tryit.asp?filename=FWIM1IVFJ40D
Example below works on all iPhones and iPads with iOS 12.0.1:
https://www.w3schools.com/code/tryit.asp?filename=FWIM1WBOG7K7
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
zack.honig
Updated example below illustrates the issue:
<video autoplay controls playsinline src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"></video>
Example below does not work on iPhone X iOS 12.0.1. It works on all other iPhones and iPads with iOS 12.0.1:
https://www.w3schools.com/code/tryit.asp?filename=FWIO84TGHS8Y
zack.honig
Example below illustrates that JavaScript will throw an error in the catch clause unless the video tag has attributes `autoplay`, `muted`, and `controls`:
https://www.w3schools.com/code/tryit.asp?filename=FWIV6SAKAGJ1
Radar WebKit Bug Importer
<rdar://problem/45510906>
Jer Noble
"autoplay" and "controls" are not relevant. We don't check that property in the play() promise. "playsinline" and "muted" are required.
I can't reproduce this behavior on my own iPhone Xs; Zack, does the movie play properly when you press the play button in the native controls? That would help eliminate the possibility that your test case is hitting a networking error.
zack.honig
@jer, if you click the "Run >>" button on https://www.w3schools.com/code/tryit.asp?filename=FWIV6SAKAGJ1 on Safari browser, then the alert message "inner autoplay failed" pops up. Note that the video still plays via JavaScript even though the catch exception was thrown in this case. However, there could be another case where autoplay is aborted if the catch exception is thrown.
The link is using required attributes "playsinline" and "muted" attributes.