From 212d1594fa700725e5685fc0051674d8d79c8f0d Mon Sep 17 00:00:00 2001 From: Romain Tiger Date: Wed, 1 Dec 2021 14:23:52 +0100 Subject: [PATCH 1/2] Enable js api for youtube_player and dailymotion_player --- tarteaucitron.services.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index b70c7e1..259c0ef 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -1080,7 +1080,10 @@ tarteaucitron.services.dailymotion = { video_frame, embed_type = tarteaucitron.getElemAttr(x, "embedType"), allowfullscreen = tarteaucitron.getElemAttr(x, "allowfullscreen"), - params = 'info=' + tarteaucitron.getElemAttr(x, "showinfo") + '&autoPlay=' + tarteaucitron.getElemAttr(x, "autoplay"); + showinfo = tarteaucitron.getElemAttr(x, "showinfo"), + autoplay = tarteaucitron.getElemAttr(x, "autoplay"), + api = tarteaucitron.getElemAttr(x, "api"), + params = `info=${showinfo}&autoPlay=${autoplay}&api=${api}`; if (video_id === undefined) { return ""; @@ -3528,12 +3531,11 @@ tarteaucitron.services.youtube = { frame_height = 'height=', video_frame, allowfullscreen = tarteaucitron.getElemAttr(x, "allowfullscreen"), - attrs = ["theme", "rel", "controls", "showinfo", "autoplay", "mute", "start", "loop"], + attrs = ["theme", "rel", "controls", "showinfo", "autoplay", "mute", "start", "loop", "enablejsapi"], params = attrs.filter(function (a) { - - return tarteaucitron.getElemAttr(x, a) !== null; + return tarteaucitron.getElemAttr(x, a) !== null; }).map(function (a) { - return a + "=" + tarteaucitron.getElemAttr(x, a); + return a + "=" + tarteaucitron.getElemAttr(x, a); }).join("&"); if(tarteaucitron.getElemAttr(x, "loop") == 1) { From d7fff4745c2fa9f25f64507600eceedc61779e42 Mon Sep 17 00:00:00 2001 From: Romain Tiger Date: Thu, 2 Dec 2021 11:04:03 +0100 Subject: [PATCH 2/2] Correction ES6 dailymotion_player --- tarteaucitron.services.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 259c0ef..ac41f75 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -1083,7 +1083,7 @@ tarteaucitron.services.dailymotion = { showinfo = tarteaucitron.getElemAttr(x, "showinfo"), autoplay = tarteaucitron.getElemAttr(x, "autoplay"), api = tarteaucitron.getElemAttr(x, "api"), - params = `info=${showinfo}&autoPlay=${autoplay}&api=${api}`; + params = 'info=' + showinfo + '&autoPlay=' + autoplay + '&api=' + api; if (video_id === undefined) { return "";