Browse SDKs · React Native
SDKsReact Native

Create a video message from files

OpenIM React Native SDK guide for create a video message from files.

Copy

Use createVideoMessageFromFullPath() to create a message from a video file and cover image on the device.

const message = await OpenIMSDK.createVideoMessageFromFullPath({
  videoPath,
  videoType: 'video/mp4',
  duration: 36,
  snapshotPath,
});

Parameters

ParameterTypeRequiredDescription
videoPathstringYesFull path to the video file.
videoTypestringYesVideo type.
durationnumberYesVideo duration in seconds.
snapshotPathstringYesFull path to the video cover image.

The call returns a MessageItem ready to send. Use Send a message to upload the local video and cover image.