setExternalMediaProjection abstract method

Future<void> setExternalMediaProjection(
  1. int mediaProjection
)

Sets an external MediaProjection to capture screen video stream.

After this method is successfully called, the external MediaProjection you set will replace the one applied by the SDK to capture the screen video stream. When screen sharing is stopped or RtcEngine is destroyed, the SDK automatically releases the MediaProjection. This method is applicable to Android only. You must obtain MediaProjection permission before calling this method.

  • mediaProjection A MediaProjection object used to capture screen video stream.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.

Implementation

Future<void> setExternalMediaProjection(int mediaProjection);