Code: Select all
var playStartTime;
var myCurentTime;
var tsFileLength;
var myPlayListItem;
function Play(uri, name, options) {
//my be after playList clear and waiting...
PlayListItem=vlc.playlist.add(uri, name, options);
setTimeout("PlayStart()",350);
}
function PlayStart(){
vlc.playlist.playItem(myPlayListItem);
var tStart=new Date();
playStartTime=tStart.getTime();
myCurentTime=0;
}
function VLCTimer(){
........
if(vlc.input.length){ // good file
tsFileLength=vlc.input.length;
}else{ // .st file or streem
tsFileLength=0; // default/unavailable
if(vlc.input.position>0.1){ // if time after start is low, precision of tsFileLength will be wery poor...
var tCurent=new Date();
myCurentTime=tCurent.getTime()-playStartTime;
tsFileLength=myCurentTime/vlc.input.position;
}
}
if(tsFileLength){
HTMLonPageIndicator.innerHTML=formatTime(tsFileLength);
}else{
HTMLonPageIndicator.innerHTML="Length unavailable";
}
}
setInterval("VLCTimer",1000);
Users browsing this forum: No registered users and 14 guests