Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/document/PhabricatorVideoDocumentEngine.php
<?php | <?php | ||||
final class PhabricatorVideoDocumentEngine | final class PhabricatorVideoDocumentEngine | ||||
extends PhabricatorDocumentEngine { | extends PhabricatorDocumentEngine { | ||||
const ENGINEKEY = 'video'; | const ENGINEKEY = 'video'; | ||||
public function getViewAsLabel(PhabricatorDocumentRef $ref) { | public function getViewAsLabel(PhabricatorDocumentRef $ref) { | ||||
return pht('View as Video'); | return pht('View as Video'); | ||||
} | } | ||||
protected function getContentScore(PhabricatorDocumentRef $ref) { | |||||
// Some video documents can be rendered as either video or audio, but we | |||||
// want to prefer video. | |||||
return 2500; | |||||
} | |||||
protected function getByteLengthLimit() { | |||||
return null; | |||||
} | |||||
protected function getDocumentIconIcon(PhabricatorDocumentRef $ref) { | protected function getDocumentIconIcon(PhabricatorDocumentRef $ref) { | ||||
return 'fa-film'; | return 'fa-film'; | ||||
} | } | ||||
protected function canRenderDocumentType(PhabricatorDocumentRef $ref) { | protected function canRenderDocumentType(PhabricatorDocumentRef $ref) { | ||||
$file = $ref->getFile(); | $file = $ref->getFile(); | ||||
if ($file) { | if ($file) { | ||||
return $file->isVideo(); | return $file->isVideo(); | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |