Author Archive

Play .mp4 Videos in the Shadowbox FLV Player

Dec 03

Here at TPI, we love Shadowbox. It is a very clean and simple way of displaying a photo gallery or playing a video on a website. To play a .mp4 video on a site, you would normally initiate the Shadowbox player like this:

<script type="text/javascript>
     Shadowbox.init({
          players: ["img", "qt"]
     });
</script>

And then use an anchor to make the image or text clickable like this:

<a rel="shadowbox" href="my_video.mp4" title="My Video Title">
     Watch The Video
</a>

This works, but it relies on the fact that the clients browser has the quicktime plugin installed. Some of you already know that the Flash player can play .mp4 video files. The Flash plugin is installed on almost all browsers, so it would be ideal if the .mp4 videos would play in the Shadowbox JW Player instead.

Lucky for us, Shadowbox has an option that lets you decide what extensions work with which players. In this case, we want .mp4 videos to use the “flv” player rather than the “qt” player. Here’s how you do it:

<script type="text/javascript">
     var customExt = {
          img:["png","jpg","jpeg","gif","bmp"],
          swf:["swf"],
          flv:["flv", "mp4"],
          qt:["dv","mov","moov","movie"],
          wmp:["asf","wm","wmv"],
          qtwmp:["avi","mpg","mpeg"],
          iframe:["asp","aspx","cgi","cfm","htm","html",
                  "jsp","pl","php","php3","php4","php5",
                  "phtml","rb","rhtml","shtml","txt","vbs"]
     };
     Shadowbox.init({
          players: ["img", "flv"],
          ext: customExt
     });
</script>

Normally, the “qt” player plays all “.mp4″ files. Simply move the “mp4″ extension to the “flv” property. Using this method, you can decide which extensions use which players in Shadowbox.

Now, when a user clicks the Shadowbox link, the .mp4 video uses the “flv” player and plays in the JW Player:

<a rel="shadowbox" href="my_video.mp4" title="My Video Title">
     Watch the .mp4 video in the JW Player.
</a>

View Source not working in IE7

Jan 27

Today I ran into a problem with IE7 where I could view the source of a webpage. It was not working when I would right click the page > View Source, or by going to Page > View Source.

After doing a couple of google searches, it turns out you have to delete your cache by going to Tools > Delete Browsing History > Delete All. You must then refresh your page in order to view the source. I really didn’t spend much time researching how or why this happens, but hopefully this will save someone a few minutes and a headache.

Yet another reason to stay as far away from this browser as possible…

Take Control of Your Phone

Nov 05

If you are like me, you are always looking for an open source version of everything.  Not just for the sake of using an open source OS or app, but because you want to have more control over how your computer or device behaves.

One device that seems to always keep me locked out with proprietary software and drivers is my cell phone, but not anymore.  The new Android-enabled phones have an open source framework that will give any developer the ability to take mobile apps to the next level.  Read more about Android on Google’s website:

http://code.google.com/android/