Browse SDKs · Android
SDKsAndroid

Create a video message

Create a video message from paths relative to the SDK data directory.

Copy

Parameters

ParameterTypeRequiredDescription
videoPathStringYesVideo path relative to the SDK data directory.
mimeTypeStringYesVideo type such as mp4.
durationSecondslongYesVideo duration in seconds.
snapshotPathStringYesCover-image path relative to the SDK data directory.
Message message = OpenIMClient.getInstance().messageManager.createVideoMessage(
    videoPath,
    mimeType,
    durationSeconds,
    snapshotPath
);

Both files must be readable. The returned Message is only a local pending object. The SDK uploads the media and delivers the message when you continue with Send a message.