mirror of
https://github.com/2ec0b4/kaamelott-soundboard.git
synced 2025-12-08 23:53:24 +00:00
Révise des noms d'attributs pour la gestion de la lecture
This commit is contained in:
@@ -7,17 +7,22 @@ define(
|
||||
"use strict";
|
||||
|
||||
var Sound = Backbone.Model.extend({
|
||||
audio: null,
|
||||
defaults: {
|
||||
title: "",
|
||||
character: "",
|
||||
file: ""
|
||||
},
|
||||
play: function() {
|
||||
var audio = new Audio('sounds/'+this.attributes.file);
|
||||
this.audio = new Audio('sounds/'+this.attributes.file);
|
||||
this.audio.play();
|
||||
|
||||
audio.play();
|
||||
|
||||
return audio;
|
||||
return this;
|
||||
},
|
||||
stop: function() {
|
||||
if( this.audio && !this.audio.paused ) {
|
||||
this.audio.pause();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user