Ver código fonte

Add allowfullscreen param to youtube service. Default value is allowed.

Jean-Baptiste Motto 4 anos atrás
pai
commit
a93bd48a3e
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      tarteaucitron.services.js

+ 2 - 1
tarteaucitron.services.js

@@ -3282,6 +3282,7 @@ tarteaucitron.services.youtube = {
                 video_height = x.getAttribute("height"),
                 frame_height = 'height=',
                 video_frame,
+                allowfullscreen = x.getAttribute("allowfullscreen"),
                 attrs = ["theme", "rel", "controls", "showinfo", "autoplay", "mute", "start"],
                 params = attrs.filter(function (a) {
                   return x.getAttribute(a) !== null;
@@ -3302,7 +3303,7 @@ tarteaucitron.services.youtube = {
             } else {
                 frame_height += '"" ';
             }
-            video_frame = '<iframe title="' + frame_title + '" type="text/html" ' + frame_width + frame_height + ' src="//www.youtube-nocookie.com/embed/' + video_id + '?' + params + '" allowfullscreen></iframe>';
+            video_frame = '<iframe title="' + frame_title + '" type="text/html" ' + frame_width + frame_height + ' src="//www.youtube-nocookie.com/embed/' + video_id + '?' + params + '"' + (allowfullscreen == '0' ? '' : ' allowfullscreen') + '></iframe>';
             return video_frame;
         });
     },