setVideoMuteImage method

Future<int?> setVideoMuteImage(
  1. String? assetUrl,
  2. int fps
)

Set an alternative image for when the local screen is paused to replace the black screen that users see when they enter a room without video streaming

After the local video pushing is paused, the image set through this API will still be pushed

Parameters:

assetUrl can be an asset resource address defined in Flutter such as 'images/watermark_img.png' or an online image address

fps Frame rate of the image set to be pushed. Minimum value: 5. Maximum value: 20. Default value: 10

Not supported on:

  • web
  • Windows

Implementation

Future<int?> setVideoMuteImage(
    String? assetUrl, // Resource address in `assets`
    int fps) async {
  String? imageUrl = assetUrl;
  String type = 'network'; // Online image by default
  if (assetUrl != null && assetUrl.indexOf('http') != 0) {
    type = 'local';
  }
  return _cloudChannel!.invokeMethod(
      'setVideoMuteImage', {"imageUrl": imageUrl, "type": type, "fps": fps});
}