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

This commit is contained in:
Jean-Baptiste Motto 2021-04-29 18:10:16 +02:00
parent 6bfd20ec87
commit a93bd48a3e
1 changed files with 2 additions and 1 deletions

View File

@ -3282,6 +3282,7 @@ tarteaucitron.services.youtube = {
video_height = x.getAttribute("height"), video_height = x.getAttribute("height"),
frame_height = 'height=', frame_height = 'height=',
video_frame, video_frame,
allowfullscreen = x.getAttribute("allowfullscreen"),
attrs = ["theme", "rel", "controls", "showinfo", "autoplay", "mute", "start"], attrs = ["theme", "rel", "controls", "showinfo", "autoplay", "mute", "start"],
params = attrs.filter(function (a) { params = attrs.filter(function (a) {
return x.getAttribute(a) !== null; return x.getAttribute(a) !== null;
@ -3302,7 +3303,7 @@ tarteaucitron.services.youtube = {
} else { } else {
frame_height += '"" '; 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; return video_frame;
}); });
}, },