Tutorial :How do you play music with javascript? [closed]


On the new Palm Pre everything is done via javascript etc. you can even use the camera and as I have heard play music. Is the second part also true for the desktop or is it a special webos/mojo feature?


You could use the HTML5 audio tag - not sure about browser support, but I bet that's how it's done on the pre.

http://www.w3schools.com/tags/html5_audio.asp has more info.


Historically there have been some ways to do it in the browser. A common way now is to use Flash There are ways for JavaScript to communicate with Flash). I'm not sure what Palm is doing for the Pre, but obviously they can set that up any way they like.


In a web browser, you can embed a music player using OBJECT tags. You can then control that music player using its DOM interface (which differs for each player; Windows Media Player; QuickTime player; Flash; etc). An alternative is to "start a new song" by using DHTML to re-write the music player element to reference a new piece of music.


jPlayer is a jQuery-based inline audio player: http://www.happyworm.com/jquery/jplayer/0.2.5/demos.htm

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »