Comunidad de diseño web y desarrollo en internet online

E aqui mi reproductor de video

Citar            
MensajeEscrito el 22 Abr 2007 07:14 pm
Hola foro!

Miren despues de meses de investigar, testear, bla bla bla... por fin me avente mi reproductor de video con streaming...

Se los dejo por aqui la URL http://gngc.bravehost.com/videos/id004/skvideo.html pero si tienen la amabilidad de apreciar el reproductor se daran cuenta que la barra de desplazamiento no re produce el video si lo mueves de un lado para otro... Pues si alguien me pudiera ayudar en eso. los codigos los tome de aqui, de alla, los adapte en fin.

Código :

[size=9]//--> 
//-->
archivo = "skvideo.txt";
var video_tmp;
var carga:LoadVars = new LoadVars();
carga.html = true;
carga.onLoad = function(ok) {
   if (ok) {
      video_tmp = eval("carga.id");
      //--> 
      //-->
      var conexion:NetConnection = new NetConnection();
      conexion.connect(null);
      var stream:NetStream = new NetStream(conexion);
      mi_video.attachVideo(stream);
      streem.setBufferTime(5);
      stream.play(video_tmp);
      stream.pause();
      stream.seek(0);
      //--> 
      //-->
      var duracion, xduracion, yduracion, xsegundo;
      stream.onMetaData = function(MD:Object):Void  {
         duracion = MD.duration;
         xduracion = Math.round((duracion*100)/100);
         if (xduracion<60) {
            duracion2_txt.text = "00:"+xduracion;
         } else {
            yduracion = Math.round(((xduracion/60)*100)/100);
            xsegundo = Math.round((duracion-(yduracion*60))*100/100);
            if (xsegundo<10) {
               duracion2_txt.text = "0"+yduracion+":0"+xsegundo;
            } else {
               duracion2_txt.text = "0"+yduracion+":"+xsegundo;
            }
         }
      };
      //--> 
      //-->
      var TTranscurrido;
      onEnterFrame = function () {
         TTranscurrido = Math.round((stream.time*100)/100);
         var minutos = Math.round(((TTranscurrido/60)*100)/100);
         var minseg = ((minutos*60)-TTranscurrido)*(-1);
         if (TTranscurrido<10) {
            duracion_txt.text = "00:0"+TTranscurrido;
         } else {
            if (TTranscurrido<60) {
               duracion_txt.text = "00:"+TTranscurrido;
            } else {
               if (minutos<1) {
                  duracion_txt.text = "00:"+TTranscurrido;
               } else {
                  if (minseg<10) {
                     duracion_txt.text = "0"+minutos+":0"+minseg;
                  } else {
                     duracion_txt.text = "0"+minutos+":"+minseg;
                  }
               }
            }
         }
         //-->
         BTV = stream.bytesTotal;
         BCV = stream.bytesLoaded;
      };
      posbar = _root.trakbar._x;
      posbar_txt.text = posbar;
      //--> 
      //-->
      var pausa:Number = 0;
      var estado:Number = 1;
      btn_play.onPress = function() {
         clearInterval(TrackBarIntervalo);
         //-----------------------
         TrackBarIntervalo = setInterval(moviendoTrackBar, 100);
         function moviendoTrackBar() {
            var posbar2 = TTranscurrido*300/duracion;
            trakbar._x = posbar2+posbar;
            if (Math.round(TTranscurrido) == Math.round(duracion) && TTranscurrido>0 && duracion>0) {
               estado = 1;
               rep.gotoAndStop("play");
               stream.seek(0);
               stream.pause();
            }
         }
         //-----------------------
         function posicionaVideo() {
            pos = (duracion*(trakbar._x-posbar))/300;
            stream.seek(pos);
         }
         //-----------------------
         if (estado == 1) {
            estado = 2;
            stream.pause();
            rep.gotoAndStop("pausa");
         } else {
            estado = 1;
            stream.pause();
            rep.gotoAndStop("play");
         }
      };
      //-->
      //-->
      _root.trakbar.onPress = function() {
         clearInterval(TrackBarIntervalo);
         intervalPos = setInterval(_root, "posicionaVideo", 10);
         startDrag(this, true, pos, this._y, 300+28, this._y);
      };
      _root.trakbar.onRelease = function() {
         clearInterval(intervalPos);
         TrackBarIntervalo = setInterval(_root, "TrackBarIntervalo", 100);
         stopDrag();
      };
      _root.trakbar.onReleaseOutside = function() {
         clearInterval(intervalPos);
         TrackBarIntervalo = setInterval(_root, "TrackBarIntervalo", 100);
         stopDrag();
      };
      //-->
   }
   //-->      
   var hiloprecarga = setInterval(cargando, 100);
   function cargando() {
      porcentaje = Math.floor((BCV*100)/BTV);
      bar_load.gotoAndStop(porcentaje);
      gbl_txt.text = BCV;
      gbt_txt.text = BTV;
      if (BCV == BTV) {
         bar_load.gotoAndStop(100);
         clearInterval(hiloprecarga);
      }
   }
   //-->
};
//-->
carga.load(archivo);
//-->[/size]

Bien, pues yo me tomo la ruta del video de un archivo externo como veran y de ahi comienza el desmadre...

les agradesco cualquier ayuda.

Por GNGC

2 de clabLevel



 

México

firefox
Citar            
MensajeEscrito el 24 Abr 2007 01:18 pm
:(
Ni si quiera para decirme lo

Código :

LOOSER
que soy responden jajaja
Aun no logro avanzar le nada.
:cry:

Bueno Cristalabinos... estoy en vuestras manos. :beer:

Por GNGC

2 de clabLevel



 

México

firefox

 

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