summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2012-12-16 14:04:41 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2012-12-16 14:04:41 +0100
commita349dbd927a7f60b95b30d7c25382a52d332a052 (patch)
tree48a52241d90cbce50cf1e77b24cb0bc6945bf8f3 /static
parent0e7825dec21ee3d70a6584eb210e255a2e34182d (diff)
Destroy sound object when done playing.
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;
}
}
});