createVideoMessage method
创建视频文件 videoFilePath 路径 type 视频类型,如 mp4 mov 等 duration 视频时长,单位 s snapshotPath 视频封面图片路径 inputElement 用于选择视频文件的 DOM 节点 (只有web端用到且必填)
Implementation
Future<V2TimValueCallback<V2TimMsgCreateInfoResult>> createVideoMessage({
required String videoFilePath,
required String type,
required int duration,
required String snapshotPath,
dynamic inputElement,
}) async {
if (await pathExits(videoFilePath) && await pathExits(snapshotPath)) {
return TencentCloudChatSdkPlatform.instance.createVideoMessage(
videoFilePath: videoFilePath,
type: type,
duration: duration,
snapshotPath: snapshotPath,
inputElement: inputElement,
);
}
return V2TimValueCallback<V2TimMsgCreateInfoResult>.fromJson({
"code": -5,
"desc": "videoFilePath or snapshotPath is not found",
"data": V2TimMsgCreateInfoResult.fromJson(
{},
),
});
}