🐛 Fix vimeo service data-attributes parsing
This commit is contained in:
parent
b0d669a016
commit
5292d86250
|
|
@ -2087,7 +2087,6 @@ tarteaucitron.services.vimeo = {
|
||||||
|
|
||||||
video_frame;
|
video_frame;
|
||||||
|
|
||||||
var video_qs = '';
|
|
||||||
|
|
||||||
if (video_id === undefined) {
|
if (video_id === undefined) {
|
||||||
return "";
|
return "";
|
||||||
|
|
@ -2103,113 +2102,112 @@ tarteaucitron.services.vimeo = {
|
||||||
frame_height += '"" ';
|
frame_height += '"" ';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_title.length > 0 || video_byline.length > 0 || video_portrait.length > 0) {
|
var video_qs = "?";
|
||||||
|
|
||||||
video_qs = "?";
|
|
||||||
|
|
||||||
if (video_title.length > 0) {
|
if (video_title.length > 0) {
|
||||||
video_qs += "title=" + video_title;
|
video_qs += "title=" + video_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_byline.length > 0) {
|
if (video_byline.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "byline=" + video_byline;
|
video_qs += "byline=" + video_byline;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_portrait.length > 0) {
|
if (video_portrait.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "portrait=" + video_portrait;
|
video_qs += "portrait=" + video_portrait;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_loop.length > 0) {
|
if (video_loop.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "loop=" + video_loop;
|
video_qs += "loop=" + video_loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_autoplay.length > 0) {
|
if (video_autoplay.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "autoplay=" + video_autoplay;
|
video_qs += "autoplay=" + video_autoplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_autopause.length > 0) {
|
if (video_autopause.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "autopause=" + video_autopause;
|
video_qs += "autopause=" + video_autopause;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_background.length > 0) {
|
if (video_background.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "background=" + video_background;
|
video_qs += "background=" + video_background;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_color.length > 0) {
|
if (video_color.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "color=" + video_color;
|
video_qs += "color=" + video_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_controls.length > 0) {
|
if (video_controls.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "controls=" + video_controls;
|
video_qs += "controls=" + video_controls;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_maxheight.length > 0) {
|
if (video_maxheight.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "maxheight=" + video_maxheight;
|
video_qs += "maxheight=" + video_maxheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_maxwidth.length > 0) {
|
if (video_maxwidth.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "maxwidth=" + video_maxwidth;
|
video_qs += "maxwidth=" + video_maxwidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_muted.length > 0) {
|
if (video_muted.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "muted=" + video_muted;
|
video_qs += "muted=" + video_muted;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_playsinline.length > 0) {
|
if (video_playsinline.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "playsinline=" + video_playsinline;
|
video_qs += "playsinline=" + video_playsinline;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_speed.length > 0) {
|
if (video_speed.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "speed=" + video_speed;
|
video_qs += "speed=" + video_speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_transparent.length > 0) {
|
if (video_transparent.length > 0) {
|
||||||
if (video_qs.length > 1) {
|
if (video_qs.length > 0) {
|
||||||
video_qs += "&";
|
video_qs += "&";
|
||||||
}
|
}
|
||||||
video_qs += "transparent=" + video_transparent;
|
video_qs += "transparent=" + video_transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (video_qs === "?") {
|
||||||
|
video_qs = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
video_frame = '<iframe src="//player.vimeo.com/video/' + video_id + video_qs + '" ' + frame_width + frame_height + ' frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
|
video_frame = '<iframe src="//player.vimeo.com/video/' + video_id + video_qs + '" ' + frame_width + frame_height + ' frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue