MediaPlayerController
The AgoraVideoView controller used to render the video for the media player.
abstract class MediaPlayerController implements MediaPlayer, VideoViewControllerBase { factory MediaPlayerController( {required RtcEngine rtcEngine, required VideoCanvas canvas, RtcConnection? connection, bool useFlutterTexture = false, bool useAndroidSurfaceView = false}) => MediaPlayerControllerImpl( rtcEngine, canvas, connection, useFlutterTexture, useAndroidSurfaceView, ); Future<void> initialize(); }
Attributes
- rtcEngine
- RtcEngine.
- canvas
- Local video display properties. See VideoCanvas.
- 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.
initialize
Creates a MediaPlayerController.
Future<void> initialize();
Details
Note:
- Make sure the RtcEngine is initialized before you call this method.
- Make sure to call this method before calling other APIs in MediaPlayer.