Make Dailymotion videos work with Prettyphoto
<p>After a lot of searching I've found <a href="http://forums.no-margin-for-errors.com/discussion/1092/making-pretty-photo-dailymotion-videos-works/p1" rel="nofollow">here</a> some changes which should be done in order that Dailymotion videos should work with Prettyphoto.</p>

<p>I've done these changes and it's working... but not the first time after I refresh the page.</p>

<p>I mean that if I have this rel="prettyPhoto[videos]" and here I have 3 videos from youtube, vimeo and dailymotion, it's working only if I don't hit the first time the dailymotion video.
So if I hit the vimeo video and then going to next video...it's working. But if I refresh the page and hit the dailymotion video first... it's not working.</p>

<p>I'm sure this is a minor change because it doesn't recognize the path for the first time or something I don't know...</p>

<p>A live example is <a href="http://randf.info/test/test.php" rel="nofollow">here</a>.</p>

<p>The code added is this:</p>

<pre>
case 'dailymotion':
    correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
    // Remove url's beginning
    var videoid = pp_images[set_position].replace(/http:\/\/www\.dailymotion\.com\/video\//i, '');
    // "Explode" the end of the string to catch the video id
    var spt = videoid.split('_');
    // Video id is index 0
    movie = 'http://www.dailymotion.com/swf/' + spt[0] + '?width=&theme=none&iframe=0&additionalInfos=0&autoPlay=1&hideInfos=0';
    toInject =  settings.iframe_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);
break; 
</pre>

<p>And, yes I found Casar Davorin's script but dailymotion doesn't work, even if he says is working.</p>

<p>Could somebody help me please?</p>

<p>Thanks in advice.</p>
