addVideoWatermark abstract method
- required String watermarkUrl,
- required WatermarkOptions options,
Adds a local video watermark.
Deprecated Deprecated: This method is deprecated. Use addVideoWatermarkWithConfig instead. This method adds a PNG image as a watermark to the local published live video stream. Users in the same live channel, audience of the CDN live stream, and capture devices can all see or capture the watermark image. Currently, only one watermark can be added to the live video stream. Adding a new watermark replaces the previous one. The watermark coordinates depend on the settings in the setVideoEncoderConfiguration method: If the video orientation (OrientationMode) is fixed to landscape or adaptive landscape mode, landscape coordinates are used. If the video orientation (OrientationMode) is fixed to portrait or adaptive portrait mode, portrait coordinates are used. When setting the watermark coordinates, the image area of the watermark must not exceed the video dimensions set in the setVideoEncoderConfiguration method. Otherwise, the exceeding part will be cropped. You must call this method after calling enableVideo. If you only want to add a watermark during CDN streaming, you can use this method or startRtmpStreamWithTranscoding to set the watermark. The watermark image 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 scales or crops the PNG image to match the settings. If you have set the local video to mirror mode, the local watermark will also be mirrored. To avoid mirrored watermark when local users view their own video, it is recommended not to use both mirror and watermark features on local video. Implement the local watermark feature at the application layer.
watermarkUrlThe local path of the watermark image to be added. This method supports adding watermark images from local absolute/relative paths.optionsSettings for the watermark image to be added. See WatermarkOptions.
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> addVideoWatermark(
{required String watermarkUrl, required WatermarkOptions options});