lundi 30 mars 2015

OpenFL video targeting HTML5 is not working on chrome-mobile

I'm using openfl.media.Video to display an MP4 file on HTML5 targets.


It works great on all desktop browsers and even on firefox-mobile.


The only issue is that it's not working on chrome-mobile(v.41.0.2272.96) and opera-mobile (iOS7.1.2). On Chrome I'm getting a black rectangle. On iOS the screen is just blank. I have connected chrome via remote debugging and the console doesn't show and error.


Here is the code I'm running:



private var _video:Video;
private var _stream:NetStream;
private var _nc:NetConnection;

public function new(address:String)
{
_nc = new NetConnection();
_nc.connect(null);
_stream = new NetStream(_nc);
_video = new Video();
addChild(_video);

_stream.addEventListener(NetStatusEvent.NET_STATUS, onVideoLoaded);
_stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
_video.attachNetStream(_stream);
_stream.play(address);
}

private function onVideoLoaded(nsLoaded:NetStatusEvent):Void
{
if (nsLoaded.info.code == "NetStream.Play.Start"){}
else if(nsLoaded.info.code == 'NetStream.Play.Stop'){}
else if(nsLoaded.info.code == 'NetStream.Seek.InvalidTime'){}
}

private function asyncErrorHandler(e:AsyncErrorEvent):Void
{
trace('asyncErrorHandler', e.text);
}

Aucun commentaire:

Enregistrer un commentaire