3 final class PhabricatorVideoDocumentEngine
4 extends PhabricatorDocumentEngine
{
6 const ENGINEKEY
= 'video';
8 public function getViewAsLabel(PhabricatorDocumentRef
$ref) {
9 return pht('View as Video');
12 protected function getContentScore(PhabricatorDocumentRef
$ref) {
13 // Some video documents can be rendered as either video or audio, but we
14 // want to prefer video.
18 protected function getByteLengthLimit() {
22 protected function getDocumentIconIcon(PhabricatorDocumentRef
$ref) {
26 protected function canRenderDocumentType(PhabricatorDocumentRef
$ref) {
27 $file = $ref->getFile();
29 return $file->isVideo();
32 $viewable_types = PhabricatorEnv
::getEnvConfig('files.viewable-mime-types');
33 $viewable_types = array_keys($viewable_types);
35 $video_types = PhabricatorEnv
::getEnvConfig('files.video-mime-types');
36 $video_types = array_keys($video_types);
39 $ref->hasAnyMimeType($viewable_types) &&
40 $ref->hasAnyMimeType($video_types);
43 protected function newDocumentContent(PhabricatorDocumentRef
$ref) {
44 $file = $ref->getFile();
46 $source_uri = $file->getViewURI();
48 throw new PhutilMethodNotImplementedException();
51 $mime_type = $ref->getMimeType();
56 'controls' => 'controls',
65 $container = phutil_tag(
68 'class' => 'document-engine-video',