onLiveVideoLayoutChanged method

void onLiveVideoLayoutChanged(
  1. String roomId,
  2. 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;
}