Skip to main content
Participant
July 2, 2013
Answered

Video comes in front on stage automatically after android app activate/deactivate

  • July 2, 2013
  • 1 reply
  • 700 views

Hi,

I overlayyed TextField over video on stage.

video and textfield is added on stage like

stage.addChildAt(video,0);

stage.addChildAt(textfield,1);

video.attachNetStream(netstream);

the above source code works perfect for android air app If I don't activate/deactivate the app.

But If I deactivate the app by tapping home and then activate the app (by tapping the app icon), video becomes on top of textfield.

How can I push the video below the textfield?

I have checked the video index its 0 and I have also tried to remove the video and add it back on stage at index 0 but that also does change anything.

Thanks for your help!

This topic has been closed for replies.
Correct answer jg716

I've written several apps that use video and there are definitely some known ordering issues. 

I believe that it has to do with the fact that the Video object is able to use GPU rendering (which is basically handled outside of the display list).  As you've described, the ordering issue doesn't seem to appear until you deactivate/reactivate the application.

You might want to look at this message from December 11th 2012:  http://forums.adobe.com/message/4914005

There's some additional information in the bugbase - here :  https://bugbase.adobe.com/index.cfm?event=bug&id=3354849

As described, there is a poorly documented application.xml element, <containsVideo>true</containsVideo> that can be manually added to the application.xml file (with a text editor/notepad) - it belongs inside the <android></android> element.  

This may or may not resolve your issue.  However in my case (very similar to your description), adding this element to the application.xml did cause the application to respect the intended order when deactivated and then reactivated.

Hope this is useful information for you.

1 reply

Known Participant
July 3, 2013

How about using a removeChild statement for the textfield when it deactivates and then addchild for the textfield when it activates.....not at a particular index..wouldn't this ensure that it would be above the video?

For my code, I just use addchild instead of addchildat and keep in mind the order for which I add objects to the stage.

Justin

jg716
jg716Correct answer
Inspiring
July 3, 2013

I've written several apps that use video and there are definitely some known ordering issues. 

I believe that it has to do with the fact that the Video object is able to use GPU rendering (which is basically handled outside of the display list).  As you've described, the ordering issue doesn't seem to appear until you deactivate/reactivate the application.

You might want to look at this message from December 11th 2012:  http://forums.adobe.com/message/4914005

There's some additional information in the bugbase - here :  https://bugbase.adobe.com/index.cfm?event=bug&id=3354849

As described, there is a poorly documented application.xml element, <containsVideo>true</containsVideo> that can be manually added to the application.xml file (with a text editor/notepad) - it belongs inside the <android></android> element.  

This may or may not resolve your issue.  However in my case (very similar to your description), adding this element to the application.xml did cause the application to respect the intended order when deactivated and then reactivated.

Hope this is useful information for you.