The client-side player is implementd using ‘gwt-sound’, which in turn uses ‘SoundManager 2’ Javascript wrapping and extending Flash 8’s sound API.
gwt-sound:
http://code.google.com/p/gwt-sound/
Yep! Actually that was the thing that originally inspired me.
I noticed that there were no good samples showing how to play sounds in a IT Mill Toolkit application, so I put all the small things together into this sample.
I’ll have to talk with Jouni about back-end logic integration
i try to import the soundplayer into my vaadin application, but is doesn’t work. i like to play sound when the user click on a button. This is my code:
This probably does not work. The String parameter should represent an valid URL to a mp3 file. You can test it for validity by copy-pasting to the browser address - a download dialog or an embedded player should pop up. Maybe local URLs like file://… work, but haven’t tested that.
Which browser you are using? The demo seems to play ok at least with Firefox 3.6, Chrome 5.0 and Safari 4.0.5. Demo should start playing immediately when a song is selected. The mp3s are streamed directly from creativecommons.org.
Don’t seem to be able to play any mp3 in my app in any browser on either Mac or Win Vista. Your sample application works for me, but my app does not, using your code example. Maybe missing some dependency?
Solved my own problem: apparently the soundplayer component needs to be a direct child of the main window, not nested within some other panel. Hope this helps someone else.
Hmm… an interesting finding. Haven’t realized that before and can’t think of any reason why it behaves like this. Anyway, good to know there is a workaround.
At first: I like this addon. Gives my application the touch it separates from others when playing background music
And thanks Mike Bailey for your workaround, I’ve found the same issue and managed myself to do the same workaround, and now I am sure that not my app was the problem
@Sami Ekblad
I’ve got into troubles to use the SoundPlayer within GAE when trying to use the SoundPlayer.StateChangeListener. Because this interface does not implement Serializable, it is will always generate a NotSerializableException in Class where the anonymous inner class SoundPlayer.StateChangeListener is declared.