Highlighted

My video disappear when using Videotexture and the phone rotate on Android

Engaged ,
Jun 11, 2015

Copy link to clipboard

Copied

Hello,

My video disappear when using the new class Videotexture and the phone rotate on Android Nexus 5


package{

  import com.VideoT;

  import flash.display.Sprite;

  import flash.events.Event;

  import flash.display.StageAlign;

  import flash.display.StageScaleMode;

  import starling.core.Starling;

  public class Main extends Sprite

  {

    private var _starling:Starling = null;

    public function Main()

    {

      stage.scaleMode = StageScaleMode.NO_SCALE;

      stage.align = StageAlign.TOP_LEFT;

   

      addEventListener(Event.ADDED_TO_STAGE, init);

    }

    public function init(event:Event):void

    {

      removeEventListener(Event.ADDED_TO_STAGE, init);

    

      _starling = new Starling(VideoT, stage);

      _starling.antiAliasing = 1;

      _starling.showStats = true;

      _starling.start();

    }

  }

}

package com 

  import flash.display3D.Context3D;

  import flash.display3D.Context3DTextureFormat;

  import flash.display3D.textures.VideoTexture;

  import flash.events.VideoTextureEvent;

  import flash.net.NetConnection;

  import flash.net.NetStream;

  import starling.core.Starling;

  import starling.display.Image;

  import starling.display.Sprite;

  import starling.events.Event;

  import starling.textures.ConcreteTexture;

  import flash.events.NetStatusEvent;

  /**

  * Starling root Class

  * @author SzRaPnEL

  */ 

  public class VideoT extends Sprite 

  { 

    private var vidClient:Object;

    private var cTexture:ConcreteTexture;

    private var vTexture:VideoTexture;

    private var nc:NetConnection;

    private var ns:NetStream;

    private var image:Image;

    private var context3D:Context3D;

   

    public function VideoT() 

    { 

      addEventListener(Event.ADDED_TO_STAGE, init);

    } 

   

    private function init(e:Event):void 

    { 

      removeEventListener(Event.ADDED_TO_STAGE, init);

     

      core();

    } 

   

    private function core():void 

    { 

      context3D = Starling.context;

     

      vidClient = new Object();

      vidClient.onMetaData = onMetaData;

     

      nc = new NetConnection();

      nc.connect(null);

     

      ns = new NetStream(nc);

      ns.client = vidClient;

      ns.play("http://www.mysite.com/myvideo.mp4");

      ns.addEventListener(NetStatusEvent.NET_STATUS, netstat);

     

      vTexture = context3D.createVideoTexture();

      vTexture.attachNetStream(ns);

      vTexture.addEventListener(VideoTextureEvent.RENDER_STATE, renderFrame);

     

      cTexture = new ConcreteTexture(vTexture, Context3DTextureFormat.BGRA, 1024, 576, false, true, true);

     

      image = new Image(cTexture);

      addChild(image);

    } 

   

    private function netstat(stats:NetStatusEvent):void { 

      trace(stats.info.code);

    } 

   

    private function renderFrame(e:VideoTextureEvent):void 

    { 

      // 

    } 

   

    private function onMetaData(metadata:Object):void 

    { 

      // 

    } 

  } 

}

Thanks

TOPICS
Performance issues

Views

1.0K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

My video disappear when using Videotexture and the phone rotate on Android

Engaged ,
Jun 11, 2015

Copy link to clipboard

Copied

Hello,

My video disappear when using the new class Videotexture and the phone rotate on Android Nexus 5


package{

  import com.VideoT;

  import flash.display.Sprite;

  import flash.events.Event;

  import flash.display.StageAlign;

  import flash.display.StageScaleMode;

  import starling.core.Starling;

  public class Main extends Sprite

  {

    private var _starling:Starling = null;

    public function Main()

    {

      stage.scaleMode = StageScaleMode.NO_SCALE;

      stage.align = StageAlign.TOP_LEFT;

   

      addEventListener(Event.ADDED_TO_STAGE, init);

    }

    public function init(event:Event):void

    {

      removeEventListener(Event.ADDED_TO_STAGE, init);

    

      _starling = new Starling(VideoT, stage);

      _starling.antiAliasing = 1;

      _starling.showStats = true;

      _starling.start();

    }

  }

}

package com 

  import flash.display3D.Context3D;

  import flash.display3D.Context3DTextureFormat;

  import flash.display3D.textures.VideoTexture;

  import flash.events.VideoTextureEvent;

  import flash.net.NetConnection;

  import flash.net.NetStream;

  import starling.core.Starling;

  import starling.display.Image;

  import starling.display.Sprite;

  import starling.events.Event;

  import starling.textures.ConcreteTexture;

  import flash.events.NetStatusEvent;

  /**

  * Starling root Class

  * @author SzRaPnEL

  */ 

  public class VideoT extends Sprite 

  { 

    private var vidClient:Object;

    private var cTexture:ConcreteTexture;

    private var vTexture:VideoTexture;

    private var nc:NetConnection;

    private var ns:NetStream;

    private var image:Image;

    private var context3D:Context3D;

   

    public function VideoT() 

    { 

      addEventListener(Event.ADDED_TO_STAGE, init);

    } 

   

    private function init(e:Event):void 

    { 

      removeEventListener(Event.ADDED_TO_STAGE, init);

     

      core();

    } 

   

    private function core():void 

    { 

      context3D = Starling.context;

     

      vidClient = new Object();

      vidClient.onMetaData = onMetaData;

     

      nc = new NetConnection();

      nc.connect(null);

     

      ns = new NetStream(nc);

      ns.client = vidClient;

      ns.play("http://www.mysite.com/myvideo.mp4");

      ns.addEventListener(NetStatusEvent.NET_STATUS, netstat);

     

      vTexture = context3D.createVideoTexture();

      vTexture.attachNetStream(ns);

      vTexture.addEventListener(VideoTextureEvent.RENDER_STATE, renderFrame);

     

      cTexture = new ConcreteTexture(vTexture, Context3DTextureFormat.BGRA, 1024, 576, false, true, true);

     

      image = new Image(cTexture);

      addChild(image);

    } 

   

    private function netstat(stats:NetStatusEvent):void { 

      trace(stats.info.code);

    } 

   

    private function renderFrame(e:VideoTextureEvent):void 

    { 

      // 

    } 

   

    private function onMetaData(metadata:Object):void 

    { 

      // 

    } 

  } 

}

Thanks

TOPICS
Performance issues

Views

1.0K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 11, 2015 1
Engaged ,
Jun 12, 2015

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 12, 2015 0
Adobe Employee ,
Jun 12, 2015

Copy link to clipboard

Copied

Thank you for the report.  I'll ask the team to investigate asap.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 12, 2015 0
Engaged ,
Jun 13, 2015

Copy link to clipboard

Copied

I think lost context can happen on Android rotation.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 13, 2015 0
Adobe Employee ,
Jun 16, 2015

Copy link to clipboard

Copied

Hi

Thanks for reporting the issue.

We looked at the issue and found that the code snippet shared above is exactly similar to the code shared by you for another video texture issue where video is not playable. My video is black when using Videotexture and Pseudo Streaming on Android

So, we are not able to reproduce the problem because of that bug.

Also, Could you please confirm if the video stop playing completely or it restarts from beginning after device is rotated ?

Thanks

Adobe AIR Team

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 16, 2015 0
pol2095 LATEST
Engaged ,
Jun 16, 2015

Copy link to clipboard

Copied

Quand the phone rotate, the texture disappear but the sound continues to play.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 16, 2015 0