Skip to main content
Participant
January 30, 2013
Question

Rotate the front camera in Android for video chat app

  • January 30, 2013
  • 3 replies
  • 4134 views

Hi,

  I developing a video chat app on Android with Adobe AIR 3.6 beta.

I currently using the Camera, Microsphone and Video classes. I panning to use StageVideo next

I understand fully that Adobe has stated that when using the Camera do it in Landscape mode.

Problem is my compnay wants it in Portrait mode only and is not interested in landscape video chatting app at all!

I can do this in native Java code with 6 lines of code by rotateing the camera,

but it seems impossible on Adobe Air mobile.

What I tried

a) Rotate the display object contain the video which has my camera attached

Result: It works! It only solves half my problem as the video is still being transmitted  in landscape mode

b) Using Matrix and transform

Result. Does not work correctly and does not help as the video is still being transmitted in landscape mode

What I am considering

a) Build an ActionScript Extension that calls native java code that rotates the camera

Boy is this really nessscary?

b) Create another Netstream and copy the video stream contains the landscape vidoe feed into an bytearray and then

transpose the array and feed it into a newly created Portrit video feed!

Is this evan technically possible?

I understand peope will say that just accept landscape but that not an option right now

Any hep is greatly appreciated. I cannot be the first engineer that wants a Portriat locked video chatting appp on Android using Adobe AIR

This topic has been closed for replies.

3 replies

Inspiring
November 27, 2013

I ran into this very same problem building a video conf app that could rotate in any direction on the device.

I ended up doing what you tried for A, but took it a little further. I injected information into the stream I was sending so I would know what to do on the other side.... information including not only the oriention of the video, but orientation of the device as well as the Microphone activity level. (because i needed to know everyones mic levels on all devices).

Yes this is a workaround but at least it's a solution.

something like this....

netsream.send("onActivity", {micActivity:this._microphone.activityLevel});

Adobe Employee
November 27, 2013

HI ConstantInnovationsInc,

You mention rotating the video element solves half your problem and your are able to view the video upright in prtrait mode. This is great.

Regarding your second problem, I believe your use case is to transmit this video to a peer, who could see that. Can't you rotate that video element as well which is receiving the video? Wouldn't that fulfil your use case?

Participant
November 27, 2013

Hi

Yes you can rotate the video object locally but it it always transmitted

in landscape mode to Wowza or whatever RTMP video server you are using.

Since in my case the viewer was out in the field I did not have the option

of modifying the viewer client. This is simply because the hardware

engineers implementing the camera always thought you would use them in

landscape mode. A rather foolish assumption. This is why there are no AIR

based portrait facing video chat apps in Android. They are all annoyingly

in landscape mode.

Participant
November 27, 2013

Did you ever figure out a solution to this problem?  I am having a similar issue.  The difference is I am trying to do augmented reality stuff using in2AR in portrait, but the issue is pretty much identical.

Participant
November 27, 2013

There is no solution as the hardware engineers locked the camera in

landscape and only allow you to rotate the camera in ice cream sandwich and

above. Any pre android 4.0 devices and your stuck with landscape. I stopped

doing AIR as it will not allow you to target an android version and has too

many other limitations. I recommend you recode your app in native java on

android and forget AIR. It hurts but the faster you do that the better for

you.