').html('Shuffle').addClass('random-player-btn');this.init();};RandomPlayer.prototype={init(){$('').addClass('block random-player').append(this.$btn).prependTo('.region-footer-right');this.$btn.on('click',this.toggleActive.bind(this));_audioPlayer.on('audio-ended',this.onAudioPlayerEnded.bind(this)).on('audio-play-next',this.onAudioPlayNext.bind(this)).on('stop-shuffle',this.stop.bind(this));_$corpus_canvas.on('update-random-playlist',this.updatePlaylist.bind(this));},updatePlaylist(e){this.playlist=e.playlist;this.shuffle();},shuffle(){var tempPLaylist=[];for(var i=this.playlist.length-1;i>=0;i--){tempPLaylist.push(this.playlist[i]);}
diff --git a/sites/all/themes/custom/edlptheme/assets/scripts/main.js b/sites/all/themes/custom/edlptheme/assets/scripts/main.js
index 19b23437a..41a23218d 100644
--- a/sites/all/themes/custom/edlptheme/assets/scripts/main.js
+++ b/sites/all/themes/custom/edlptheme/assets/scripts/main.js
@@ -128,7 +128,7 @@
// entrees
// TODO: center the entrees menu
-
+
};
@@ -970,12 +970,11 @@
var promise = this.audio.play();
// console.log('promise', promise);
if (promise !== undefined) {
- promise.catch(error => {
+ promise.catch(function(error){
// Auto-play was prevented
// Show a UI element to let the user manually start playback
console.warn('autoplay failed, ask for playing', error);
-
- }).then(() => {
+ }).then(function(){
// Auto-play started
console.log('autoplay succeed');
});