3 final class PhabricatorAudioDocumentEngine
4 extends PhabricatorDocumentEngine
{
6 const ENGINEKEY
= 'audio';
8 public function getViewAsLabel(PhabricatorDocumentRef
$ref) {
9 return pht('View as Audio');
12 protected function getDocumentIconIcon(PhabricatorDocumentRef
$ref) {
13 return 'fa-file-sound-o';
16 protected function getByteLengthLimit() {
20 protected function canRenderDocumentType(PhabricatorDocumentRef
$ref) {
21 $file = $ref->getFile();
23 return $file->isAudio();
26 $viewable_types = PhabricatorEnv
::getEnvConfig('files.viewable-mime-types');
27 $viewable_types = array_keys($viewable_types);
29 $audio_types = PhabricatorEnv
::getEnvConfig('files.audio-mime-types');
30 $audio_types = array_keys($audio_types);
33 $ref->hasAnyMimeType($viewable_types) &&
34 $ref->hasAnyMimeType($audio_types);
37 protected function newDocumentContent(PhabricatorDocumentRef
$ref) {
38 $file = $ref->getFile();
40 $source_uri = $file->getViewURI();
42 throw new PhutilMethodNotImplementedException();
45 $mime_type = $ref->getMimeType();
50 'controls' => 'controls',
59 $container = phutil_tag(
62 'class' => 'document-engine-audio',