Fix Full Screen Issues by Video Embedder WordPress Plugin

If you are hav­ing prob­lems try­ing to dis­play an embed­ded video(s) in your posts like me, then this might help you out. I usu­al­ly embed videos from Hulu, Vimeo and YouTube most­ly. But it’s been a prob­lem try­ing to have the lat­ter 2 dis­play in fullscreen mode.

For Vimeo, the fullscreen icon/grpahic dis­plays on the over­lay of the video. But press­ing on it, just paus­es the video and noth­ing 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.

Mean­while, it seems that the author of Video Embed­der, Kristof­fer Fors­gren, has­n’t been able to update the plu­g­in since 2009. So for those like me who still finds good use for the plu­g­in, it was a let down not find­ing any new comments/updates since August of 2009.

Any­ways, I pro­ceed­ed to just snoop around and edit part of the code in the file video-embedder.php (in the plug­in’s direc­to­ry under wp-con­tent/­plu­g­in­s/). Be sure to back­up as usu­al before editing/updating code. To fix the Vimeo issue (and prob­a­bly oth­ers too), find the func­tion buildEm­bed() block and apply the fol­low­ing 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 width="'.$width.'" height="'.$height.'">';
        $object .= '<param name="movie" value="'.$code.'"></param>';
        $object .= '<param name="allowFullScreen" value="true" />';
        $object .= '<param name="wmode" value="transparent"></param>';
        $object .= '<embed src="'.$code.'" type="application/x-shockwave-flash" wmode="transparent" allowfullscreen="true" width="'.$width.'" height="'.$height.'"></embed>';
        $object .= '</object>';
    } else {
        $object  = '<object type="application/x-shockwave-flash" width="'.$width.'" height="'.$height.'" data="'.$code.'">';
        $object .= '<param name="movie" value="'.$code.'" />';
        $object .= '<param name="allowFullScreen" value="true" />';
        $object .= '<param name="wmode" value="transparent" />';
        $object .= '<param name="quality" value="high" />';
        $object .= '</object>';
    return $object;

To fix the YouTube issue, find the sec­tion com­ment­ed “// Youtube” in the func­tion videoembedder_embed() block. Then, just add the fol­low­ing high­light­ed snip­pet (around line 300):

$new = buildEmbed("".$video."&amp;rel=0&amp;fs=1")

I hope that helps. Hope­ful­ly, there’s an offi­cial update; or if you have found anoth­er plu­g­in that is new and well-received by the Word­Press com­mu­ni­ty that does what Video Embed­der do or bet­ter, please do let us know by post­ing a com­ment.

I might as well add the fol­low­ing update to this post. If you would like to have the abil­i­ty for your YouTube embed­ded videos to play at a high­er qual­i­ty and/or HD, just add the fol­low­ing snip­pet:

$new = buildEmbed("".$video."&amp;rel=0&amp;fs=1&amp;ap=%2526fmt%3D18")

Comments are currently closed.