Merge pull request #834 from CIMEOS/master

Enable js api for youtube_player and dailymotion_player
This commit is contained in:
Amauri CHAMPEAUX 2021-12-02 14:39:57 +01:00 committed by GitHub
commit 621b05d514
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -1080,7 +1080,10 @@ tarteaucitron.services.dailymotion = {
video_frame, video_frame,
embed_type = tarteaucitron.getElemAttr(x, "embedType"), embed_type = tarteaucitron.getElemAttr(x, "embedType"),
allowfullscreen = tarteaucitron.getElemAttr(x, "allowfullscreen"), 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) { if (video_id === undefined) {
return ""; return "";
@ -3528,12 +3531,11 @@ tarteaucitron.services.youtube = {
frame_height = 'height=', frame_height = 'height=',
video_frame, video_frame,
allowfullscreen = tarteaucitron.getElemAttr(x, "allowfullscreen"), 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) { params = attrs.filter(function (a) {
return tarteaucitron.getElemAttr(x, a) !== null;
return tarteaucitron.getElemAttr(x, a) !== null;
}).map(function (a) { }).map(function (a) {
return a + "=" + tarteaucitron.getElemAttr(x, a); return a + "=" + tarteaucitron.getElemAttr(x, a);
}).join("&"); }).join("&");
if(tarteaucitron.getElemAttr(x, "loop") == 1) { if(tarteaucitron.getElemAttr(x, "loop") == 1) {