Category: Code

HTML 5′s “real deal” video player

February 2nd, 2010
  • update, 2010-02-03 – Tried it again this morning and had the same results. CPU spikes well over 100% and the UI is unusable.

John Gruber writes,

Seriously, this is the real deal — full-screen H.264 playback with no Flash, no browser plugins, full iPhone OS support, and sane CPU usage, better in every single regard than any video player ever made with Flash.

Have a look for yourself.

What I experienced is nothing like Gruber describes. I saw my browser lock up and my CPU usage spike and stay spiked while the video played. I sent it to Matthew and he experienced the same performance issues.

I look forward to better implementations and support from browsers. Better performance, real full screen, sharable implementations.

Break a bitmap into a grid with ActionScript 3

December 27th, 2009

I needed a way to break apart a loaded bitmap into a grid of smaller bitmaps so I could then manipulate them separately. I ended up creating BitmapGrid.as, a class that will break apart your bitmaps into an array for you to do with as you please.


The Flash plugin is required to view this object.

Download the code & example files

ReferenceError: Error #1065 re: E4X XML search

October 28th, 2009

I was trying to do a simple E4X search of my XML for an attribute named “type” and I came across this error.

ReferenceError: Error #1065: Variable @type is not defined.

After ramming my head against a wall for around 30 minutes I asked Duncan if he ever saw such a thing. After all, other searches on the same XML were working perfectly. After some thought he remembered having a similar issue. Turns out that every node you are searching needs to have that attribute, in my case every node needed the “type” attribute.

Subversion merge cheat sheet

September 8th, 2009

At the office we are responsible for managing our source code in Subversion. Since no one here is all that familiar with Subversion I had to do some research and bug Matthew to find out how to merge back and forth from trunk to branch.

This is a little cheat sheet that I added to our wiki as well.

svn merge

These are command line processes.

Merge a branch back to the trunk

  • From the branch, svn log –stop-on-copy, this returns the revision number where the branch began (XXXX)
  • From trunk, svn update which will return the last revision number (YYYY)
  • From trunk, svn merge -r XXXX:YYYY path/to/branch where XXXX is the branch’s revision and YYYY is the latest revision
  • Last but not least svn commit the changes back into trunk with a nice message

Merge from trunk to a branch

  • From the branch, svn log –stop-on-copy, this returns the revision number where the branch began (XXXX)
  • From trunk, svn update which will return the last revision number (YYYY)
  • From the branch, svn merge -r XXXX:YYYY path/to/trunk where XXXX is the branch’s revision and YYYY is the latest revision
  • svn commit

For both of these processes I have had more success going directory to directory, example merge the web directory and the src directory separately. Also be sure to svn update both the branch and the trunk to be sure you have the latest source code.

1172: Definition fl.video:VideoEvent could not be found.

May 12th, 2008

I came across this error and am blogging about it so I won’t forget the solution and maybe it will help someone else.

1172: Definition fl.video:VideoEvent could not be found.

In order to access a number of the “fl” packages you need to have a component in your library. In this case I added the FLVPlayback component and all was well. Apparently you can use flash.utils.getDefinitionByName as well.

Adobe’s Video UI Components… sigh

May 9th, 2008

I am in the process of creating a common interface to control media players whether it be Adobe’s VideoPlayer or exanimo’s SoundPlayer. My initial desire was to have it accept Adobe’s own Video Components like PlayPauseButton and SeekBar as well as my own custom controls, but I have run into an issue. Adobe’s Video UI Components do not work on their own but require UIControls.

So if I want a PlayPauseButton to work with SoundPlayer I need to roll my own. If I want a BufferingBar to work, I need to roll my own.

Hopefully in the next version of Flash they will resolve this and give us components that would accept an interface for a target.

IE7 Floats Not Clearing?

March 23rd, 2008

I ran into an issue this weekend with IE7 not clearing my floats correctly. I had a wrapper with a background applied to it and then a content div with floated elements in it. The background was not repeating all the way down the page, and was ending before the content div. I was using my normal methods of clearing floats and of course the page worked fine in Firefox and Safari on the Mac.

After some searching around looking for why this was happening I discovered an article at Position Is Everything that introduced me to a new clearing method which is far more elegant than the solution I was using previously.

You apply the .clearfix class to any div containing a float and its cleared!

.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .clearfix { display:inline-block; } /* Hide from IE Mac */ .clearfix {display:block;} /* End hide from IE Mac */

Roger Johansson also suggests adding the following code to a <=IE6 specific CSS file in order to make sure it works in earlier browsers.

clearfix {height:1px;}

My Favorite ActionScript 3 Events

March 13th, 2008

So far my favorite events are Event.ADDED_TO_STAGE and Event.REMOVED_FROM_STAGE, they just makes things that much easier.

For instance, I have a SimpleToolTip class that all you have to do is addChild and removeChild to manage it. When its added to the stage, I initialize everything that I need to turn on, when I remove it I turn everything back off.

Its just nice and clean.

77e new Music Weekly

March 6th, 2008

Something that I worked on and finished up before leaving sunKING is AE’s 77e New Music Weekly. It showcases a lot of really great bands and provides a few free mp3s each week.

markdown :(

March 2nd, 2008

My Markdown plugin is not processing on the homepage and archives.