4

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);
}
hpm
  • 1,202
  • 13
  • 34
Scianid
  • 143
  • 9
  • 1
    Do you try your video in html5 video tag to test your file format? – Nambew Mar 25 '15 at 20:45
  • Thanks for the response Nambew, but this is porobably not the issue, I've tried it with a few different mp4 files and t doesnt work. It does work on other browsers - chrome on desktop for example - but does not work on chrome on mobile... Im still stuck with that, any idea on what could be the issue would help... – Scianid Mar 26 '15 at 08:10

0 Answers0