setWatermarks method

Future<void> setWatermarks(
  1. List<BaseWatermarkConfig> configs
)

Applies watermark overlays (text and/or image) on the video player.

Pass an empty list to clear all watermarks. Each BaseWatermarkConfig (TextWatermarkConfig / WatermarkConfig or ImageWatermarkConfig) creates an independent watermark overlay.

Supported configurations:

  • TextWatermarkConfig (or WatermarkConfig):
    • text: Watermark text (required).
    • x: Horizontal position as 0–100 percent (default: 0).
    • y: Vertical position as 0–100 percent (default: 0).
    • color: Text color as ARGB int (default: white).
    • textSize: Text size in SP (default: 14).
    • opacity: 0.0 (invisible) to 1.0 (fully opaque) (default: 0.3).
    • animation: Optional animation (e.g., WatermarkAnimation with WatermarkAnimationType.pingPong or WatermarkAnimationType.random).
  • ImageWatermarkConfig:
    • imageUrl: HTTPS URL of the watermark image (required).
    • width: Width in logical pixels / dp (default: 48).
    • height: Height in logical pixels / dp (default: 48).
    • x: Horizontal position as 0–100 percent (default: 92).
    • y: Vertical position as 0–100 percent (default: 88).
    • opacity: 0.0 (invisible) to 1.0 (fully opaque) (default: 1.0).

Implementation

Future<void> setWatermarks(List<BaseWatermarkConfig> configs) =>
    _nativeApi.setWatermarks(configs.map((c) => c.toPigeon()).toList());