✨Add support for all Vimeo embed options
See https://developer.vimeo.com/player/sdk/embed Also switched to data attributes to ensure maximum compatibility
This commit is contained in:
parent
2e6b6db44d
commit
c755e57859
|
|
@ -1936,16 +1936,28 @@ tarteaucitron.services.vimeo = {
|
||||||
"js": function () {
|
"js": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
tarteaucitron.fallback(['vimeo_player'], function (x) {
|
tarteaucitron.fallback(['vimeo_player'], function (x) {
|
||||||
var video_id = x.getAttribute("videoID"),
|
var video_width = x.getAttribute("data-width") || x.getAttribute("width"),
|
||||||
video_width = x.getAttribute("width"),
|
|
||||||
frame_width = 'width=',
|
frame_width = 'width=',
|
||||||
video_height = x.getAttribute("height"),
|
video_height = x.getAttribute("data-height") || x.getAttribute("height"),
|
||||||
frame_height = 'height=',
|
frame_height = 'height=',
|
||||||
video_title = x.getAttribute("title") || '',
|
|
||||||
video_byline = x.getAttribute("byline") || '',
|
video_id = x.getAttribute("data-videoID") || x.getAttribute("videoID"),
|
||||||
video_portrait = x.getAttribute("portrait") || '',
|
video_autopause = x.getAttribute("data-autopause") || '',
|
||||||
video_loop = x.getAttribute("loop") || '',
|
video_autoplay = x.getAttribute("data-autoplay") || x.getAttribute("autoplay") || '',
|
||||||
video_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;
|
video_frame;
|
||||||
|
|
||||||
var video_qs = '';
|
var video_qs = '';
|
||||||
|
|
@ -2000,6 +2012,76 @@ tarteaucitron.services.vimeo = {
|
||||||
video_qs += "autoplay=" + video_autoplay;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue