summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/sound.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/static/sound.js b/static/sound.js
index 07366ff..85386ce 100644
--- a/static/sound.js
+++ b/static/sound.js
@@ -21,7 +21,7 @@ function playsound(model) {
slider = $('#progress').slider({
max: sound.duration,
slide: function(event, ui) {
- if(event.originalEvent)
+ if(event.originalEvent && sound)
sound.setPosition(ui.value);
}
});
@@ -46,6 +46,10 @@ function playsound(model) {
var next = playlist.next();
if(next) {
playsound(next, $('#cid-' + next.cid));
+ } else {
+ sound.stop();
+ sound.destruct();
+ sound = null;
}
}
});