estoy haciendo una pagina con videos, y me arme mi flv player ya tengo todos los controles y funciona todo bien pero, lo que me falta es un reloj abajo( como el del youtube) que diga cuantos minutos y segundos tiene la peli, y cuantos minutos y segundos han transcurrido de la peli.
me ayudaria nucho que alguien me escribiera el codigo para hacerlo.
aqui va el script que tengo hasta ahora (el cual esta perfecto pero lo pongo para que tengan una idea de lo que estoy haciendo).
Código :
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(30);
ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}
if(info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
}
suono = newSound("Stream.flv")
suono.setVolume(1)
thevideo.attachVideo(ns);
ns.play("YoNad.flv");
rewind.onRelease = function() {
ns.seek(0);
}
playb.onRelease = function() {
ns.pause();
}
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj){
duration = obj.duration;
}
function videoStatus(){
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 256 ;
loader.scrub._x = ns.time / duration * 256 ;
}
var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval)
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,0,this._y,256,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}
function scrubit () {
ns.seek(Math.floor((loader.scrub._x/256) *duration));
}
gracias a todos de anticipado.
