Skip to content

Instantly share code, notes, and snippets.

@will-in-wi
Created December 21, 2012 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save will-in-wi/4355041 to your computer and use it in GitHub Desktop.
Save will-in-wi/4355041 to your computer and use it in GitHub Desktop.
Example for streaming audio issue.
<!doctype html>
<html>
<head>
<title>This is an audio tag test.</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="soundmanager/script/soundmanager2.js"></script>
<script>
$(function(){
soundManager.setup({
url: 'soundmanager/swf/',
flashVersion: 9,
useFlashBlock: false,
onready: function() {
$('.fire3').click(function(e){
e.preventDefault();
var mySound = soundManager.createSound({
id: 'aSound',
url: 'http://currentstream1.publicradio.org/',
});
mySound.play();
});
$('.pause_sound').click(function(e){
e.preventDefault();
soundManager.destroySound('aSound');
});
}
});
});
</script>
</head>
<body>
<div>
<h1>Audio Tag Test</h1>
<a class="fire3" href="#">Fire</a>
<a class="pause_sound" href="#">Pause</a>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment