onLiveVideoLayoutChanged method
void
onLiveVideoLayoutChanged(
- String roomId,
- String layoutInfo
)
Implementation
void onLiveVideoLayoutChanged(String roomId, String layoutInfo) {
if (roomId != roomState.roomId) return;
var size = _parseCanvasSize(layoutInfo);
if (size == null) return;
var isLandscape = size.width >= size.height;
if (!isLandscape && roomState.roomVideoStreamIsLandscape.value) {
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
}
roomState.roomVideoStreamIsLandscape.value = isLandscape;
}