setVideoWatermark abstract method

Future<int?> setVideoWatermark({
  1. StreamIndex streamIndex = StreamIndex.main,
  2. required String imagePath,
  3. required WatermarkConfig watermarkConfig,
})

Adds watermark to designated video stream.

imagePath: File path of the watermark image. You can use the absolute path or the Asset path(/assets/xx.png).
The path should be less than 512 bytes.
The watermark image should be in PNG or JPG format.

Return value:

Notes:

  • Call RTCVideo.clearVideoWatermark to remove the watermark on the designated video stream.
  • You can only add one watermark to one video stream. The newly added watermark replaces the previous one. You can call this API multiple times to add watermarks to different streams.
  • You can call this API before and after joining room.
  • If you mirror the preview, or the preview and the published stream, the watermark will also be mirrored locally, but the published watermark will not be mirrored.
  • hen you enable simulcast mode, the watermark will be added to all video streams, and it will scale down to smaller encoding configurations accordingly.

Implementation

Future<int?> setVideoWatermark({
  StreamIndex streamIndex = StreamIndex.main,
  required String imagePath,
  required WatermarkConfig watermarkConfig,
});