Created
June 27, 2012 09:42
-
-
Save benbai123/3003008 to your computer and use it in GitHub Desktop.
Play HTML5 audio in ZK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<zk xmlns:h="xhtml"> | |
<window border="normal"> | |
<h:audio id="audio" src="test.mp3" controls="controls" | |
preload="auto" autoplay="autoplay"> | |
Your browser does not support the audio element. | |
</h:audio> | |
<button label="Play"> | |
<attribute name="onClick"> | |
Clients.evalJavaScript("jq('$audio')[0].play()"); | |
</attribute> | |
</button> | |
<button label="Stop"> | |
<attribute name="onClick"> | |
Clients.evalJavaScript("jq('$audio')[0].pause()"); | |
</attribute> | |
</button> | |
</window> | |
</zk> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment