OK, I’ve heard a lot of talk out there about how HTML5 will replace Flash and Silverlight. And the iPad is already dumping Flash. So, for those of us who use Flash for more than just video, how are we supposed to attach sounds to events with JavaScript?
Is there a JS API for accessing the audio in HTML5 that allows event based sound effects?
(before anyone suggests it, SoundManager embeds a flash sound player)
JavaScript can’t process sounds at all so you’ll have to use either the <audio> or <object> tag to embed them in the page or use the more user friendly method of attaching the sound files using the <a> tag.
Whatever you saw that suggested HTML 5 was going to be replacing anything was wrong. Flash is going to be used just as much in the future as it is now until something better comes along.
That iPad doesn’t support Flash has nothing to do with Flash being replaced, it has to do with conflicts that stop it being able to work properly and so Apple omitted it rather than have it cause the iPad to constantly crash.
That Google Chrome now has Flash built right into the browser clearly shows how Flash is going to be more relevant in the future rather than less.
iPad does not include flash because apple are trying to promote their own alternatives of quicktime and iTunes.
In the presentations he keeps mentioning that quicktime is superior to flash in every way… >_>
adobe is working on making flash work on iphone and ipad.
quote from Adrian Ludwig (adobe):
“It’s pretty clear if you connect the dots: the issue is about revenue,” says Adrian Ludwig, an Adobe group product manager for Flash, during a telephone interview on Friday afternoon.
“We’ve been seeing great performance on similar devices,” Ludwig said. “The hardware is very capable.”
But Ludwig notes that if Flash were available on the iPad, users could watch TV shows on Hulu for free instead of buying them through iTunes. Likewise, users could play some of the hundreds of Flash games on sites like Miniclip, instead of buying games through the App Store, on which Apple takes a 30% cut of every sale.
“Apple has eliminated any way to get content on the device that they don’t own,” says Ludwig. “Apple is keeping the device closed to protect their revenue streams.”
Ludwig notes that other companies’ technologies that could be used to serve content or games are also excluded — Java, Ruby, Python and .Net.
Ludwig says Adobe has been working closely with Apple on Flash for the iPhone (he didn’t say if or when it would ship), but wasn’t aware Apple had tested it on the iPad.
“We haven’t received any communication that they are testing Flash on the iPad or any feedback about its performance,” Ludwig says. “If there’s any truth that it’s buggy, I’d love to help them out.”
You can create new <audio> elements on the fly with the new Audio(src) constructor (or have <audio>s in the markup). You can then play() it in response to some event.
It uses the bgsound element which is supported by most browsers - though zcorpan’s method is much cleaner than this.
PS: I’ve seen the game Doom made entirely through HTML, CSS and JavaScript without Flash, anyone claiming HTML5 can’t eventually replace Flash doesn’t know what their talking about. I was pretty sceptical to start off with, but I’m seeing ever more complex uses of scripting to work around the need for Flash, and personally I like it. Flash is one of the biggest causes for the downfall of web accessibility and usability if you ask me, it’s about time we started trying to purge the proprietary.