AgoraIO-Extensions / AgoraIO-Extensions/Agora-Flutter-SDK

How to fix landscape mode video broadcasting when device locked.

Offen
#2,481 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
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

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.