setWatermark abstract method
void
setWatermark(
- String imagePath,
- TRTCVideoStreamType streamType,
- double x,
- double y,
- 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
- Android:
- streamType(TRTCVideoStreamType):
- Video stream type to which the watermark is added (TRTCVideoStreamType.big or TRTCVideoStreamType.sub).
- 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);