setVideoWatermark method

Future<int?> setVideoWatermark(
  1. string imagePath,
  2. WatermarkConfig watermarkConfig
)

@detail api @hiddensdk(audiosdk) @author zhushufan.ref @brief Adds watermark to designated video stream. @param imagePath File path of the watermark image. You can use the absolute path, the asset path(/assets/xx.png), or the URI path(content://). The path should be less than 512 bytes.
The watermark image should be in PNG or JPG format. @param watermarkConfig Watermark configurations. See RTCWatermarkConfig{@link #RTCWatermarkConfig}. @return - 0: Success. - < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details @note - Call clearVideoWatermark{@link #RTCEngine#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. - When 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(
    string imagePath, WatermarkConfig watermarkConfig) async {
  $a() => ($instance as $p_a.RTCEngine).setVideoWatermark(
      imagePath, unpackObject<$p_a.RTCWatermarkConfig>(watermarkConfig));
  $i() => ($instance as $p_i.ByteRTCEngine).setVideoWatermark(imagePath,
      unpackObject<$p_i.ByteRTCVideoWatermarkConfig>(watermarkConfig));

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}