setExternalVideoSource abstract method

Future<void> setExternalVideoSource({
  1. required bool enabled,
  2. required bool useTexture,
  3. ExternalVideoSourceType sourceType = ExternalVideoSourceType.videoFrame,
  4. SenderOptions encodedVideoOption = const SenderOptions(),
})

Sets the external video source.

After calling this method to enable the external video source, you can call pushVideoFrame to push external video data to the SDK. Switching video sources dynamically within a channel is not supported. If you have already called this method to enable an external video source and joined a channel, to switch to an internal video source, you must first leave the channel, then call this method to disable the external video source, and rejoin the channel.

  • enabled Whether to enable the external video source: true : Enable the external video source. The SDK is ready to receive external video frames. false : (Default) Do not enable the external video source.
  • useTexture Whether to use external video frames in Texture format: true : Use Texture format for external video frames. false : Do not use Texture format for external video frames.
  • sourceType Whether the external video frame is encoded. See ExternalVideoSourceType.
  • encodedVideoOption Video encoding options. If sourceType is encodedVideoFrame, this parameter must be set. You can contact technical support to learn how to configure this parameter.

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> setExternalVideoSource(
    {required bool enabled,
    required bool useTexture,
    ExternalVideoSourceType sourceType = ExternalVideoSourceType.videoFrame,
    SenderOptions encodedVideoOption = const SenderOptions()});