Commit 43f14780 authored by marioromera's avatar marioromera
Browse files

add soundmanager before DOM load

parent 3b0f97be
......@@ -7,6 +7,24 @@
user-scalable=0" />
<title>POC_WORKSHOP</title>
<link rel="shortcut icon" href="./favicon.ico" />
<script src="./soundmanager2-jsmin.js"></script>
<script>
soundManager.setup({
url: '/path/to/swf-files/',
debugMode: true,
onready: function () {
var mySound = soundManager.createSound({
id: 'aSound',
url: '/yourTurn.mp3'
});
mySound.play();
},
ontimeout: function () {
// Hrmm, SM2 could not start. Missing SWF? Flash blocked? Show an error, etc.?
}
});
</script>
</head>
<body>
......
This diff is collapsed.
......@@ -29,16 +29,10 @@ audioTrigger.addEventListener('click', playSound, false);
function playSound(e) {
e.preventDefault();
soundManager.setup({
url: '/swf/',
onready: function () {
console.log('soundready');
var mySound = soundManager.createSound({
url: './yourturn.mp4',
});
mySound.play();
},
var mySound = soundManager.createSound({
url: './yourturn.mp3',
});
mySound.play();
}
const idContainer = document
......
......@@ -19,6 +19,7 @@ const plugins = [
new CopyPlugin([
{ from: 'public/yourturn.ogg' },
{ from: 'public/swf', to: 'swf' },
{ from: 'public/soundmanager2-jsmin.js' },
]),
];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment