setWatermark abstract method

void setWatermark(
  1. String imagePath,
  2. TRTCVideoStreamType streamType,
  3. double x,
  4. double y,
  5. double width,
)

Set watermark

This API adds a watermark to the local video stream. The watermark will be displayed in the top-left corner of the video by default, but you can adjust its position and size.

Parameters:

  • imagePath(String):
    • Path to the watermark image file. Supported formats: JPG, PNG.
    • Example paths:
      • Android: /storage/emulated/0/Android/data/com.tencent.rtc.flutter.example/files/watermark.png
      • iOS: /Library/Caches/watermark.png
  • streamType(TRTCVideoStreamType):
  • x(double):
    • X coordinate of the watermark's top-left corner (normalized to 0.0–1.0).
  • y(double):
    • Y coordinate of the watermark's top-left corner (normalized to 0.0–1.0).
  • width(double):
    • Width of the watermark (normalized to 0.0–1.0).

Note:

  • This API is currently not supported on macOS and Windows.

Implementation

void setWatermark(String imagePath, TRTCVideoStreamType streamType, double x, double y, double width);