Commit 5a70bf82 authored by marioromera's avatar marioromera
Browse files

try with window soundmanager

parent 15adbdce
......@@ -24,7 +24,8 @@
document.querySelector('.app').addEventListener('click', playSound, false);
function playSound(e) {
window.yourTurnAudio.play({ loops: 3, volume: 0 });
console.log('PLay sound', e);
window.yourTurnAudio.play({ loops: 3, volume: 100 });
}
</script>
</head>
......
......@@ -4,7 +4,6 @@ import { updateGossipData } from '../scuttlebutt';
import { state } from '../state';
import { Subject } from 'rxjs';
import { myTurnPathsData } from './myTurnPathData';
import { soundManager } from 'soundmanager2';
const MARGIN = 20;
const createEmptySession = () => ({
......@@ -31,7 +30,6 @@ export default function Drawing(svgId) {
this.myTurn = false;
this.$myTurn = new Subject();
this.myTurnG;
this.yourTurnAudio;
this.myTurnLine = this.line = d3
.line()
.curve(d3.curveStepBefore)
......@@ -82,8 +80,8 @@ export default function Drawing(svgId) {
if (myTurn) {
// AUDIO
if (window.yourTurnAudio) {
window.yourTurnAudio.setVolume('yourTurnAudio', 50);
if (window.soundManager) {
window.soundManager.setVolume('yourTurnAudio', 80);
}
letterCoords.forEach((letter) => {
......@@ -106,7 +104,7 @@ export default function Drawing(svgId) {
});
} else {
console.log('Finishing turn');
if (window.yourTurnAudio) window.yourTurnAudio.setVolume(0);
if (window.soundManager) soundManager.setVolume('yourTurnAudio', 0);
this.myTurnG.selectAll('path').remove();
}
});
......
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