VideoViewController
A AgoraVideoView controller for rendering local and remote video.
class VideoViewController with VideoViewControllerBaseMixin implements VideoViewControllerBase { VideoViewController({ required this.rtcEngine, required this.canvas, this.useFlutterTexture = false, this.useAndroidSurfaceView = false, }) : connection = const RtcConnection(); VideoViewController.remote({ required this.rtcEngine, required this.canvas, required this.connection, this.useFlutterTexture = false, this.useAndroidSurfaceView = false, }) : assert(connection.channelId != null); @override final RtcEngine rtcEngine; @override final VideoCanvas canvas; @override final RtcConnection connection; @override final bool useFlutterTexture; @override final bool useAndroidSurfaceView; @protected @override int getVideoSourceType() { return canvas.uid! == 0 ? VideoSourceType.videoSourceCamera.value() : VideoSourceType.videoSourceRemote.value(); } }
On different platforms, the default view corresponding to this class is different:
- Android: https://developer.android.com/reference/android/view/TextureView. If you want to use SurfaceView, set the
useAndroidSurfaceView
property totrue
. - iOS: UIView. If you want to use Flutter Texture, set the
useFlutterTexture
property totrue
. - macOS and Windows: FlutterTexture.
Attributes
- rtcEngine
- RtcEngine.
- canvas
- Local video display properties. See VideoCanvas.
- connection
- The connection information. See RtcConnection.
- useFlutterTexture
- Whether to use
FlutterTexture
to render video:true
: UseFlutterTexture
to render video.false
: Do not useFlutterTexture
to render video.
Note:FlutterTexture
applies to iOS, macOS and Windows platforms. - useAndroidSurfaceView
- Whether to use Android
SurfaceView
to render video:true
: Use AndroidSurfaceView
to render video.false
: Do not use AndroidSurfaceView
to render video.
Note: AndroidSurfaceView
applies to Android platform only.