October 30, 2008

Using YouTube’s video storage to showcase video content

Filed under: Flash, Video — Tags: , , , , — admin @ 8:44 pm

We were tasked with creating a full Flash website to showcase user-generated video content for a contest that a local restaurant chain (Rosa’s Cafe) is currently running. Any patron to their restaurant is encouraged to film themselves going crazy for Rosa’s. They can upload their video at www.crazyforrosas.com and be eligible for $5000 or a FlipVideo camera.

When tasked with this we decided to use YouTube for the actual storage of the video content. To do this, sign up for a YouTube account and begin uploading some content to begin testing. You can easily take advantage of the YouTube API and RSS feeds to pull the information in Flash.

To access YouTube’s RSS feed, you’ll need to create an intermediary to avoid the cross-domain security protection. We used a PHP script to snag our RSS feed so we can display it on our server.

<?php
#readxml.php
$file = "http://www.youtube.com/rss/user/username/videos.rss";
$handle = @fopen($file, "r");
if ($handle) {
   while (!feof($handle)) {
	   echo fgets($handle, 4096);
   }
   fclose($handle);
}
?>

In Flash, you’ll need to call readxml.php (the above script) as XML and parse it out accordingly. It helps to have a real strong knowledge of XML parsing to get your way through it since there’s a lot of info in the feed that you won’t need. It will give you thumbnail locations, titles, descriptions, video links, etc. One problem that I found is that it’s very difficult to use the YouTube ActionScript API. There is not very much documentation. Opening one video is fine, open another one and Flash will crash. The API says to use the destroy(); command prior to opening another video, but it does not work. I found some help on their forums to help us – but the solution was not some handy ActionScript. It was to use a free component called ToobPlayer. This was most certainly a life saver after spending hours on YouTube’s API and not getting anywhere. The ToobPlayer component can easily use a YouTube video url and be skinned. A big thanks goes out to those folks!

This site also features a full administration panel using CakePHP to administer video submissions and a Flash front-end video upload feature.

Visit Crazy for Rosa’s

October 7, 2008

Freebie: Dynamic Flash Video Player

Filed under: Flash, Freebies, Video — Tags: , , — admin @ 9:51 pm

Download Source

Download includes versions for 4×3 and 16×9 aspect ratios.

This content requires Adobe Flash Player 8

Download Adobe Flash

I’ve created a video player that you can use for free that is easily customizable. The cool thing is you don’t need to open Flash to change the video you want it to display. Just write is as a variable in your embed code like this:

<script type="text/javascript" language="javascript">
        var so = new SWFObject("/examples/videoplayer/video_4x3.swf", "mymovie", "500", "405", "8", "#000000");
            so.addParam("menu", "false");
			so.addParam("scale", "noscale");
			so.addParam("allowFullScreen", "true");
			so.addVariable("myVideo", "vid1.flv");
            so.write("flash");
    </script>

Note so.addVariable(“myVideo”, “vid1.flv”); All you need to do is change vid1.flv to the video of your choice.

Enjoy!

Flip Video Camera

Filed under: Video — Tags: , — admin @ 9:11 pm

I just got this thing in the mail today. I’ve been using one at work lately for some quick & dirty video and audio recording. This thing is perfect for convenience. It’s not the greatest in terms of quality, but I love it because the thing is so dang easy to use. It fits in your pocket, has 1-button recording, and has built-in USB. This is a lot better for me at home to take some videos of my 1 year old rather than trying to keep up with our Sony (battery charged? is this a new tape?). It runs off 2 AAs and stores the videos using what must be some type of Flash memory.

© 2010 Aaron Benson. All rights reserved.

Powered by WordPress