Merge pull request #360 from nstCactus/master

Add support for all Vimeo embed options
This commit is contained in:
Amauri CHAMPEAUX 2019-09-20 19:02:40 +02:00 committed by GitHub
commit 8d8e0cc6b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 107 additions and 25 deletions

View File

@ -1936,16 +1936,28 @@ tarteaucitron.services.vimeo = {
"js": function () {
"use strict";
tarteaucitron.fallback(['vimeo_player'], function (x) {
var video_id = x.getAttribute("videoID"),
video_width = x.getAttribute("width"),
var video_width = x.getAttribute("data-width") || x.getAttribute("width"),
frame_width = 'width=',
video_height = x.getAttribute("height"),
video_height = x.getAttribute("data-height") || x.getAttribute("height"),
frame_height = 'height=',
video_title = x.getAttribute("title") || '',
video_byline = x.getAttribute("byline") || '',
video_portrait = x.getAttribute("portrait") || '',
video_loop = x.getAttribute("loop") || '',
video_autoplay = x.getAttribute("autoplay") || '',
video_id = x.getAttribute("data-videoID") || x.getAttribute("videoID"),
video_autopause = x.getAttribute("data-autopause") || '',
video_autoplay = x.getAttribute("data-autoplay") || x.getAttribute("autoplay") || '',
video_background = x.getAttribute("data-background") || '',
video_byline = x.getAttribute("data-byline") || x.getAttribute("byline") || '',
video_color = x.getAttribute("data-color") || '',
video_controls = x.getAttribute("data-controls") || '',
video_loop = x.getAttribute("data-loop") || x.getAttribute("loop") || '',
video_maxheight = x.getAttribute("data-maxheight") || '',
video_maxwidth = x.getAttribute("data-maxwidth") || '',
video_muted = x.getAttribute("data-muted") || '',
video_playsinline = x.getAttribute("data-playsinline") || '',
video_portrait = x.getAttribute("data-portrait") || x.getAttribute("portrait") || '',
video_speed = x.getAttribute("data-speed") || '',
video_title = x.getAttribute("data-title") || x.getAttribute("title") || '',
video_transparent = x.getAttribute("data-transparent") || '',
video_frame;
var video_qs = '';
@ -2000,6 +2012,76 @@ tarteaucitron.services.vimeo = {
video_qs += "autoplay=" + video_autoplay;
}
if (video_autopause.length > 0) {
if (video_qs.length > 1) {
video_qs += "&";
}
video_qs += "autopause=" + video_autopause;
}
if (video_background.length > 0) {
if (video_qs.length > 1) {
video_qs += "&";
}
video_qs += "background=" + video_background;
}
if (video_color.length > 0) {
if (video_qs.length > 1) {
video_qs += "&";
}
video_qs += "color=" + video_color;
}
if (video_controls.length > 0) {
if (video_qs.length > 1) {
video_qs += "&";
}
video_qs += "controls=" + video_controls;
}
if (video_maxheight.length > 0) {
if (video_qs.length > 1) {
video_qs += "&";
}
video_qs += "maxheight=" + video_maxheight;
}
if (video_maxwidth.length > 0) {
if (video_qs.length > 1) {
video_qs += "&";
}
video_qs += "maxwidth=" + video_maxwidth;
}
if (video_muted.length > 0) {
if (video_qs.length > 1) {
video_qs += "&";
}
video_qs += "muted=" + video_muted;
}
if (video_playsinline.length > 0) {
if (video_qs.length > 1) {
video_qs += "&";
}
video_qs += "playsinline=" + video_playsinline;
}
if (video_speed.length > 0) {
if (video_qs.length > 1) {
video_qs += "&";
}
video_qs += "speed=" + video_speed;
}
if (video_transparent.length > 0) {
if (video_qs.length > 1) {
video_qs += "&";
}
video_qs += "transparent=" + video_transparent;
}
}