Fix leaking globals
authorjoshuaruesweg <ruesweg@woltlab.com>
Wed, 24 Jun 2020 19:26:26 +0000 (21:26 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Wed, 24 Jun 2020 19:26:26 +0000 (21:26 +0200)
com.woltlab.wcf/templates/__videoAttachmentBBCode.tpl

index 10b5fbbd37becec964a59d870d3663cddc47b3e2..2521c6c5681f0a04068dc129af27297e2e3c6936 100644 (file)
@@ -7,14 +7,16 @@
 </span>
 
 <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);
-       }
+       (function () {
+               {* try to determine if browser might be able to play video *}
+               var video = elById('attachmentVideo_{@$attachmentIdentifier}');
+               var canPlayType = video.canPlayType('{$attachment->fileType}');
+               
+               if (canPlayType === '') {
+                       elRemove(video);
+               }
+               else {
+                       elShow(video);
+               }
+       })();
 </script>