Skip to main content
Clip posts publish an uploaded clip into a user or community feed. Upload the clip first, then pass the uploaded file ID or clip data into the post creation API.
Use clip posts for short-form video experiences that need the clip post type. Use video posts when you only need the standard uploaded-video post flow.

Parameters

ParameterRequiredDescription
clip or fileIdYesUploaded clip data or clip file ID, depending on SDK
textNoCaption text shown with the post
displayModeNoClip display mode where supported, such as fill or fit
isMutedNoWhether playback should start muted where supported
targetTypeYesFeed target, usually community or user
targetIdYesCommunity ID or user ID for the target feed

Create a Clip Post

Create a clip post from an uploaded clip file or clip data, and include optional display settings where supported.
import { PostRepository } from "@amityco/ts-sdk";

const { data: post } = await PostRepository.createClipPost({
  targetType: "community",
  targetId: communityId,
  data: {
    text: "Watch this clip",
  },
  attachments: [
    {
      type: "clip",
      fileId,
      displayMode: "fill",
      isMuted: false,
    },
  ],
});
fun createClipPost(uploadedClip: AmityClip, communityId: String) {
    postRepository.createClipPost(
        targetType = AmityPost.TargetType.COMMUNITY,
        targetId = communityId,
        clip = uploadedClip,
        text = "Watch this clip",
        displayMode = AmityClip.DisplayMode.FILL,
        isMuted = false
    )
        .subscribe(
            { post -> showSuccessMessage(post.getPostId()) },
            { error -> handleGeneralError(error) }
        )
}
func createClipPost(
    uploadedClip: AmityClipData,
    communityId: String
) async throws -> AmityPost {
    let postRepository = AmityPostRepository()
    let builder = AmityClipPostBuilder()
    builder.setClip(uploadedClip)
    builder.setText("Watch this clip")
    builder.setDisplayMode(.fill)
    builder.setIsMuted(false)

    return try await postRepository.createClipPost(
        builder,
        targetId: communityId,
        targetType: .community,
        metadata: nil,
        mentionees: nil
    )
}
The current Flutter public post creation builder does not expose a clip post creator. It supports text, image, video, file, poll, live stream, and custom post creation.

Platform Notes

  • TypeScript exposes PostRepository.createClipPost() with attachments: [{ type: "clip", fileId }].
  • Android exposes AmityPostRepository.createClipPost() with an uploaded AmityClip.
  • iOS exposes AmityPostRepository.createClipPost() with AmityClipPostBuilder and uploaded AmityClipData.
  • Flutter does not currently expose a public clip post creation method.

Video Handling

Upload video files before creating video-based posts.

Video Posts

Create standard uploaded-video posts.

Mixed Media Posts

Combine multiple supported media attachments in one post.