The RTCVideoView
widget from the flutter_webrtc
package causes the application to crash when the available dimensions (height or width) fall below certain thresholds. This issue appears to occur regardless of whether the constraints are on height or width. The crash does not happen with audio calls or when RTCVideoView
is not used.
Steps to Reproduce
-
Initialize a Flutter project and add the
flutter_webrtc
package. -
Implement a video call screen using
RTCVideoView
. -
Resize the window or use a device with small dimensions (either height or width).
-
Observe the application crash when the dimensions(width/height) fall below some threshold.
Expected Behavior
The RTCVideoView
should handle small dimensions gracefully without crashing the application. A fallback UI should be displayed, or the widget should resize properly.
Actual Behavior
The application crashes when the height or width constraints fall below certain thresholds.
Sample Code
Stack(
children: <Widget>[
Center(
child: activeCall.remoteStream != null &&
activeCall.remoteStream!
.getVideoTracks()
.isNotEmpty &&
activeCall.remoteRenderer != null
? RTCVideoView(
activeCall.remoteRenderer!,
mirror: true,
objectFit: RTCVideoViewObjectFit
.RTCVideoViewObjectFitCover,
)
: const CircleAvatar(
radius: 50,
child: Placeholder(),
),
),
Align(
alignment: Alignment.topRight,
child: SizedBox(
width: 200,
height: 200,
child: activeCall.localStream != null &&
activeCall.localStream!
.getVideoTracks()
.isNotEmpty &&
activeCall.localRenderer != null
? RTCVideoView(
activeCall.localRenderer!,
mirror: true,
objectFit: RTCVideoViewObjectFit
.RTCVideoViewObjectFitCover,
)
: const Center(
child: CircleAvatar(
radius: 50,
child: Placeholder(),
),
),
),
),
],
),