|
|
@ -809,7 +809,7 @@ div#large-visualization{
|
|
|
|
removeSongTime(songId){
|
|
|
|
removeSongTime(songId){
|
|
|
|
|
|
|
|
|
|
|
|
if(localStorage){
|
|
|
|
if(localStorage){
|
|
|
|
let songTimes=localStorage.songTimes;
|
|
|
|
var songTimes=localStorage.songTimes;
|
|
|
|
if(!songTimes){
|
|
|
|
if(!songTimes){
|
|
|
|
songTimes={};
|
|
|
|
songTimes={};
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
@ -825,7 +825,7 @@ div#large-visualization{
|
|
|
|
,saveSongTime(songId,time){
|
|
|
|
,saveSongTime(songId,time){
|
|
|
|
|
|
|
|
|
|
|
|
if(localStorage){
|
|
|
|
if(localStorage){
|
|
|
|
let songTimes=localStorage.songTimes;
|
|
|
|
var songTimes=localStorage.songTimes;
|
|
|
|
if(!songTimes){
|
|
|
|
if(!songTimes){
|
|
|
|
songTimes={};
|
|
|
|
songTimes={};
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
@ -840,8 +840,8 @@ div#large-visualization{
|
|
|
|
getSavedSongTime(){
|
|
|
|
getSavedSongTime(){
|
|
|
|
|
|
|
|
|
|
|
|
if(localStorage){
|
|
|
|
if(localStorage){
|
|
|
|
let song=Amplitude.getActiveSongMetadata();
|
|
|
|
var song=Amplitude.getActiveSongMetadata();
|
|
|
|
let songTimes=localStorage.songTimes;
|
|
|
|
var songTimes=localStorage.songTimes;
|
|
|
|
if(!songTimes){
|
|
|
|
if(!songTimes){
|
|
|
|
songTimes={};
|
|
|
|
songTimes={};
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
@ -855,8 +855,8 @@ div#large-visualization{
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
changeSpeed(){
|
|
|
|
changeSpeed(){
|
|
|
|
let currentSpeedIndex= this.speedOptions.indexOf(this.speed);
|
|
|
|
var currentSpeedIndex= this.speedOptions.indexOf(this.speed);
|
|
|
|
let nextIndex=0;
|
|
|
|
var nextIndex=0;
|
|
|
|
if(currentSpeedIndex===-1 || currentSpeedIndex===this.speedOptions.length-1){
|
|
|
|
if(currentSpeedIndex===-1 || currentSpeedIndex===this.speedOptions.length-1){
|
|
|
|
nextIndex=0;
|
|
|
|
nextIndex=0;
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
@ -867,7 +867,7 @@ div#large-visualization{
|
|
|
|
},
|
|
|
|
},
|
|
|
|
getSongsFromItems(items){
|
|
|
|
getSongsFromItems(items){
|
|
|
|
return items.map(x=>{
|
|
|
|
return items.map(x=>{
|
|
|
|
let toReturn= {
|
|
|
|
var toReturn= {
|
|
|
|
id:x.ID,
|
|
|
|
id:x.ID,
|
|
|
|
name:x.Title,
|
|
|
|
name:x.Title,
|
|
|
|
url:x.DownloadPath,
|
|
|
|
url:x.DownloadPath,
|
|
|
@ -882,7 +882,7 @@ div#large-visualization{
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
getFormattedLastEpisodeDate(item){
|
|
|
|
getFormattedLastEpisodeDate(item){
|
|
|
|
let dt=new Date(Date.parse(item.PubDate.substr(0,10)));
|
|
|
|
var dt=new Date(Date.parse(item.PubDate.substr(0,10)));
|
|
|
|
return dt.toDateString()
|
|
|
|
return dt.toDateString()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
formatDuration(total) {
|
|
|
|
formatDuration(total) {
|
|
|
@ -933,7 +933,7 @@ div#large-visualization{
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted(){
|
|
|
|
mounted(){
|
|
|
|
let volume=50;
|
|
|
|
var volume=50;
|
|
|
|
if(localStorage?.playerVolume){
|
|
|
|
if(localStorage?.playerVolume){
|
|
|
|
volume=parseInt(localStorage.playerVolume)
|
|
|
|
volume=parseInt(localStorage.playerVolume)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -961,7 +961,7 @@ div#large-visualization{
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
'timeupdate':function(){
|
|
|
|
'timeupdate':function(){
|
|
|
|
|
|
|
|
|
|
|
|
let secs=Math.floor(Amplitude.getSongPlayedSeconds());
|
|
|
|
var secs=Math.floor(Amplitude.getSongPlayedSeconds());
|
|
|
|
if(secs%10===0){
|
|
|
|
if(secs%10===0){
|
|
|
|
song=Amplitude.getActiveSongMetadata();
|
|
|
|
song=Amplitude.getActiveSongMetadata();
|
|
|
|
if(Amplitude.getSongPlayedPercentage()>20){
|
|
|
|
if(Amplitude.getSongPlayedPercentage()>20){
|
|
|
@ -1025,7 +1025,7 @@ div#large-visualization{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let songElements = document.getElementsByClassName('song');
|
|
|
|
var songElements = document.getElementsByClassName('song');
|
|
|
|
|
|
|
|
|
|
|
|
for( var i = 0; i < songElements.length; i++ ){
|
|
|
|
for( var i = 0; i < songElements.length; i++ ){
|
|
|
|
songElements[i].addEventListener('click', function(){
|
|
|
|
songElements[i].addEventListener('click', function(){
|
|
|
@ -1033,11 +1033,11 @@ for( var i = 0; i < songElements.length; i++ ){
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let markedAsPlayed=[];
|
|
|
|
var markedAsPlayed=[];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function markSongAsPlayed(id) {
|
|
|
|
function markSongAsPlayed(id) {
|
|
|
|
let endpoint = "markPlayed";
|
|
|
|
var endpoint = "markPlayed";
|
|
|
|
if(markedAsPlayed.indexOf(id)!==-1){
|
|
|
|
if(markedAsPlayed.indexOf(id)!==-1){
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|