RTCViewContext.localContext constructor

RTCViewContext.localContext({
  1. required String userId,
  2. StreamIndex streamIndex = StreamIndex.main,
  3. VideoRotation videoRotation = VideoRotation.rotation0,
})

Set the canvas for rendering local video

The application binds the canvas and the local video stream by calling this interface. In application development, this method is usually called after initialization to set up local video, and then join the room. The binding remains valid after leaving the room. Call removeLocalVideo to remove the binding.

Implementation

RTCViewContext.localContext({
  required this.userId,
  this.streamIndex = StreamIndex.main,
  this.videoRotation = VideoRotation.rotation0,
})  : canvasType = VideoCanvasType.local,
      roomId = '',
      viewId = genViewId('', userId);