Last active
December 15, 2015 09:09
-
-
Save amiika/5235833 to your computer and use it in GitHub Desktop.
HTML5 Audio controls
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>HTML5 audio test</title> | |
</head> | |
<body> | |
<h1>Grateful Dead Live at Barton Hall - Cornell University on May 8, 1977</h1> | |
<h2>ST Stephen</h2> | |
<audio id="mySong" controls preload autoplay> | |
<source src="http://archive.org/download/gd1977-05-08.shure57.stevenson.29303.flac16/gd1977-05-08d03t01.ogg"> | |
<source src="http://archive.org/download/gd1977-05-08.shure57.stevenson.29303.flac16/gd1977-05-08d03t01_64kb.mp3"> | |
Your browser does not support the audio element. | |
</audio> | |
<p>Audio from played from the <a href="http://archive.org/details/gd1977-05-08.shure57.stevenson.29303.flac16">Internet Archive</a></p> | |
</body> | |
<script> | |
var mySong = document.getElementById('mySong'); | |
mySong.addEventListener('canplay', function() { | |
mySong.currentTime = 70; | |
}, false); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment