diff --git a/resources/js/views/player.js b/resources/js/views/player.js index 6711298..bd2228f 100644 --- a/resources/js/views/player.js +++ b/resources/js/views/player.js @@ -58,7 +58,7 @@ _ , playIndex: [] - , playCursor: 0 + , playCursor: -1 , webAudio: null @@ -194,11 +194,13 @@ _ var that = this ; - if (that.webAudio._state === that.webAudio._states.loading) { + if (that.webAudio._state === that.webAudio._states.paused) { + that.webAudio._state = that.webAudio._states.stopped; that._playerStop(); } if (that.webAudio._state < that.webAudio._states.loading) { + console.debug("Setting Play Index"); that._playIndex = index; that._playCursor = cursor || 0; @@ -224,12 +226,20 @@ _ ; if (random === true) { - that._playIndexOrdered = that._playIndex; + //var previousItem = that._playIndex[that._playCursor]; + that._playIndexOrdered = _.clone(that._playIndex); that._playIndex.shuffle(); // TODO: Set cursor back to the item that was playing + //if (that._playCursor !== -1 && that.webAudio._state >= that.webAudio._states.loading) { + // var newCursor = + //} + + that._playCursor = -1; } else { - that._playIndex = that._playIndexOrdered; + that._playIndex = _.clone(that._playIndexOrdered); + + delete that._playIndexOrdered; } return that._stateRandom = random; @@ -526,7 +536,7 @@ _ that.webAudio.obj.src = ""; that.webAudio.obj.innetHTML = ""; - that._playCursor = 0; + that._playCursor = -1; that._setViewport(); } diff --git a/resources/templates/app/modal-about.html b/resources/templates/app/modal-about.html index 275ef75..12a29fa 100644 --- a/resources/templates/app/modal-about.html +++ b/resources/templates/app/modal-about.html @@ -23,4 +23,4 @@ - + \ No newline at end of file diff --git a/resources/templates/app/modal-fatal.html b/resources/templates/app/modal-fatal.html index e142699..8e78a2e 100644 --- a/resources/templates/app/modal-fatal.html +++ b/resources/templates/app/modal-fatal.html @@ -14,4 +14,4 @@ - + \ No newline at end of file diff --git a/resources/templates/list/modal-item-details.html b/resources/templates/list/modal-item-details.html index 825c57d..60275f5 100644 --- a/resources/templates/list/modal-item-details.html +++ b/resources/templates/list/modal-item-details.html @@ -27,4 +27,4 @@ - + \ No newline at end of file