StageVideo on Android Nexus 7 shows a black square

2019-08-05 08:23发布

问题:

StageVideo in Adobe AIR 15, on a Nexus 7 with Android 4.4.3, exporting in both GPU and DIRECT, shows a black square instead of received video. It is a P2P RTMFP Video Chat. Same project on desktop works perfectly, once exported to Android, instead of remote StageVideo it shows a black square. Audio arrives perfectly, and other P2P features work well. Code is all right since same project compiles on AIR15 for desktop and works lovely. Any idea why this happens?

回答1:

The stage video is switching a render state. It's an annoying bug, and this is what you can do as a patch.

  1. Try to play.
  2. if RENDER_STATE has changed to UNAVAILABLE or SOFTWARE, play again!

This will cause black flickering and not the best UX, but the clip will play after a second or 2.

_stageVideo.addEventListener(StageVideoEvent.RENDER_STATE, function (e:StageVideoEvent):void{
                trace ("RENDER STATE: ", e.status);
                if (e.status == VideoStatus.UNAVAILABLE || e.status == VideoStatus.SOFTWARE)
                {
                    _ns.play(_videoURL);
                }
            });

If you find a more effective solution following this info, please post it. Thank you.