Improve layout for embedded videos in ugc
authorjoshuaruesweg <ruesweg@woltlab.com>
Mon, 22 Jun 2020 15:20:12 +0000 (17:20 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Mon, 22 Jun 2020 15:21:15 +0000 (17:21 +0200)
Closes #3316

com.woltlab.wcf/templates/__videoAttachmentBBCode.tpl
wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php

index 41cc158f25165d7e3f4379c259b8577b054b4f98..95930a7a5b7fbbfdfd691b0f8dec672bdb6f7d26 100644 (file)
@@ -1,19 +1,7 @@
-<span id="attachmentVideo_{@$attachmentIdentifier}" class="videoContainer" style="display: none;">
+<span class="mediaBBCode">
        <video src="{$attachment->getLink()}" controls></video>
-</span>
-
-<a id="attachmentVideoLink_{@$attachmentIdentifier}" href="{$attachment->getLink()}">{$attachment->filename}</a>
-
-<script data-relocate="true">
-       {* try to determine if browser might be able to play video *}
-       var video = elById('attachmentVideo_{@$attachmentIdentifier}');
-       var canPlayType = elCreate('video').canPlayType('{$attachment->fileType}');
        
-       if (canPlayType === '') {
-               elRemove(video);
-       }
-       else {
-               elShow(video);
-               elRemove(elById('attachmentVideoLink_{@$attachmentIdentifier}'));
-       }
-</script>
+       <span class="mediaBBCodeCaption">
+               <a href="{$attachment->getLink()}">{$attachment->filename}</a>
+       </span>
+</span>
index ebaa30128c611fd29c7158c94335c9bb8821fe70..2b8e4cc73267098fde637e19b9fecddeaa66a5d3 100644 (file)
@@ -160,7 +160,6 @@ class AttachmentBBCode extends AbstractBBCode {
                        else if (substr($attachment->fileType, 0, 6) === 'video/' && $parser->getOutputType() == 'text/html') {
                                return WCF::getTPL()->fetch('__videoAttachmentBBCode', 'wcf', [
                                        'attachment' => $attachment,
-                                       'attachmentIdentifier' => StringUtil::getRandomID()
                                ]);
                        }
                        else {