Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
| Show First 20 Lines • Show All 254 Lines • ▼ Show 20 Lines | private function renderMediaFile( | ||||
| } | } | ||||
| // Rendering contexts like feed can disable autoplay. | // Rendering contexts like feed can disable autoplay. | ||||
| $engine = $this->getEngine(); | $engine = $this->getEngine(); | ||||
| if ($engine->getConfig('autoplay.disable')) { | if ($engine->getConfig('autoplay.disable')) { | ||||
| $autoplay = null; | $autoplay = null; | ||||
| } | } | ||||
| if ($is_video) { | |||||
| // See T13135. Chrome refuses to play videos with type "video/quicktime", | |||||
| // even though it may actually be able to play them. The least awful fix | |||||
| // based on available information is to simply omit the "type" attribute | |||||
| // from `<source />` tags. This causes Chrome to try to play the video | |||||
| // and realize it can, and does not appear to produce any bad behavior in | |||||
| // any other browser. | |||||
| $mime_type = null; | |||||
| } else { | |||||
| $mime_type = $file->getMimeType(); | |||||
| } | |||||
| return $this->newTag( | return $this->newTag( | ||||
| $tag, | $tag, | ||||
| array( | array( | ||||
| 'controls' => 'controls', | 'controls' => 'controls', | ||||
| 'preload' => $preload, | 'preload' => $preload, | ||||
| 'autoplay' => $autoplay, | 'autoplay' => $autoplay, | ||||
| 'loop' => idx($options, 'loop') ? 'loop' : null, | 'loop' => idx($options, 'loop') ? 'loop' : null, | ||||
| 'alt' => $options['alt'], | 'alt' => $options['alt'], | ||||
| 'class' => 'phabricator-media', | 'class' => 'phabricator-media', | ||||
| ), | ), | ||||
| $this->newTag( | $this->newTag( | ||||
| 'source', | 'source', | ||||
| array( | array( | ||||
| 'src' => $file->getBestURI(), | 'src' => $file->getBestURI(), | ||||
| 'type' => $file->getMimeType(), | 'type' => $mime_type, | ||||
| ))); | ))); | ||||
| } | } | ||||
| private function renderFileLink( | private function renderFileLink( | ||||
| PhabricatorFile $file, | PhabricatorFile $file, | ||||
| PhabricatorObjectHandle $handle, | PhabricatorObjectHandle $handle, | ||||
| array $options) { | array $options) { | ||||
| Show All 22 Lines | |||||