WordPress.org

Ready to get started?Download WordPress

Forums

Video Thumbnails
[resolved] age URL Dailymotion support (3 posts)

  1. Gee
    Member
    Posted 3 years ago #

    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[^>]+>.+?http://www.dailymotion.com/swf/video/([A-Za-z0-9]+).+?</object>#s', $markup, $matches);
    
    			// Dailymotion url
    			if(!isset($matches[1])) {
    				preg_match('#http://www.dailymotion.com/video/([A-Za-z0-9]+)#s', $markup, $matches);
    			}			
    
    			// Dailymotion iframe
    			if(!isset($matches[1])) {
    				preg_match('#http://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: http://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!

    http://wordpress.org/extend/plugins/video-thumbnails/

  2. Sutherland Boswell
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks! I'll work on including this.

  3. Sutherland Boswell
    Member
    Plugin Author

    Posted 3 years ago #

    Included this in 1.7.4, thanks again!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic