views:

305

answers:

1

Mozilla Developer Center's HTML5 media guide describes an event for audio and video elements called "loadedmetadata". Is there anyway to get the metadata for files? I am writing an HTML5 extension for Google Chrome and I don't know what the metadata for the audio files I'm creating a player for beforehand.

Edit: This question seems to be kicking everyone's ass. :/

+1  A: 

According to this you can use filereader.readAsBinaryString(file); to get the binary data of the ID3 tag.

filereader.readAsBinaryString(file); will asynchronously return a binary string with each byte represented by an integer in the range [0..255]. This is useful for binary manipulations of a file’s data, for example to look for ID3 tags in an MP3 file, or to look for EXIF data in a JPEG image.

Mendy
That's brilliant.
apphacker
Hrm, I have to check to see if chrome has this.
apphacker
Aha, you are correct on the binary stuff though, this will work:http://blog.nihilogic.dk/2008/08/reading-id3-tags-with-javascript.htmlbut faces cross-domain issues
apphacker