Highlighted

Air 23 SDK Android return from cameraUI incorrect displaystate

Participant ,
Oct 03, 2016

Copy link to clipboard

Copied

Using Air 23 sdk on Android with displaystate of normal (ie. not full screen so you see the Android bar at the top of the app), calling the cameraUI.launch( MediaType.VIDEO ), recording a video and when returning from the recording the displaystate changes to fullscreen where the top part of the app is covered by the Android bar at the top - is there a fix for this? On return from the video recording, tried setting the displaystate to normal, but didn't work, top of app is still covered by the Android top bar.

Hi,

We have tried your code at our end by using stage.displayState after coming back from CameraUI and it is normal. The top of application is starting after the status bar and there's no overlap on our side. We have added a clickHandler to check the stage.displayState -

public function clickHandler(e:Event):void

  {

  trace("click handler");

  trace("\nStageDisplayState: " + stage.displayState);

  }

And it is tracing "normal" when we come back from the recording screen.

Thanks,

Adobe AIR Team

TOPICS
Air beta

Views

446

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

Air 23 SDK Android return from cameraUI incorrect displaystate

Participant ,
Oct 03, 2016

Copy link to clipboard

Copied

Using Air 23 sdk on Android with displaystate of normal (ie. not full screen so you see the Android bar at the top of the app), calling the cameraUI.launch( MediaType.VIDEO ), recording a video and when returning from the recording the displaystate changes to fullscreen where the top part of the app is covered by the Android bar at the top - is there a fix for this? On return from the video recording, tried setting the displaystate to normal, but didn't work, top of app is still covered by the Android top bar.

Hi,

We have tried your code at our end by using stage.displayState after coming back from CameraUI and it is normal. The top of application is starting after the status bar and there's no overlap on our side. We have added a clickHandler to check the stage.displayState -

public function clickHandler(e:Event):void

  {

  trace("click handler");

  trace("\nStageDisplayState: " + stage.displayState);

  }

And it is tracing "normal" when we come back from the recording screen.

Thanks,

Adobe AIR Team

TOPICS
Air beta

Views

447

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
Oct 03, 2016 0
Adobe Employee ,
Oct 04, 2016

Copy link to clipboard

Copied

Hi,

Thanks for reporting the issue. Could you please let us know with the following details like :

1. Which device and Android version you are using?

2. Is this issue AIR 23 specific ? or you are facing it on lower versions as well?

These details will help us in investigating further.

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...
Oct 04, 2016 0
Participant ,
Oct 04, 2016

Copy link to clipboard

Copied

Hi,

I am testing on Samsung Note and HTC One, running Android 6 and 4.1. I have tried with SDK 22 and see the same issue as with 23.

Thanks.

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...
Oct 04, 2016 0
Adobe Employee ,
Oct 05, 2016

Copy link to clipboard

Copied

Hi,

We have tried the issue at our end but couldn't reproduce. Could you please provide a sample project so that we can investigate the issue. Also, if you could send us a video demonstrating the issue, that will be great.

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...
Oct 05, 2016 0
Participant ,
Oct 06, 2016

Copy link to clipboard

Copied

Hi, I have extracted the code as follows. Note that if I introduce a delay before the readData() calls (say for 2 seconds), the issue seems to go away most of the time (not all of the time, but most of the time) and also if I cancel from the cameraUI I do not see the issue. I am wondering if it may be related to resources when returning from the cameraUI to the app? In any case, the code ....

var cameraUI:CameraUI = new CameraUI();
var dataSource:IDataInput;
var imageBytes:ByteArray;

if( CameraUI.isSupported )
{
cameraUI.addEventListener( MediaEvent.COMPLETE, mediaSelected );
cameraUI.addEventListener( Event.CANCEL, browseCanceled );
cameraUI.addEventListener( ErrorEvent.ERROR, mediaError );
cameraUI.launch( MediaType.VIDEO );
}
else
{
trace( "Picture/Video taking is not supported on this device.","1");
}

function browseCanceled( event:Event ):void

{}

function mediaError( event:Event ):void

{}

function mediaSelected( event:MediaEvent ):void
{
//this.stage.displayState = StageDisplayState.NORMAL;
//this.stage.scaleMode = StageScaleMode.EXACT_FIT;
var imagePromise:MediaPromise = event.data;
dataSource = imagePromise.open();
if( imagePromise.isAsync )
{
  var eventSource:IEventDispatcher = dataSource as IEventDispatcher;           
  eventSource.addEventListener( Event.COMPLETE, onTakenMediaLoaded );        
}
else
{
  readData();
}
}
function onTakenMediaLoaded( event:Event ):void
{
readData();
}
function readData():void
{
imageBytes = new ByteArray();
dataSource.readBytes( imageBytes );
temp = File.applicationStorageDirectory.resolvePath("App/library/1.mp4");

     var stream:FileStream = new FileStream();
     stream.open( temp, FileMode.WRITE );
     stream.writeBytes( imageBytes );
     stream.close();

// file stored locally
}

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...
Oct 06, 2016 0
Adobe Employee ,
Oct 12, 2016

Copy link to clipboard

Copied

Hi,

We have tried your code at our end by using stage.displayState after coming back from CameraUI and it is normal. The top of application is starting after the status bar and there's no overlap on our side. We have added a clickHandler to check the stage.displayState -

public function clickHandler(e:Event):void

  {

  trace("click handler");

  trace("\nStageDisplayState: " + stage.displayState);

  }

And it is tracing "normal" when we come back from the recording screen.

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...
Oct 12, 2016 0
Spider22 LATEST
Participant ,
Oct 12, 2016

Copy link to clipboard

Copied

Seems to work by uncommenting the this.stage.displayState = StageDisplayState.NORMAL line, in my code as per your response.

Thanks.

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...
Oct 12, 2016 0