是否可以使用Google Web Toolkit播放声音通知,该声明将被翻译为Javascript?谢谢.
从GWT 2.2开始,您可以播放音频:com.google.gwt.media.client.Audio
class.
API:http: //google-web-toolkit.googlecode.com/svn/javadoc/2.2/com/google/gwt/media/client/Audio.html
样品:
private Audio mistakeAudio; { mistakeAudio = Audio.createIfSupported(); mistakeAudio.setSrc("style/failure.wav"); } public void mistakeSound(){ mistakeAudio.play(); }