December 2011
2 posts
4 tags
Introducing filer.js
Some 1300+ lines of code, 106 tests, and a year after I first started it, I’m happy to officially unleash filer.js (https://github.com/ebidel/filer.js); a wrapper library for the HTML5 Filesystem API. Unlike other libraries [1, 2], filer.js takes a different approach and incorporates some lessons I learned while implementing the Google Docs Python client library. Namely, the library...
Dec 27th
40 notes
3 tags
Making file inputs a pleasure to look at
I’ve seen a lot of people ask how to 1.) apply custom styles to a <input type="file"> and 2.) programmatically open the browser’s file dialog with JavaScript. Turns out, the first is a cinch WebKit. The second comes with a couple of caveats. If you want to skip ahead, there’s a demo. Custom file inputs in WebKit The first example on that demo page shows how to style...
Dec 22nd
15 notes
November 2011
1 post
3 tags
Web Audio API how-to: Playing audio based on user...
One thing the Web Audio API does particularly well is play sound. Of course, this is something you’d expect from an audio API :). That said, the API is complex and it’s not immediately obvious on the best way to do something simple like load a sound file and play it based on a button click. That task alone can involve a number of new platform features likes XHR2, FileReader API, and...
Nov 28th
1 note
August 2011
1 post
4 tags
Reading .mp3 ID3 tags in JavaScript
For a recent project, I needed to read an .mp3’s ID3 metadata (song title, artist, year, album) in pure JS. The idea was to have the user select a song file, and boom!, its info would display to the user. Good news…totally easy with the FileReader API and JS typed arrays. Initially, I did a quick search to find some examples, but all of the examples I found used older techniques like...
Aug 1st
3 notes
July 2011
1 post
3 tags
Jul 28th
7 notes