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
F15539281: D19424.diff
Fri, Apr 25, 12:27 AM
F15524071: D19424.id46465.diff
Mon, Apr 21, 5:45 AM
F15521038: D19424.id46464.diff
Sun, Apr 20, 10:31 AM
F15515237: D19424.diff
Fri, Apr 18, 8:53 AM
F15508914: D19424.id46464.diff
Wed, Apr 16, 7:13 AM
F15429639: D19424.id46465.diff
Mar 24 2025, 3:26 AM
F15419522: D19424.id46465.diff
Mar 21 2025, 6:44 AM
F15418081: D19424.id.diff
Mar 20 2025, 8:46 PM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable