Comunidad de diseño web y desarrollo en internet online

problema con video, Netstream, NetConnection, etc

Citar            
MensajeEscrito el 08 Jun 2009 11:56 pm
tengoun problema que no he podido solucionar.

les cuento, tengo un video flv, el cual obviamente por su peso y duracion hago un buffer y cuando finaliza doy la opcion de un replay. Hasta ahi ningun problema, lo que no puedo hacer es que el video, luego que haga el buffer NO haga Autoplay y a su vez aparezca un boton de Play. este es el codigo que estoy usando

Código ActionScript :

var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);

theVideo.attachVideo(ns);

ns.setBufferTime(20);

ns.onStatus = function(info) {
   trace(info.code);
   if(info.code == "NetStream.Buffer.Full") {
      bufferClip._visible = false;
   }
   if(info.code == "NetStream.Buffer.Empty") {
      bufferClip._visible = true;
   }
   if(info.code == "NetStream.Play.Start") {
      replayClip._visible = false;
   }
   if(info.code == "NetStream.Play.Stop") {
      replayClip._visible = true;
   }
}

ns.play("http://www.MYVIDEO.flv");



playButton.onRelease = function() {
   ns.pause();
}

rewindButton.onRelease = function() {
   ns.seek(0);
}


   
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 * 293;
   loader.scrub._x = ns.time / duration * 293;
}

var scrubInterval;

loader.scrub.onPress = function() {
   clearInterval(videoInterval);
   scrubInterval = setInterval(scrubit,10);
   this.startDrag(false,0,this._y,293,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/293)*duration));
}



stop();

   
   


alguien sabe como lograrlo??

Por sebauribarri

0 de clabLevel



 

safari
Citar            
MensajeEscrito el 09 Jun 2009 10:59 am
Le estas dando un play por defecto para iniciar la descarga ... pero dale un pause inmediatamente para que no reproduzca

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox

 

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