Page MenuHomePhabricator

Omit "type" attribute from "<source />" tags in "<video>" to trick Chrome into playing them
ClosedPublic

Authored by epriestley on May 4 2018, 4:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 7:43 PM
Unknown Object (File)
Wed, Apr 10, 9:19 PM
Unknown Object (File)
Sun, Mar 31, 6:45 PM
Unknown Object (File)
Wed, Mar 27, 7:54 AM
Unknown Object (File)
Wed, Mar 27, 7:53 AM
Unknown Object (File)
Wed, Mar 27, 7:53 AM
Unknown Object (File)
Wed, Mar 27, 7:53 AM
Unknown Object (File)
Mar 12 2024, 7:03 AM
Subscribers
None

Details

Summary

Fixes T13135. See PHI633. For at least some video files with legitimate MIME type "video/quicktime", Chrome can play them but refuses to if the <source /> tag has a type="video/quicktime" attribute.

To trick Chrome into giving these videos the old college try, omit the "type" attribute. Chrome then tries to play the video, seems to realize it can, and we're back on track.

Since the "type" attribute is theoretically only useful to help browsers select among multiple different alternatives and we're only presenting one alternative, this seems likely safe and reasonable. Omitting "type" also validates. It's hard to be certain that this won't cause any collateral damage, but intuitively it seems like it should be safe and I wasn't able to identify any problems.

Test Plan
  • Watched a "video/quicktime" MP4 cat video in Chrome/Safari/Firefox.
  • See T13135 for discussion, context, and discussion of the behavior of some smaller reproduction cases.

Diff Detail

Repository
rP Phabricator
Branch
video1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 20274
Build 27520: Run Core Tests
Build 27519: arc lint + arc unit