Create a video message from URLs
Create a video message from an uploaded video element with the OpenIM Flutter SDK.
Construct a video message object using video and thumbnail URLs and metadata already uploaded to external object storage:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
videoElem | VideoElem | Yes | Video metadata model containing the verified video URL, thumbnail cover URL, UUIDs, byte sizes, duration, and display dimensions. |
Code example
final message = await OpenIM.iMManager.messageManager
.createVideoMessageByURL(videoElem: videoElem);The video and snapshot cover attributes in VideoElem must reflect actual media upload results to enable recipients to display thumbnails and stream playback smoothly.
Return value
Returns a Future resolving to a video Message object ready for transmission. Its video payload is stored in videoElem.
State changes after the call
Creating a message only constructs the local message data structure in memory; it does not perform network transmission and does not trigger new-message event callbacks. Because the video has already been uploaded, pass the returned Message instance to Send a message without OSS to deliver it without duplicate uploads. If you need the SDK to upload local video files automatically, see Create a video message.
Was this page helpful?