Browse Source

Fixed issues/14

Fechin 6 years ago
parent
commit
44f513393e
1 changed files with 6 additions and 4 deletions
  1. 6 4
      source/js/diaspora.js

+ 6 - 4
source/js/diaspora.js

@@ -137,15 +137,17 @@ var Diaspora = {
             })
             return
         }
-        if (p.eq(0).data("autoplay") == true) {
-            p[0].play();
-        }
-        if (p[0].src == ''){
+        var sourceSrc= $("#audio source").eq(0).attr('src')
+        if (sourceSrc == '' && p[0].src == ''){
             audiolist = $('#audio-list li');
             mp3 = audiolist.eq([Math.floor(Math.random() * audiolist.size())])
             p[0].src = mp3.data('url')
         }
 
+        if (p.eq(0).data("autoplay") == true) {
+            p[0].play();
+        }
+
         p.on({
             'timeupdate': function() {
                 var progress = p[0].currentTime / p[0].duration * 100;