Created
January 21, 2014 16:00
-
-
Save will-in-wi/8542803 to your computer and use it in GitHub Desktop.
A test for starting at the right position on initial playback.
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Test time to duration</title> | |
<meta name="viewport" content="width=device-width, user-scalable=no" /> | |
<script src="script/soundmanager2.js"></script> | |
<script type="text/javascript"> | |
"use strict"; | |
soundManager.setup({ | |
url: 'swf/', | |
flashVersion: 9, // optional: shiny features (default = 8) | |
// optional: ignore Flash where possible, use 100% HTML5 mode | |
preferFlash: false, | |
onready: function() { | |
console.log('ready!!!'); | |
var sound = soundManager.createSound({ | |
id: 'testSound', | |
url: 'http://ondemand-http.stream.publicradio.org/minnesota/general/performances/2008/08/08/test13_20080808_64.mp3', | |
position: 10000 | |
}); | |
var start_link = document.querySelectorAll(".start")[0]; | |
start_link.addEventListener('click', function(e){ | |
e.preventDefault(); | |
sound.play(); | |
}); | |
} | |
}); | |
</script> | |
</head> | |
<body> | |
<a style="margin: 20px; display: block; border: 1px solid black; padding: 20px;" href="#" class="start">Start test</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment