Fix Full Screen Issues by Video Embedder WordPress Plugin

June 9th, 2010  |  Published in Development  |  Comment

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 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 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."&amp;rel=0&amp;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."&amp;rel=0&amp;fs=1&amp;ap=%2526fmt%3D18")

Regarding IE6

June 26th, 2009  |  Published in Design  |  Comment

This artwork by John Martz pretty much explains what most of us feel towards IE6—specially those in Web Design/Development.

momentile-ie6-denial-by-john-martz

News from Apple WWDC 2009

June 10th, 2009  |  Published in Technology  |  Comment

apple-wwdc-20090608-0612

For those that don’t know, Apple’s WWDC (Worldwide Developers Conference) 2009 was this past Monday morning at Moscone West, San Francisco. It’s primarily for those developing for Apple’s products (OS X, iPhone apps, etc.) but it’s also for the Apple fans out there as the Keynote usually addresses new product releases, etc.

I was tuned in, listening to Ustream’s live stream of the Keynote.[1] Pretty cool as you can multitask versus having to read every new updates on a blog. Though you have to give it up though as the photos on the blog updates are more eye candy.

Read the rest of this entry »

  1. The recorded stream can be seen here. Apple’s official recorded video here. []

Bash Completion, Along with SVN and Git Tab Completion

February 9th, 2009  |  Published in Development  |  Comment

Time is precious. I installed these utilities to save some of it:

I install bash-completion via MacPorts on my Macs.

sudo port install bash-completion

I then saved this svn-completion script to locally, and did a sudo cp:

sudo cp bash_completion /opt/local/etc/bash_completion.d/svn-completion.sh

Note: “bash_completion” is the file linked on “svn-completion script“. I hope that avoids confusion.

Last but not least, I then installed the git-completion script. I first checked the version of Git I have via MacPorts which happens to be 1.6.0.5.[1] I then saved and untarred the Git tarball of the version I have locally. Then did another sudo cp of the actual git-completion script to the same directory where my svn-completion.sh is located at:

sudo cp git-1.6.0.5/contrib/completion/git-completion.bash /opt/local/etc/bash_completion.d/git-completion.sh

After that, I added the following to to my .profile (or .bash_profile):

# for bash-completion
if [ -f /opt/local/etc/bash_completion ]; then
    . /opt/local/etc/bash_completion
fi
source /opt/local/etc/bash_completion.d/svn-completion.sh
source /opt/local/etc/bash_completion.d/git-completion.sh

Either restart your Terminal, or re-execute your .profile, and that would do it.

For more info on Git completion, check out this article by Kamal Fariz (bitfluent).

  1. Got it by using git version. []

Git Info – Almost Like “svn info”

February 9th, 2009  |  Published in Development  |  1 Comment

I have been trying to find something like svn info but for Git. Luckily, I stumbled upon Duane Johnson’s script. Here’s git-info.sh:

#!/bin/bash

# author: Duane Johnson
# email: duane.johnson@gmail.com
# date: 2008 Jun 12
# license: MIT
#
# Based on discussion at http://kerneltrap.org/mailarchive/git/2007/11/12/406496

pushd . >/dev/null

# Find base of git directory
while [ ! -d .git ] && [ ! `pwd` = "/" ]; do cd ..; done

# Show various information about this git directory
if [ -d .git ]; then
  echo "== Remote URL: `git remote -v`"

  echo "== Remote Branches: "
  git branch -r
  echo

  echo "== Local Branches:"
  git branch
  echo

  echo "== Configuration (.git/config)"
  cat .git/config
  echo

  echo "== Most Recent Commit"
  git --no-pager log --max-count=1
  echo

  echo "Type 'git log' for more commits, or 'git show' for full commit details."
else
  echo "Not a git repository."
fi

popd >/dev/null

I made an alias in my .profile to make it a bit more accessible:

alias gi='. /Users/$USER/git-info.sh'