|
|
|
@ -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();
|
|
|
|
|
}
|
|
|
|
|