> ## Documentation Index
> Fetch the complete documentation index at: https://learn.social.plus/llms.txt
> Use this file to discover all available pages before exploring further.

# Video Message

> Send video chat messages with platform-specific file ID, attachment, or URI inputs.

Use video messages for video attachments inside chat. TypeScript creates video messages from an uploaded file ID. iOS and Android use `AmityMessageAttachment`. Flutter sends video messages from a `Uri`.

## Parameters

| Parameter                       | Required | Description                                                                                   |
| ------------------------------- | -------- | --------------------------------------------------------------------------------------------- |
| `subChannelId`                  | Yes      | Target subchannel where the video message will be created.                                    |
| `fileId` / `attachment` / `Uri` | Yes      | Video input for the message: uploaded file ID, platform attachment, or Flutter `Uri`.         |
| `fileName`                      | Depends  | File name for iOS local URL attachments.                                                      |
| `parentId`                      | No       | Parent message ID when sending the video as a reply, where supported by the platform builder. |
| `tags`                          | No       | App-defined tags for message filtering, where supported by the platform builder.              |
| `metadata`                      | No       | App-defined metadata stored with the message, where supported by the platform builder.        |

## Send A Video Message

Create a video message from an uploaded file ID, native attachment, or Flutter video URI.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { MessageRepository } from '@amityco/ts-sdk';

  const { data: message } = await MessageRepository.createMessage({
    subChannelId,
    dataType: 'video',
    fileId,
  });

  renderResults(message);
  ```

  ```swift iOS theme={null}
  let videoURL = URL(fileURLWithPath: "/tmp/clip.mp4")
  let options = AmityVideoMessageCreateOptions(
      subChannelId: "sub-channel-id",
      attachment: .localURL(url: videoURL),
      fileName: "clip.mp4"
  )

  let message = try await messageRepository.createVideoMessage(options: options)
  showSuccessMessage(message.messageId)
  ```

  ```kotlin Android theme={null}
  val attachment = AmityMessageAttachment.FILE_ID(fileId)

  val disposable = AmityChatClient.newMessageRepository()
      .createVideoMessage(
          subChannelId = subChannelId,
          attachment = attachment,
      )
      .build()
      .send()
      .subscribe(
          { showSuccessMessage() },
          { error -> handleGeneralError(error) },
      )
  ```

  ```dart Flutter theme={null}
  final videoUri = Uri.parse('file:///tmp/clip.mp4');

  final message = await AmityChatClient.newMessageRepository()
      .createMessage(subChannelId)
      .video(videoUri)
      .send();
  ```
</CodeGroup>

## Related Topics

<CardGroup cols={2}>
  <Card title="File Message" href="./file-message" icon="file">
    Send generic file attachments.
  </Card>

  <Card title="Audio Message" href="./audio-message" icon="mic">
    Send audio attachments where supported.
  </Card>
</CardGroup>
