Brian Hadaway

Professionally Nerdy Since 2002

UbaPlayer – The jQuery HTML5 Audio Player with Flash Fallback

About a year ago, I wrote a simple HTML5 Audio Player with Flash Fallback. I received a lot of questions and feedback about the player, so I decided to rewrite it to fix some bugs and add some of the most requested features and call it UbaPlayer. Read More »

Posted in Front-End Development | Tagged , , , , , | 21 Comments

OGG Files Causing Errors in HTML5 Audio Player in Firefox

About a year ago I created an HTML5 Audio Player with Flash Fallback that several developers have used in their sites. It’s not the most robust player, but what it lacks in features it makes up for in simplicity. It plays audio files natively in modern browsers and uses a simple Flash player to backfill audio tag functionality in antiquated browsers. The UI is styled with CSS regardless of whether the browser plays audio natively or via Flash and implementing the plugin is simple enough for novice developers. Read More »

Posted in Front-End Development | Tagged , , , | Leave a comment

iPhone-Style Alphabetical Contact List with HTML, CSS and JavaScript (jQuery)

Here’s what you’re most likely looking for – the demo and the source. Feel free to read the explanation while you’re here.

Front-end developers are often called on to build UI elements that aren’t entirely original. Whether the cause of this phenomenon is a lack of creativity on the part of designers or a particular affinity for certain UI elements among the web-browsing public, ripping-off drawing inspiration from others’ ideas is common in web design. One of the most prominent sources of such “inspiration” over the past few years is Apple’s Aqua interface. Thanks to this glossy, semi-transparent, gradient-laden design, front-end and Flash developers have spent several years worth of billable hours creating simulated reflections and configuring cover flow components for clients insistent upon having sites that “look more web 2.0″. Read More »

Posted in Front-End Development, Labs | Tagged , , | 12 Comments

Responsive Web Design Using CSS3 Media Queries

Responsive web design is a type of progressive enhancement that uses fluid grids, flexible-size images and media queries to optimize a website for a users’ specific viewing context. At its core, responsive web design is about adjusting layout, typography and imagery to provide a consistent, device-independent web experience. Fluid grids and flexible size images aren’t new concepts to web design, so I’ll spend most of this post discussing media queries. Read More »

Posted in Front-End Development | Tagged , , , , , | 3 Comments

HTML5 Audio Player with Flash Fallback

UPDATE (Mar 17, 2012): I recently rewrote jquery.audiocontrol.js as a new plugin, UbaPlayer, which includes many features requested by users over the past year. UbaPlayer is conceptually similar to the old player but more flexible. Keep this in mind as you read the comments below – they may not apply to ubaPlayer.

I wanted to create a simple one-button audio player using HTML5 that would be suitable for playing samples of audio tracks. This one-button player would toggle between play, pause and loading states and would stop playing the current track when another instance of the button is clicked. Naturally, I would want to include a Flash fallback for browsers that don’t support HTML5 audio playback. I also wanted to use HTML/CSS to style a single set of controls that serve as the UI for both the HTML5 and Flash versions of the player.

What resulted from this exercise was a jQuery audiocontrol plugin that controls playback and an “invisible” Flash audio player that emulates the HTML5 <audio> element. The control lacks some necessary features such as support for playlists and “bundled” playback. This would allow users to listen to a group of tracks without continually clicking play. Also, there is currently no publicly-exposed method to kill audio playback from outside the control. This is also my first jQuery plugin so there’s probably some improvement to be made in that code. But it’s still a good basic HTML5 audio player with Flash fallback that allows you to style the buttons with CSS regardless of whether the audio is playing natively in the browser or in the Flash plugin.

The code is tested to work in the following browsers:

  1. Firefox 3.6 – Mac/PC
  2. Safari 5 – Mac
  3. Chrome 10 – Mac
  4. Internet Explorer 7+ – PC
  5. Firefox 4 – T-Mobile G2 (Android 2.2)
  6. Opera Mobile 11 – T-Mobile G2 (Android 2.2)
  7. Default Browser – T-Mobile G2 (Android 2.2)
  8. Safari Mobile – iPad and iPod Touch (iOS)

Take a look at a demo of my HTML5 audio player with Flash fallback here. Feel free to download the source and use it however you like. You’ll find some documentation in the jQuery plugin or you can hit me up with a comment or email if you have questions about how to customize this to your needs.

Posted in Labs | Tagged , , , , , | 91 Comments

HTML5 Audio Support on Android Devices

UPDATE: Here’s a new post about a cross-browser HTML5 audio player with Flash fallback that effectively solves the problem described below.

In a previous post, I mentioned that I wanted to see first-hand how each browser renders default controls for the HTML5 audio element. I created a simple demo page and tested it in the following browsers:

  1. Firefox 4 – Mac (OSX 10.6)
  2. Safari 5 – Mac (OSX 10.6)
  3. Chrome 10 – Mac (OSX 10.6)
  4. Internet Explorer 9 – PC (Vista)
  5. Firefox 4 – T-Mobile G2 (Android 2.2)
  6. Opera Mobile 11 – T-Mobile G2 (Android 2.2)
  7. Default Browser – T-Mobile G2 (Android 2.2)
  8. Safari – iPad and iPod Touch (iOS)

As I tested the demo on the G2 in Android 2.2’s (aka Froyo) default browser I was surprised to see that I get neither the browser’s default controls nor the fallback message enclosed inside the audio element. How could this be? Read More »

Posted in Front-End Development | Tagged , , , , | 7 Comments

How HTML5 Audio Controls Render In Modern Browsers

I created a test page using the most basic implementation of the HTML5 audio tag so I could see how modern browsers render the default controls. (You can view my test page here.) As is the case with almost everything browser-related, there is quite a bit of discrepancy in how each browser renders the controls. What’s surprising is how mobile versions of browsers render controls differently from their desktop counterparts. Read More »

Posted in Front-End Development | Tagged , , | Leave a comment

Make @font-face Work on Android Devices

If you use FontSquirrel to generate @font-face kits you may have noticed that they abandoned the Smiley method of generating CSS in favor of newer methods like FontSpring or Mo Bulletproofer. This is great because CSS generated by FontSquirrel will now successfully render fonts in browsers on Android devices. Read More »

Posted in Front-End Development, Quick Tips | Tagged , , | 5 Comments

Flash Developer Job Interview Questions

I recently changed jobs. I interviewed with multiple people at several companies over the course of a few weeks. In all, I talked to 20-30 people about Flash Developer positions. While the task of juggling multiple interviews while still working for my former employer was quite challenging, I have to say that I really enjoyed the interviews themselves. It was fun to meet new like-minded people and talk to them about the state of development. Read More »

Posted in Flash, General | Tagged , , | 1 Comment

Touch vs. Gesture

Thanks to devices like the Droid, Storm and iDevices the touch paradigm is much more familiar to users than it was a few years ago. That familiarity coupled with Flash Player 10.1’s multi-touch support means that Flash developers can finally develop apps tailored to touchscreen input. The prevalence of touchscreens has spawned a new vocabulary of input terms such as pinch, flick, swipe, touch and gesture among others. Some of those terms like “touch” and “gesture” are used interchangeably in generic discussions, but it’s important to know that they have very different meanings as far as ActionScript is concerned. Read More »

Posted in Flash | Tagged , , , , | 3 Comments