Commit d307a99b authored by marioromera's avatar marioromera
Browse files

try looping your turn

parent e21e3c78
......@@ -4,9 +4,9 @@ import { updateGossipData } from '../scuttlebutt';
import { state } from '../state';
import { Subject } from 'rxjs';
import { myTurnPathsData } from './myTurnPathData';
import yourturnfile from '../../assets/yourturn.ogg';
var yourTurnAudio = new Audio(yourturnfile);
yourTurnAudio.loop = true;
var yourTurnAudio = soundManager.createSound({
url: './yourTurn.mp3',
});
const MARGIN = 20;
const createEmptySession = () => ({
......@@ -86,7 +86,7 @@ export default function Drawing(svgId) {
let duration = Math.round(yourTurnAudio.duration * 1000);
console.log('DURATION ', duration);
yourTurnAudio.play();
yourTurnAudio.play({ loops: 3 });
letterCoords.forEach((letter) => {
const bg = this.myTurnG
......@@ -109,7 +109,7 @@ export default function Drawing(svgId) {
} else {
console.log('Finishing turn');
yourTurnAudio.pause();
soundManager.stopAll();
this.myTurnG.selectAll('path').remove();
}
});
......
......@@ -18,23 +18,6 @@ import _ from 'lodash';
import Drawing from './components/drawing';
const draw = new Drawing('#drawing-svg');
import yourturnfile from '../assets/yourturn.ogg';
import { soundManager } from 'soundmanager2';
var yourTurnAudio = new Audio(yourturnfile);
const audioTrigger = document.querySelector('.audio-icon');
audioTrigger.addEventListener('click', playSound, false);
function playSound(e) {
e.preventDefault();
var mySound = soundManager.createSound({
url: './yourTurn.mp3',
});
mySound.play();
}
const idContainer = document
.querySelector('.id-container')
.getBoundingClientRect().height;
......
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