I've noticed when I want to put a You-Tube video in my blog I have to change the beginning of the link code from http://youtu.be/ to http://www.youtube.com/watch?v=
I am copying the link from the bottom of the video in You-Tube. Should I be looking elsewhere for the link?
Thanks,
Michael O'Reilly
spikeweb
Member
Posted 1 year ago #
I noticed the same need to modify URL's with You tube.
And I have writers who don't understand well how to change the provided link so an update would be appreciated :)
I've added a few lines of code to take care of youtu.be urls. Just add the code below in vipers-vide-quicktags.php on line #2871
// Short/Share url ( http://youtu.be/videoid[?whatever=xx] )
elseif ( FALSE !== stristr( $content, 'youtu.be' ) ) {
$parsed_url=parse_url($content);
$videoid=basename($parsed_url['path']);
$embedpath = 'v/' . $videoid;
$fallbacklink = 'http://www.youtube.com/watch?v=' . $videoid;
$fallbackcontent = '<img src="http://img.youtube.com/vi/' . $videoid . '/0.jpg" alt="' . __('YouTube Preview Image', 'vipers-video-quicktags') . '" />';
}
It also ignores query string parameters like t=xx added by youtube when a user selects a start time in the video.
Hope the plugin author could add those patch to the source code.