RtcImage

Image properties.

class RtcImage {
  const RtcImage(
      {this.url,
      this.x,
      this.y,
      this.width,
      this.height,
      this.zOrder,
      this.alpha});

  @JsonKey(name: 'url')
  final String? url;
  @JsonKey(name: 'x')
  final int? x;
  @JsonKey(name: 'y')
  final int? y;
  @JsonKey(name: 'width')
  final int? width;
  @JsonKey(name: 'height')
  final int? height;
  @JsonKey(name: 'zOrder')
  final int? zOrder;
  @JsonKey(name: 'alpha')
  final double? alpha;
  factory RtcImage.fromJson(Map<String, dynamic> json) =>
      _$RtcImageFromJson(json);
  Map<String, dynamic> toJson() => _$RtcImageToJson(this);
}

Used to set the properties of watermark and background images in live video.

Properties

url
The HTTP/HTTPS URL of the image on the live video. The character length must not exceed 1024 bytes.
x
The x-coordinate (px) of the image on the video frame, using the top-left corner of the output video frame as the origin.
y
The y-coordinate (px) of the image on the video frame, using the top-left corner of the output video frame as the origin.
width
The width (px) of the image on the video frame.
height
The height (px) of the image on the video frame.
zOrder
The layer index of the watermark or background image. When adding one or more watermarks using a watermark array, you must assign a value to zOrder. The valid range is [1,255]; otherwise, the SDK will report an error. In other cases, zOrder is optional. The valid range is [0,255], with 0 as the default. 0 represents the bottom layer, and 255 represents the top layer.
alpha
The transparency of the watermark or background image. The valid range is [0.0,1.0]:
  • 0.0: Fully transparent.
  • 1.0: (Default) Fully opaque.