addVideoWatermarkEx abstract method

Future<void> addVideoWatermarkEx({
  1. required String watermarkUrl,
  2. required WatermarkOptions options,
  3. required RtcConnection connection,
})

Adds a local video watermark.

Deprecated Deprecated: This method is deprecated. Use addVideoWatermarkWithConfigEx instead. This method adds a PNG image as a watermark to the local published live video stream. Users in the same live streaming channel, audience members of the CDN live stream, and capturing devices can see or capture the watermark image. Currently, only one watermark can be added to the live video stream. Any new watermark added will replace the previous one. The watermark coordinates depend on the settings in the setVideoEncoderConfigurationEx method: If the video encoding orientation (OrientationMode) is fixed to landscape or adaptive landscape, the watermark uses landscape coordinates. If the video encoding orientation (OrientationMode) is fixed to portrait or adaptive portrait, the watermark uses portrait coordinates. When setting the watermark coordinates, the watermark image area must not exceed the video dimensions set in the setVideoEncoderConfigurationEx method; otherwise, the exceeding part will be cropped. You must call this method after calling enableVideo. The watermark image to be added must be in PNG format. This method supports all pixel formats of PNG images: RGBA, RGB, Palette, Gray, and Alpha_gray. If the size of the PNG image to be added does not match the size set in this method, the SDK will scale or crop the PNG image to match the settings. If you have already started local video preview using the startPreview method, the visibleInPreview parameter of this method can be used to set whether the watermark is visible during preview. If local video mirroring is enabled, the local watermark will also be mirrored. To avoid the watermark being mirrored when local users view their own video, it is recommended not to use both mirroring and watermark features simultaneously for local video. Implement the local watermark feature at the application level.

  • watermarkUrl Local path of the watermark image to be added. This method supports adding watermark images from local absolute/relative paths.
  • options Settings for the watermark image to be added. See WatermarkOptions.
  • connection Connection information. See RtcConnection.

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> addVideoWatermarkEx(
    {required String watermarkUrl,
    required WatermarkOptions options,
    required RtcConnection connection});