1
0
mirror of https://github.com/2ec0b4/kaamelott-soundboard.git synced 2025-12-10 00:15:34 +00:00

Améliore le modèle et la collection Sound

This commit is contained in:
Antoine
2016-04-11 23:45:10 +02:00
parent 878f37351f
commit bde2b12632
2 changed files with 17 additions and 5 deletions

View File

@@ -16,11 +16,12 @@ define(
},
play: function() {
if( !this.audio ) {
this.audio = new Audio('sounds/'+this.attributes.file);
this.audio = new Audio('sounds/'+this.get('file'));
}
this.audio.play();
this.attributes.playing = true;
this.set('playing', true);
},
stop: function() {
if( this.audio && !this.audio.paused ) {
@@ -28,7 +29,7 @@ define(
this.audio.load();
}
this.attributes.playing = false;
this.set('playing', false);
}
});