Comunidad de diseño web y desarrollo en internet online

Fullscreen flv as3.0 a as2.0

Citar            
MensajeEscrito el 23 Sep 2011 02:03 pm
Buenas, estoy trabajando con un video, la idea es ponerlo fullscreen, osea que ocupe toda la pantalla del browser.

El problema es que consegui un codigo pero en AS3.0, como lo puedo pasar a AS 2.0??

Código ActionScript :

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align     = StageAlign.TOP_LEFT;

var _netStr:NetStream     = null;
var _netCon:NetConnection = null;
var _video:Video = null;

function SetupNetConnection()
{
   _netCon = new NetConnection();
   _netCon.addEventListener(NetStatusEvent.NET_STATUS, NetStatus, false, 0, true);
   _netCon.connect(null);
}

function SetupNetStream()
{
   var $customClient:Object = new Object();
   $customClient.onMetaData = onMetaData;
         
   _netStr = new NetStream(_netCon);         
   _netStr.client = $customClient;
   _netStr.bufferTime = 3;
   _netStr.addEventListener(NetStatusEvent.NET_STATUS, NetStatus, false, 0, true);

   _video = new Video();
   _video.attachNetStream(_netStr);
   _video.smoothing = false;   
   addChild(_video);
   _netStr.play("video1.flv");
}

function onMetaData($info:Object):void {}   

function NetStatus($e:NetStatusEvent)
{
   switch ($e.info.code)
   {
      case "NetConnection.Connect.Success": 
           SetupNetStream();
           break;
      case "NetStream.Play.Stop":
           _netStr.seek(0);
   }
}   

function ResizeAndPosition($e:Event):void
{
   _video.width = stage.stageWidth;
   _video.height = stage.stageHeight;
}

SetupNetConnection();
stage.addEventListener(Event.RESIZE, ResizeAndPosition, false, 0, true);
ResizeAndPosition(null)


Busque algun ejemplo en as2.0 y no encuentro..

Desde ya muchas gracias!!!

Saludos

Por T1000

Claber

121 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 23 Sep 2011 02:17 pm
Ese código maneja el NetStream, la funcionalidad de fullscreen es mucho mas acotada, comienza mirando como implementarla en http://blog.unijimpe.net/fullscreen-en-flash/
Si usas un FLVPlayer con el skin adecuado, ya tiene botón de fullscreen

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 23 Sep 2011 02:19 pm
Jorge, como estas tanto tiempo!?

Me exprese mal.. la idea es poner un flv como background ocupando toda la pantalla de browser..

Gracias!! Saludos

Por T1000

Claber

121 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 23 Sep 2011 02:34 pm
Tienes que reproducirlo en un objeto Video (para crearlo, click derecho en el ángulo superior izquierdo de la librería, New Video y se pone en la biblioteca, luego lo arrastras al escenario) cuyo tamaño cambias según se cambie el del escenario (mira el tuto de diagramación líquida)
Para arrancar con el video mira http://foros.cristalab.com/saltar-a-otro-fotograma-al-terminar-flv-t100842/

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 23 Sep 2011 02:56 pm
Jorge! en el ejemplo que me diste no veo el tema del resize y que ocupe toda la pantalla.

La funcion que necesito la tengo pero en 3.0 que puse en el primer post..

Pero todavia no migre a 3.0, sigo con 2.0..

Tambien estoy trabajando con un fla, que permite fullscreen dentro del browser, es AS2.0:

Código ActionScript :

stop();

this.onResize = function()
   {
      //-- Called when browser is resized.
      
      this.mcMain._x = (Stage.width  / 2) - (this.mcMain._width  / 2);
      this.mcMain._y = (Stage.height / 2) - (this.mcMain._height / 2);
      this.mcMain.text = Stage.width + "x" + Stage.height;
   };

Stage.scaleMode = "noScale";
Stage.align = "TL";
Stage.showMenu = false;
Stage.addListener(this);
   
this.onResize();


Muy sensillo, pero lo que quiero es tener de fondo el video como background en fullscreen (AS3.0)

Que me conviene hacer?? Quizas cargarlo con swf (background as3.0) externo a mi fla base??

Saluldos y gracias!!!

Por T1000

Claber

121 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 23 Sep 2011 03:14 pm
Tomate tu tiempo, pones un objeto video en el escenario, al que le puedes modificar las propiedades _width y _height como cualquier otro MC. Entonces cuando lo creas le das un ancho y alto igual al del escenario, y en el onResize vuelves a hacer lo mismo.
Piensalo, hay vida mas allá del copy&paste

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 23 Sep 2011 03:26 pm
Jorge, mi idea no es hacer copy&paste..

Hice lo que me dijiste, tengo en el escenario FLVPlayback (flvVideo) pero no hace el resize..

this.onResize = function()
{
//-- Called when browser is resized.

this.mcMain._x = (Stage.width / 2) - (this.mcMain._width / 2);
this.mcMain._y = (Stage.height / 2) - (this.mcMain._height / 2);
this.mcMain.text = Stage.width + "x" + Stage.height;

this.flvVideo._x = (Stage.width / 2) - (this.flvVideo._width / 2);
this.flvVideo._y = (Stage.height / 2) - (this.flvVideo._height / 2);
this.flvVideo.text = Stage.width + "x" + Stage.height;
};

Stage.scaleMode = "noScale";
Stage.align = "TL";
Stage.showMenu = false;
Stage.addListener(this);

this.onResize();

Tendria que funcionar o no??

Saludos

Por T1000

Claber

121 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 23 Sep 2011 03:30 pm
Solo estás modificando _x e _y, no veo ninguna modificación de _height y _width, además para un efecto de video de fondo es mucho mas liviano usar un NetStream y un objeto video (como el del POST que te pase) que un FLVPlayer, que tiene mucho overheading

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 23 Sep 2011 04:09 pm
Genial, esta funcionanado perfecto, ahora lo que señalas:

no veo ninguna modificación de _height y _width

Es verdad, el video queda centrado pero no se maximiza..

Como lo puedo modificar el _height y _width??

Saludoss!

Por T1000

Claber

121 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 23 Sep 2011 05:51 pm
Sopongamos que el objeto Video le pusiste nombre de instancia miVideo, entonces harías

miVideo.width = 100;
miVideo.height = 100

Mira en la ayuda si es _height o sin el underscore, ya estoy muy olvidado de AS2

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 23 Sep 2011 06:01 pm
Jorge,

No me agranda por completo, solo toma las dimensiones que le pasamos, osea me queda en 100px x 100px el video.

Codigo Completo:

Código ActionScript :

stop();

var conexion:NetConnection = new NetConnection();  
conexion.connect(null);  
var stream:NetStream = new NetStream(conexion);  
miVideo.attachVideo(stream);  
stream.play("video1.flv"); 

this.onResize = function()
   {
      //-- Called when browser is resized.
      
      this.mcMain._x = (Stage.width  / 2) - (this.mcMain._width  / 2);
      this.mcMain._y = (Stage.height / 2) - (this.mcMain._height / 2);
      this.mcMain.text = Stage.width + "x" + Stage.height;
      
      this.miVideo._x = (Stage.width  / 2) - (this.miVideo._width  / 2);
      this.miVideo._y = (Stage.height / 2) - (this.miVideo._height / 2);
      this.miVideo.text = Stage.width + "x" + Stage.height;
      
      
      miVideo._width = 100;
      miVideo._height = 100;
   };
   

Stage.scaleMode = "noScale";
Stage.align = "TL";
Stage.showMenu = false;
Stage.addListener(this);
   
this.onResize();


Gracias!!! Saludoss

Por T1000

Claber

121 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 23 Sep 2011 06:05 pm
A ver, puse 100 por poner un número, lo que tiene que ir es

Código ActionScript :

miVideo._width = Stage.width; 
miVideo._height =Stage.height; 


Pienso, luego escribo

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 23 Sep 2011 06:26 pm
Genial, va quedando de a poco como necesito.

Lo unico que no me toma el total de la pantalla, me scrolea el browser y me parece una franga hacia arriba blanca.

Tambien tuve que comentar:

Código ActionScript :

      /*this.miVideo._x = (Stage.width  / 2) - (this.miVideo._width  / 2);
      this.miVideo._y = (Stage.height / 2) - (this.miVideo._height / 2);
      this.miVideo.text = Stage.width + "x" + Stage.height;
      */


Porque no se veia bien..

Dejo todos los codigos:

Código HTML :

<html>
   <style type="text/css">
      *{
         margin:0;
         padding:0;
      }
   </style>

   <body>
      <object width="100%" height="100%">
      <param name="movie" value="source.swf">
      <embed src="fullbrowser-video.swf" width="100%" height="100%">
      </embed>
      </object>
   </body>
</html>


Código ActionScript :

stop();

var conexion:NetConnection = new NetConnection();  
conexion.connect(null);  
var stream:NetStream = new NetStream(conexion);  
miVideo.attachVideo(stream);  
stream.play("video1.flv"); 

this.onResize = function()
   {
      //-- Called when browser is resized.
      
      this.mcMain._x = (Stage.width  / 2) - (this.mcMain._width  / 2);
      this.mcMain._y = (Stage.height / 2) - (this.mcMain._height / 2);
      this.mcMain.text = Stage.width + "x" + Stage.height;
      
      /*this.miVideo._x = (Stage.width  / 2) - (this.miVideo._width  / 2);
      this.miVideo._y = (Stage.height / 2) - (this.miVideo._height / 2);
      this.miVideo.text = Stage.width + "x" + Stage.height;
      */
      
      miVideo._width = Stage.width;  
      miVideo._height =Stage.height; 
   };
   

Stage.scaleMode = "noScale";
Stage.align = "TL";
Stage.showMenu = false;
Stage.addListener(this);
   
this.onResize();


Que puede ser que este molestando y no me lo esta dejando ver correctamente..?

Gracias Saludos!!!

Por T1000

Claber

121 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 26 Sep 2011 01:10 pm
Jorge, solucionado!! Quedo perfecto.

Gracias por la ayuda!!!

Por T1000

Claber

121 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 26 Sep 2011 02:40 pm
Jorge, solucionado!! Quedo perfecto.

Gracias por la ayuda!!!

Por T1000

Claber

121 de clabLevel



Genero:Masculino  

firefox

 

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