From: Matthias Schmidt Date: Fri, 18 Jan 2019 17:15:22 +0000 (+0100) Subject: Use video player for video attachments X-Git-Tag: 5.2.0_Alpha_1~356 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f6298605068faf5efd101740dd121a773498f292;p=GitHub%2FWoltLab%2FWCF.git Use video player for video attachments Close #2802 --- diff --git a/com.woltlab.wcf/templates/__videoAttachmentBBCode.tpl b/com.woltlab.wcf/templates/__videoAttachmentBBCode.tpl new file mode 100644 index 0000000000..da69480dbb --- /dev/null +++ b/com.woltlab.wcf/templates/__videoAttachmentBBCode.tpl @@ -0,0 +1,19 @@ + + +{$attachment->filename} + + diff --git a/wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php index d4a6c6e65d..89713b829e 100644 --- a/wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php @@ -3,6 +3,7 @@ namespace wcf\system\bbcode; use wcf\data\attachment\GroupedAttachmentList; use wcf\system\message\embedded\object\MessageEmbeddedObjectManager; use wcf\system\request\LinkHandler; +use wcf\system\WCF; use wcf\util\StringUtil; /** @@ -152,6 +153,12 @@ class AttachmentBBCode extends AbstractBBCode { return $result; } + else if (substr($attachment->fileType, 0, 6) === 'video/') { + return WCF::getTPL()->fetch('__videoAttachmentBBCode', 'wcf', [ + 'attachment' => $attachment, + 'attachmentIdentifier' => StringUtil::getRandomID() + ]); + } else { // file return StringUtil::getAnchorTag(LinkHandler::getInstance()->getLink('Attachment', [