Comunidad de diseño web y desarrollo en internet online

formato de tiempo de video player

Citar            
MensajeEscrito el 25 Oct 2010 05:29 pm
hola amigos tengo una consulta que no hayo como

el tiempo de duracion de mi video es 451.7

stream.onMetaData = function(obj) {
duration = obj.duration; // 451.7
}

convertido a 00:00:00 me debe dar 07 min 31 seg ...
pero no se como convertir 451.7 es este formato de tiempo :oops:

estoy intentando una :
function timeformat () {
tiempo = duration/60; pues me da 7, pero
// como obtebgo los segs etc...
return timeformatStr;
}

algo asi....

Por comicSans

Claber

151 de clabLevel



 

firefox
Citar            
MensajeEscrito el 25 Oct 2010 06:20 pm
Ya esta!

Código :

onEnterFrame = function () {
   time_txt.text = "00:00 | " + timeFormat(stream.time) + " | " + timeFormat(duration);
};
// duration to time 00:00
function timeFormat(param) {
   var timeToFormat:Number = param
   var min:Number = Math.floor(param/60);
   var seg:Number = Math.floor(((param/60) - min) * 60);
   var tf:String = (min<10) ? '0'+min : min;
   tf += ':';
   tf += (seg<10) ? '0'+seg : seg;
   return tf;
}
...creo ;)

Por comicSans

Claber

151 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.