Video Message

Sending a message with video

To send a video message, you must pass a valid local file URL instance instead. You can also specify an optional caption as part of the message. This caption is accessible via the data property in the message model under the caption key. You can add up to 1,000 characters of text per message. When a video is uploaded, it is automatically resized to the maximum size of 480p.

Requirements for videos:

  • The maximum file size of the video is 1 GB.

  • The thumbnail for the video message is created automatically.

Playing a message with video

To play a video, the SDK provides the function AmityVideoData.getVideo(resolution:), which returns a ready-to-play HTTP URL.

Available Video Resolutions

After a video message is created, the videos are transcoded from the original resolution. AmityVideoResolution is an enum that represents the video resolution. When you create a video message, the original resolution is available immediately after the message is created. However, the transcoded resolution takes time and will only be available later. You can use the property AmityVideoData.videoUrls to get the available resolution for the current message.

Video Data Attributes

The SDK provides AmityVideoData.attributes, which returns a dictionary of video file attributes that might be useful for your application.

Last updated