Ios: how to avoid video orientation change during capture? - ios

I have an iOS app that only supports portrait. When rotating the device the video captured by the RTCCameraVideoCapturer (WebRTC) rotates to landscape orientation, even when the rest of the UI stays in portrait. How to avoid this?

Do you have access to RTCCameraVideoCapturer codebases ? Also, I am not sure which version of the WebRTC codebases you are working with. And, in your application ; is landscape mode is the only mode that you are intending to support ?
There should be rotation calculation method that listen to rotation changes. You can just disabled it, or can use your preferred fixed set of rotation in spite of default.
For example, taking from this sample codebase ; you can just only use RTCVideoRotation_90 to have landscape orientation only.

Related

How do I programmatically control device orientation's effects?

Scenario: I set the default device orientation to portrait. However, there are some Views that I want to allow for landscape mode.
Most of my views don't need to be in landscape. But there are some with orientation detection that allows a full-size linear graph to be displayed in landscape mode.
I want my application to behave as a Portrait-Centric for most of the time.
Question: How do I freeze the Portrait when I need to, but allow for Landscape when the situation warrants it?
You can manually allow, and most importantly in your case, disallow device orientation through UIInterfaceOrientation. Full description was already answered here: https://stackoverflow.com/a/40859280/13296047

Nativescript Detect Orientation without auto rotate screen content

In Nativescript Angular, Is there anyway to detect orientation change and not allow content auto rotate but handling the content rotation manually? For example when rotating orientation from portrait to landscape, I want the content on the screen to stay still but i need to know that the screen is currently in landscape mode.
Im using nativescript-orientation plugin but this only allow me to disable the rotation. Once the rotation is disabled i could not detect the orientation change when the screen is landscape or portrait.
If you want to detect the orientation by yourself then you have to get the sensor data. I have never done this myself so I will just tell you where you can start. For IOS, you have get the sensor data from coremotion. You would require the data from the accelerometer and magnetometer sensors's data.
You can use the plugin nativescript-coremotion or You can directly access the IOS native methods yourself to do it.

Android TV portrait WebView

I am writing an application that runs on Android TV 5.1 or newer that uses the WebView as the display rendering engine. I am able to set the desired display orientation, but the WebView rotates back to landscape within the display and maintains the correct aspect ratio.
I have tried using CSS to perform a transform but the aspect ratio is not correct. I have not found a method to force the WebView to rotate and fit the parent window.
Is there any method to set the orientation and size of the WebView itself? I see the same behavior on multiple devices.
This behavior is device specific. Some of the devices I have tested rotate as expected, another device rotates the display, but the WebView rotates back into landscape. The remaining devices I have tested do not rotate at all.
I will make this will be a known limitation of running this application on Android TV devices.

How intercept ios rotation when physical device block is enabled (Swift)?

I need to straight up the image taken by custom camera capture view but with physical device rotation block enabled it seem impossible.
physical device rotation block
UIDevice.current.orientation works only with device rotation "unlocked". Someone can help me with this tedious bug? Thanks.
Unfortunately there is no way to unlock rotation while physical block enabled, but you can turn landscape mode as your main in project settings
landscape mode as main

iOS Is it possible to change orientation of device when default device rotation is off?

Today I was surprised by a feature of camera in apple when I rotate device to landscape mode icons were also rotated in landscape mode, Although the Automatic rotation was off for my device, How it can happen?
If default device rotation is off then how can camera app know that device orientation is changed?
I double checked my phones settings of Auto-Rotation and they were off.
The device-orientation setting is ignored for the camera. This was done so that people can keep orientation-lock on and take landscape photos at the same time, without having to constantly change the setting.

Resources