setDummyCaptureImagePath method
@detail api
@hiddensdk(audiosdk)
@author liuyangyang
@brief Set an alternative image when the local internal video capture is not enabled.
When you call stopVideoCapture, an alternative image will be pushed. You can set the path to null or open the camera to stop publishing the image.
You can repeatedly call this API to update the image.
@param filePath Set the path of the static image.
You can use the absolute path (file://xxx) or the asset directory path (/assets/xx.png). The maximum size for the path is 512 bytes.
You can upload a .JPG, .JPEG, .PNG, or .BMP file.
When the aspect ratio of the image is inconsistent with the video encoder configuration, the image will be proportionally resized, with the remaining pixels rendered black. The framerate and the bitrate are consistent with the video encoder configuration.
@return
- 0: Success.
- -2: Failure. Ensure that the filePath is valid.
- -12: This method is not available in the Audio SDK.
@note
- The API is only effective when publishing an internally captured video.
- You cannot locally preview the image.
- You can call this API before and after joining an RTC room. In the multi-room mode, the image can be only displayed in the room you publish the stream.
- You cannot apply effects like filters and mirroring to the image, while you can watermark the image.
- The image is not effective for a screen-sharing stream.
- When you enable the simulcast mode, the image will be added to all video streams, and it will be proportionally scaled down to smaller encoding configurations.
Implementation
Future<int?> setDummyCaptureImagePath(string filePath) async {
$a() => ($instance as $p_a.RTCEngine).setDummyCaptureImagePath(filePath);
$i() =>
($instance as $p_i.ByteRTCEngine).setDummyCaptureImagePath(filePath);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}