setResizeMode method
Set the resize mode of the video player.
This method will set the resize mode of the video player to the specified resizeMode.
The resizeMode parameter determines how the video player is resized. The possible values
are:
- ResizeMode.fit: The video player is resized to fit within its parent widget while maintaining its aspect ratio. Original video aspect ratio is preserved.
- ResizeMode.stretch: The video player is resized to fit the entire parent widget, without maintaining its aspect ratio. This may cause the video to be distorted.
- ResizeMode.crop: The video player is resized to fit the entire parent widget while maintaining its aspect ratio. This may cause some of the video to not be visible.
The video player cannot be interacted with while it is resizing.
Returns a Future that completes when the resize is complete.
- Parameters:
resizeMode: The value to set the resize mode to.
Implementation
Future<void> setResizeMode(ResizeMode resizeMode) async {
_methodChannel.invokeMethod('setResizeMode', resizeMode.index);
setState(() {
_resizeMode = resizeMode;
});
}