hi all and -dt-
can you change some codes in api.js for real time progress bar
code:
var currentSong = {"Title" : "", "Artist" : ""};
var songChangeUsers = 0;
var currentTimer = false;
var currentPlayer = false;
var currentStatus = -1;
var currentSongPosition = -1;
var currentPlayerName;
var isOpen = false;
function songChangeCheck(){
var playerName = prefs.get("default/player");
if(currentPlayerName != playerName){
if(currentPlayer){
destoryGlobalPlayer(currentPlayerName);
currentPlayer = false;
currentPlayerName = playerName;
}
}
if(!currentPlayer)currentPlayer = getGlobalPlayer(playerName);
if(currentPlayer.isOpen()){
isOpen = true;
var current = currentPlayer.CurrentTrack();
//Debug.Trace(current.Title + "-" + current.Artist);
if(currentSong.Title == current.Title && currentSong.Artist == current.Artist){
//return
}else{
currentSong = current;
triggerEvent("songChange", playerName, currentPlayer, currentSong);
}
var currentS = currentPlayer.Status();
var position = currentPlayer.SongPosition();
if(currentS == currentStatus && currentSongPosition == position)
{
//return
}else{
currentSongPosition = position;
currentStatus = currentS;
triggerEvent("songStatusChanged", playerName, currentPlayer, currentStatus);
}
}else{
destoryGlobalPlayer(playerName);
currentPlayer = false;
if(isOpen){
triggerEvent("songStatusChanged", "", "", 0);
triggerEvent("playerClosed", playerName);
isOpen = false;
currentSong = {"Title" : "", "Artist" : ""};
}
}
}
And attachment is turkish language please add new versions
Edit: attachment file updated see my next post