AgoraIO-Extensions / AgoraIO-Extensions/Agora-Flutter-SDK
How to fix landscape mode video broadcasting when device locked.
- 主要言語
- Dart
- スター
- 795
- フォーク
- 448
- 平均マージ
- 12時間 19分
- マージ済み PR(30日)
- 14
説明
I’ve implemented video broadcasting using Agora in Flutter with the role set as clientRoleBroadcaster.
I’ve also set the orientation to landscape, and it works fine during normal usage.
However, when I lock and unlock the device, the app automatically switches back to portrait mode.
I want the broadcasting to always remain in landscape orientation, regardless of any device behavior (such as screen lock/unlock, rotation, or app lifecycle changes).
i have also set the below code for this but not working.
` VideoEncoderConfiguration(
dimensions: const VideoDimensions(
width: 2560,
height: 1440,
),
frameRate: 30,
bitrate: 5000, // 5 Mbps
minBitrate: 3000, // Minimum 3 Mbps
**orientationMode: OrientationMode.orientationModeFixedLandscape,**
degradationPreference: DegradationPreference.maintainResolution,
),`
`@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.resumed) {
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
}
}
`
``
コントリビューションガイド
評価
この issue はまだ評価されていません。