Error during device orientation

Hi.

I have a problem during device orientation.

I use GoCoder SDK in a fragment loaded by an Activity.

I can start the app in portrait mode but the fragment that use the SDK is locked in landscape mode.

If I change the device’s orientation when I click the button that start the fragment I get this error:

2019-10-08 17:38:19.655 4148-4148/it.tim.videolive.pslte E/AndroidRuntime: FATAL EXCEPTION: main Process: it.tim.videolive.pslte, PID: 4148 java.lang.RuntimeException: set display orientation failed at android.hardware.Camera.setDisplayOrientation(Native Method) at com.wowza.gocoder.sdk.api.devices.WOWZCamera.autoDetectOrientation(WOWZCamera.java:1160) at com.wowza.gocoder.sdk.api.devices.WOWZCameraView.doConfigChange(WOWZCameraView.java:1164) at com.wowza.gocoder.sdk.api.devices.WOWZCameraView.onConfigurationChanged(WOWZCameraView.java:1187) at android.app.Application.onConfigurationChanged(Application.java:130) at android.app.ActivityThread.performConfigurationChanged(ActivityThread.java:5001) at android.app.ActivityThread.handleConfigurationChanged(ActivityThread.java:5200) at android.app.ActivityThread.handleConfigurationChanged(ActivityThread.java:5124) at android.app.servertransaction.ConfigurationChangeItem.execute(ConfigurationChangeItem.java:42) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:201) at android.app.ActivityThread.main(ActivityThread.java:6806) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

If I click the button in portrait mode and wait the fragment is fully loaded I have no problem.

Same if I click the button with device in landscape mode.

There is a way to intercept the orientation changing during the fragment’s loading?

Thanks in advance

By default @DarthXander, the live stream will maintain the orientation of the device when the broadcast began. However, there are some settings you can adjust and I will direct you to that documentation.

https://www.wowza.com/docs/wowza-gocoder-sdk-faq#does-the-sdk-support-switching-between-portrait-and-landscape-orientation-while-streaming-

You can adjust some settings to reflect the following: same as device, always landscape, always portrait.

https://www.wowza.com/resources/gocodersdk/docs/api-docs-android/?com/wowza/gocoder/sdk/api/configuration/WOWZMediaConfig.html

I think to have resolved the problem (but I must do some testing) placing this code in the onDestroy and onBackPressed methods of my fragment.

try {
    goCoderCameraView.stopPreview();
    goCoderCameraView.clearView();
}

catch (Exception e) {}

goCoderCameraView is the WOWZCameraView object that I use in my fragment.

It’s like something remains active in the view after the endBroadcast called in the WOWZBroadcast Object.