Fix Full Screen Issues by Video Embedder WordPress Plugin


If you are having problems trying to display an embedded video(s) in your posts like me, then this might help you out. I usually embed videos from Hulu, Vimeo and YouTube mostly. But it’s been a problem trying to have the latter 2 display in fullscreen mode.

For Vimeo, the fullscreen icon/grpahic displays on the overlay of the video. But pressing on it, just pauses the video and nothing else. For YouTube, there was no fullscreen icon/graphic in the first place. I think that might have been caused by some code changes on YouTube’s end.

Meanwhile, it seems that the author of Video Embedder, Kristoffer Forsgren, hasn’t been able to update the plugin since 2009. So for those like me who still finds good use for the plugin, it was a let down not finding any new comments/updates since August of 2009.

Anyways, I proceeded to just snoop around and edit part of the code in the file video-embedder.php (in the plugin’s directory under wp-content/plugins/). Be sure to backup as usual before editing/updating code. To fix the Vimeo issue (and probably others too), find the function buildEmbed() block and apply the following updates (around line 600):

function buildEmbed($code)
{
    $options = get_option(videoembedder_options);
    $width = $options["video_width"];
    $height = $options["video_height"];
    $object = '';
    if(is_feed()) {
        $object  = '';
        $object .= '';
        $object .= '';
        $object .= '';
        $object .= 'allowfullscreen="true" width="'.$width.'" height="'.$height.'">';
        $object .= '';
    } else {
        $object  = '';
        $object .= '';
        $object .= '';
        $object .= '';
        $object .= '';
        $object .= '';
    }
    return $object;
}

To fix the YouTube issue, find the section commented “// Youtube” in the function videoembedder_embed() block. Then, just add the following highlighted snippet (around line 300):

$new = buildEmbed("http://www.youtube.com/v/".$video."&rel=0&fs=1")

I hope that helps. Hopefully, there’s an official update; or if you have found another plugin that is new and well-received by the WordPress community that does what Video Embedder do or better, please do let us know by posting a comment.

Update
I might as well add the following update to this post. If you would like to have the ability for your YouTube embedded videos to play at a higher quality and/or HD, just add the following snippet:

$new = buildEmbed("http://www.youtube.com/v/".$video."&rel=0&fs=1&ap=%2526fmt%3D18")