I updated ThumbGenie over the weekend to support generation of embed code. Now, every time you create a thumbnail from an MPEG4-AVC file or SWF embed code will be generated. ThumbGenie ships with a default “object / embed” code template, but you can easily modify or replace the template with your own code. (more…)
While making some improvements to my ilist metadata (iTunes MPEG4 style metadata) classes I ended up needing to convert an ISO 8601 date and time string to a native AS3 Date object and vice versa.
An ISO 8601 date and time string comes in two flavors, basic and extended. As you can see below, the basic format simply eschews dashes and colons in favor of a more compact syntax.
The standard requires a fixed number of digits to represent a date (8 digits) or a time (6 digits). When fewer digits are needed to represent a date / time the number must be padded with leading zeros. The Z at the end of the string designates the UTC “Zulu” timezone (GMT or so called universal time).
I took a quick buzz around the interwebs, but couldn’t find an AS3 lib that could convert one of these strings into a date object or take a date object and have it generate a correctly formatted string, so, you guessed it–I spent my Sunday evening whipping together a utility class that will do the trick (download the source here).
I’m not claiming compliance with every nook and cranny of the spec, but it covers the fundamentals decently. Hand the util an AS3 Date object and you can generate a date, time or date + time in the basic or extended format. You can also parse a basic / extended date, time or date + time string and have an AS3 Date object returned with the appropriate UTC values set on it.
Here’s what the basic usage would look like for a date + time scenario:
// instantiate a ISO8601Util object var util:ISO8601Util = new ISO8601Util(); // parse a date + time string into an AS3 Date - takes either a basic or // extended representation var date:Date = util.parseDateTimeString( "2009-02-21T09:07:59Z" ); // to turn a date into an ISO 8601 date + time representation grab a date object var currentdate:Date = new Date(); // create a string with the extended or basic format var extended:String = util.formatExtendedDateTime( currentdate ) var basic:String = util.formatBasicDateTime( currentdate );
Hopefully, I’m now the only poor bastard who has to do this!
This is a little “inside the devigners head” piece that explains some of the conceptual thinking behind the Jing Pro MPEG4-AVC Video Player (there’s also a sanitized version over at the Jing blog).
The player was built with Flex (easy to tell as I never quite got around to creating a custom preloader) which makes her a bit of a pig file size wise, but having a mature framework and consistent approach to component creation was worth it in my opinion (I should add that the Google Analytics lib added a bit to her heft).
Besides being a branded experience, the player does some neat scaling tricks which makes it behave a lot more like an HDTV. Feed it a SD / HD stream and it elegantly handles the scaling and position (pillarboxing, letterboxing and windowboxing in video parlance) of the video. This makes it much easier to embed because you can make the video fit anywhere (big video, small blog post–no problemo). So throw on your flak jacket and check out this “full metal” homage to the Jing Pro video player.
Go fullscreen
to see the video in full 1:1 pixel clarity.
Grasping the simple things is often the hardest part to getting up and running with Flex. For example, a friend of mine who I’ve been trying to pull over from the dark side (.Net guy) asked, “I’ve got an MXML Application with a button in it that I’d like to bind to a method–where’s the code behind.”
The simple answer of course is to point him to the “script” tag (let’s just forget code behind support was ever added to Flex). Rather than typing up a long winded response I made a quick and dirty Jing video to “show him around” Flex’s script tag (no deep explanation, I’m just teaching by “doing”).
(more…)
I’ve been playing with Pixel Bender a bit and noticed that there weren’t really any examples (I could find) that illustrated effects being applied to video. So I gathered together a whole slew of kernels from the interweb, downloaded a copy of Dancing Matt and shoehorned them into a media player that allows you to select and apply the effects during video playback. (more…)