AgoraIO-Extensions / AgoraIO-Extensions/Agora-Flutter-SDK
How to fix landscape mode video broadcasting when device locked.
- Vorherrschende Sprache
- Dart
- Sterne
- 795
- Forks
- 448
- Ø Merge
- 12 Std. 19 Min.
- Gemergte PRs (30 T.)
- 14
Beschreibung
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,
]);
}
}
`
``
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.