Преглед на файлове

Allow embed of Dailymotion playlists (while being backward compatible with old embed code)

Nicolas Rosset преди 4 години
родител
ревизия
58e5c48da2
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      tarteaucitron.services.js

+ 5 - 1
tarteaucitron.services.js

@@ -637,6 +637,7 @@ tarteaucitron.services.dailymotion = {
                 video_height = x.getAttribute("height"),
                 video_height = x.getAttribute("height"),
                 frame_height = 'height=',
                 frame_height = 'height=',
                 video_frame,
                 video_frame,
+                embed_type = x.getAttribute("embedType"),
                 params = 'info=' + x.getAttribute("showinfo") + '&autoPlay=' + x.getAttribute("autoplay");
                 params = 'info=' + x.getAttribute("showinfo") + '&autoPlay=' + x.getAttribute("autoplay");
 
 
             if (video_id === undefined) {
             if (video_id === undefined) {
@@ -652,7 +653,10 @@ tarteaucitron.services.dailymotion = {
             } else {
             } else {
                 frame_height += '"" ';
                 frame_height += '"" ';
             }
             }
-            video_frame = '<iframe src="//www.dailymotion.com/embed/video/' + video_id + '?' + params + '" ' + frame_width + frame_height + ' frameborder="0" allowfullscreen></iframe>';
+            if (embed_type === undefined || !['video', 'playlist'].includes(embed_type) ) {
+                embed_type = "video";
+            }
+            video_frame = '<iframe src="//www.dailymotion.com/embed/' + embed_type + '/' + video_id + '?' + params + '" ' + frame_width + frame_height + ' frameborder="0" allowfullscreen></iframe>';
             return video_frame;
             return video_frame;
         });
         });
     },
     },