[Plugin: Video Thumbnails]Page URL Dailymotion support
-
Hi,
I notice that, this plugin don’t have support to a simple Dailymotion URL page detection like Youtube or Vimeo.
It very easy and i just reuse the author code logic and change the pregmatch url to implement this like that:
// Dailymotion if($new_thumbnail==null) { // Dailymotion flash preg_match('#<object[^>]+>.+?https://www.dailymotion.com/swf/video/([A-Za-z0-9]+).+?</object>#s', $markup, $matches); // Dailymotion url if(!isset($matches[1])) { preg_match('#https://www.dailymotion.com/video/([A-Za-z0-9]+)#s', $markup, $matches); } // Dailymotion iframe if(!isset($matches[1])) { preg_match('#https://www.dailymotion.com/embed/video/([A-Za-z0-9]+)#s', $markup, $matches); } // Now if we've found a Dailymotion video ID, let's set the thumbnail URL if(isset($matches[1])) { $dailymotion_thumbnail = getDailyMotionThumbnail($matches[1]); $new_thumbnail = strtok($dailymotion_thumbnail, '?'); } }
So now, there a new IF section “// Dailymotion url”.
This make pasting of simple page url from Dailymotion (ex: https://www.dailymotion.com/video/xi2ubq_nas-damian-marley-zenith-de-paris-05-04-2011_musicundefined ) and works like a charm.
I hope this can help and the author may take this in consideration for the next updates.
Thanks for this great plugin!
https://www.ads-software.com/extend/plugins/video-thumbnails/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Plugin: Video Thumbnails]Page URL Dailymotion support’ is closed to new replies.