Centillien / videos

Search and share Youtube and facebook videos. Include playlists, preview in activity and widgets. Embed in blogs and pages
https://centillien.com/
6 stars 4 forks source link

issue on function videoembed_youtube_shortener_parse_url #11

Closed nlybe closed 7 years ago

nlybe commented 8 years ago

Hello I use this plugin which is great. I found 2 small issues on function videoembed_youtube_shortener_parse_url:

  1. the parameters of the function are wrong, so the size of the video is always small (as defined in videoembed_calc_size) since the $videowidth parameter wasn't passed.
  2. In some case the video wasn't not displayed, so I changed the line $videourl = 'youtube.com/v' . $path; to $videourl = 'www.youtube.com/embed' . $path;

For your convenience if needed, the below is the function with changed I made:

function videoembed_youtube_shortener_parse_url($url, $guid, $videowidth) {
    $path = parse_url($url, PHP_URL_PATH);
    $videourl = 'www.youtube.com/embed' . $path; 
    videoembed_calc_size($videowidth, $videoheight, 425/320, 24);
    $embed_object = videoembed_add_css($guid, $videowidth, $videoheight);
    $embed_object .= videoembed_add_object('youtube', $videourl, $guid, $videowidth, $videoheight);
    return $embed_object;
}
`
Wouter0100 commented 8 years ago

Awesome! Could you please create a PR for this, so we're able to merge it to the project?