Created
February 19, 2015 22:12
-
-
Save freewayspb/c2602fd2e5df89d5fca8 to your computer and use it in GitHub Desktop.
html5 audio examples
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
<audio id="audio_player" src="/mp3/foo.mp3" controls></audio> | |
$('#audio_player').trigger('load'); | |
$('#audio_player').trigger('play'); | |
$('#audio_player').trigger('pause'); | |
$('#audio_player').prop('currentTime', 0); | |
// forward and backward the audio | |
$('#audio_player').prop('currentTime', $('#audio_player').prop('currentTime') + 10); | |
$('#audio_player').prop('currentTime', $('#audio_player').prop('currentTime') - 10); | |
// increase and decrease volume | |
$('#audio_player').prop('volume') + 0.5; | |
$('#audio_player').prop('volume') - 0.5; | |
// mute volume | |
$('#audio_player').prop('muted',!$('#audio_player').prop('muted')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment