SDKsuni-app
Create a video message from URLs
OpenIM uni-app / uni-app x SDK guide for Create a video message from URLs.
createVideoMessageByURL() creates a message from uploaded video and snapshot metadata.
Parameters
| Parameter | Type | Description |
|---|---|---|
videoPath | string or null | Local name or business path; use an empty string for remote-only media. |
duration | number or null | Video duration. |
videoType | string or null | Video MIME type. |
videoUUID, videoUrl, videoSize | nullable | Uploaded video ID, URL, and byte size. |
snapshotPath | string or null | Snapshot local name or business path. |
snapshotUUID, snapshotUrl, snapshotSize | nullable | Uploaded snapshot ID, URL, and byte size. |
snapshotWidth, snapshotHeight | number or null | Snapshot dimensions in pixels. |
import { createVideoMessageByURL } from '@/uni_modules/unix-openim-sdk'
const message = await createVideoMessageByURL({
videoPath: '', duration, videoType: uploadedVideo.contentType,
videoUUID: createBusinessUUID(), videoUrl: uploadedVideo.url,
videoSize: uploadedVideo.size, snapshotPath: '',
snapshotUUID: createBusinessUUID(), snapshotSize: uploadedSnapshot.size,
snapshotUrl: uploadedSnapshot.url, snapshotWidth, snapshotHeight,
})Use real uploaded URLs, IDs, sizes, duration, and MIME type. Both resources must be accessible to recipients and must not expose private storage credentials. OpenIMVideoElem does not contain the Wasm snapShotType field. Send the created message with sendMessageNotOss().
Was this page helpful?