Merge pull request #595 from mapado/nr-improve_dailymotion_embed

Allow embed of Dailymotion playlists
This commit is contained in:
Amauri CHAMPEAUX 2021-03-06 09:40:30 +01:00 committed by GitHub
commit e2e6c14560
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -809,6 +809,7 @@ tarteaucitron.services.dailymotion = {
video_height = x.getAttribute("height"),
frame_height = 'height=',
video_frame,
embed_type = x.getAttribute("embedType"),
params = 'info=' + x.getAttribute("showinfo") + '&autoPlay=' + x.getAttribute("autoplay");
if (video_id === undefined) {
@ -824,7 +825,10 @@ tarteaucitron.services.dailymotion = {
} else {
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;
});
},