fixed audioplayer timertohide bug
This commit is contained in:
@@ -143,6 +143,7 @@
|
||||
this.launch();
|
||||
},
|
||||
launch(){
|
||||
this.clearTimeOutToHide();
|
||||
this.setSRC(this.historic[this.currentHistoricIndex].audio_url);
|
||||
this.loadNode(this.historic[this.currentHistoricIndex].nid);
|
||||
// emmit new playing doc (e.g.: corpus map nowing that audio played from RandomPlayer)
|
||||
@@ -157,7 +158,6 @@
|
||||
// audio functions
|
||||
setSRC(url){
|
||||
// console.log('AudioPlayer setSRC : url', url);
|
||||
this.clearTimeOutToHide();
|
||||
this.audio.src = url;
|
||||
},
|
||||
onLoadedmetadata(){
|
||||
@@ -207,6 +207,7 @@
|
||||
}
|
||||
},
|
||||
stop(){
|
||||
console.log('AudioPlayer stop()');
|
||||
this.audio.pause();
|
||||
this.timeOutToHide();
|
||||
},
|
||||
@@ -268,15 +269,19 @@
|
||||
}
|
||||
},
|
||||
timeOutToHide(){
|
||||
console.log('AudioPlayer timeOutToHide()');
|
||||
this.clearTimeOutToHide();
|
||||
this.hideTimer = setTimeout(this.hide.bind(this), this.hideTimeMS);
|
||||
},
|
||||
clearTimeOutToHide(){
|
||||
console.log('AudioPlayer clearTimeOutToHide()',this.hideTimer);
|
||||
if(this.hideTimer){
|
||||
clearTimeout(this.hideTimer);
|
||||
this.hideTimer = false;
|
||||
}
|
||||
},
|
||||
hide(){
|
||||
console.log('AudioPlayer hide()');
|
||||
this.$container.removeClass('visible');
|
||||
// trigger highlighted node remove on corpus map
|
||||
_$corpus_canvas.trigger('audio-node-closed');
|
||||
@@ -578,7 +583,7 @@
|
||||
this.active = _audio_player.shuffle_is_active = false;
|
||||
this.$btn.removeClass('is-active');
|
||||
// stop audio player
|
||||
_audio_player.stop();
|
||||
// _audio_player.stop();
|
||||
},
|
||||
next(){
|
||||
if(this.active && this.shuffledPlaylist.length > 0)
|
||||
|
||||
@@ -143,6 +143,7 @@
|
||||
this.launch();
|
||||
},
|
||||
launch(){
|
||||
this.clearTimeOutToHide();
|
||||
this.setSRC(this.historic[this.currentHistoricIndex].audio_url);
|
||||
this.loadNode(this.historic[this.currentHistoricIndex].nid);
|
||||
// emmit new playing doc (e.g.: corpus map nowing that audio played from RandomPlayer)
|
||||
@@ -157,7 +158,6 @@
|
||||
// audio functions
|
||||
setSRC(url){
|
||||
// console.log('AudioPlayer setSRC : url', url);
|
||||
this.clearTimeOutToHide();
|
||||
this.audio.src = url;
|
||||
},
|
||||
onLoadedmetadata(){
|
||||
@@ -207,6 +207,7 @@
|
||||
}
|
||||
},
|
||||
stop(){
|
||||
console.log('AudioPlayer stop()');
|
||||
this.audio.pause();
|
||||
this.timeOutToHide();
|
||||
},
|
||||
@@ -268,15 +269,19 @@
|
||||
}
|
||||
},
|
||||
timeOutToHide(){
|
||||
console.log('AudioPlayer timeOutToHide()');
|
||||
this.clearTimeOutToHide();
|
||||
this.hideTimer = setTimeout(this.hide.bind(this), this.hideTimeMS);
|
||||
},
|
||||
clearTimeOutToHide(){
|
||||
console.log('AudioPlayer clearTimeOutToHide()',this.hideTimer);
|
||||
if(this.hideTimer){
|
||||
clearTimeout(this.hideTimer);
|
||||
this.hideTimer = false;
|
||||
}
|
||||
},
|
||||
hide(){
|
||||
console.log('AudioPlayer hide()');
|
||||
this.$container.removeClass('visible');
|
||||
// trigger highlighted node remove on corpus map
|
||||
_$corpus_canvas.trigger('audio-node-closed');
|
||||
@@ -578,7 +583,7 @@
|
||||
this.active = _audio_player.shuffle_is_active = false;
|
||||
this.$btn.removeClass('is-active');
|
||||
// stop audio player
|
||||
_audio_player.stop();
|
||||
// _audio_player.stop();
|
||||
},
|
||||
next(){
|
||||
if(this.active && this.shuffledPlaylist.length > 0)
|
||||
|
||||
Reference in New Issue
Block a user