Forráskód Böngészése

Merge pull request #622 from beauchette/master

meilleur gestion params youtube, ajout param start
Amauri CHAMPEAUX 4 éve
szülő
commit
bdff0c5dcf
1 módosított fájl, 6 hozzáadás és 1 törlés
  1. 6 1
      tarteaucitron.services.js

+ 6 - 1
tarteaucitron.services.js

@@ -3254,7 +3254,12 @@ tarteaucitron.services.youtube = {
                 video_height = x.getAttribute("height"),
                 frame_height = 'height=',
                 video_frame,
-                params = 'theme=' + x.getAttribute("theme") + '&rel=' + x.getAttribute("rel") + '&controls=' + x.getAttribute("controls") + '&showinfo=' + x.getAttribute("showinfo") + '&autoplay=' + x.getAttribute("autoplay") + '&mute=' + x.getAttribute("mute");
+                attrs = ["theme", "rel", "controls", "showinfo", "autoplay", "mute", "start"],
+                params = attrs.filter(function (a) {
+                  return x.getAttribute(a) !== null;
+                }).map(function (a) {
+                  return a + "=" + x.getAttribute(a);
+               }).join("&");
 
             if (video_id === undefined) {
                 return "";