Media

Introduction
Media objects in ittybit represent organized collections of files related to the same content.
(Simplified example. We'll cover additional props in later sections.)
Multiple Files
Each media object can contain multiple file objects.
Files are organized by their purpose: sources, tracks, and intelligence.
For example, a video in your project might have:
Ref | Description | Object |
---|---|---|
original | The original video file | source |
poster | A poster image | source |
subtitles | A subtitles track | track |
speech | The full transcript | intelligence |
It would be represented by a media object that looks like this:
Sources
Source files contain the actual content. They're the binary files that contain the pixels and sound.
At it's simplest, a source is what you'd pass to an <img>
or <video>
tag's src
attribute.
In real projects, you'll usually want to provide multiple sources for a media object.
For example, you might want to generate a poster image for the video, which can be used to display a thumbnail or preview before playback begins.
You might then want to provide a version of the video in the more efficient WEBM format for browsers that support it, and fallback to your MP4 version for browsers that don't.
There are many reasons a media object might have multiple sources:
- The original is a large file and you want to save bandwidth by providing smaller versions to mobile users.
- The original is a video and you want to provide compatible formats for different devices.
- The original is an image and you want to provide more efficient formats to browsers that support them.
- The original is an audio and you want to provide multiple languages.
See the Sources section for more details.
Sources
Tracks
Tracks are supplementary files that provide additional information about the media to media players.
For example, a video might have a source file with the video and audio content, plus tracks generated for subtitles, chapters, and thumbnails.
Media objects might contain tracks when:
- The original is video or audio, and you want to provide subtitles (maybe in multiple languages).
- The original is a video and you want to provide chapters.
- The original is a video and you want to provide thumbnails.
See the Tracks section for more details.
Tracks
Intelligence
Intelligence files are generated by AI models and contain rich data about the media.
For example, a video might have intelligence files with a transcript, a list of tags, and a short but detailed description.
See the Intelligence section for more details.
Intelligence
Media Props
ID
The id
property is a unique identifier for the media object.
It is set by the API and is immutable.
Object
For media objects the object
property is always "media"
.
Kind
The kind
property is inherited from the media object's original file.
It will be one of video
, image
, or audio
.
Title
The title
property allows you to give your media a human-readable name.
This is useful for organization and display purposes in your application.
Alt
The alt
property is a human-readable description of the media.
This is useful for SEO and accessibility.
Files
The files
property contains an array of file objects.
Files
Files can be Source, Track, or Intelligence objects.
URLs
Media objects include convenience URLs for any sources, tracks, and intelligence files that have been given a ref
prop (see refs).
Created
The created
property is the date and time the media object was created.
Ittybit uses ISO 8601 format for all date and time properties, and sets them to UTC (Coordinated Universal Time).
The created
property is set automatically by the API when you create a new media object.
Updated
The updated
property is the date and time the media object was last updated.
The updated
property is set automatically by the API. Initially it will be the same as the created
property, then it will be updated whenever the media object is modified.
Status
The status
property is the current status of the media object.
The status
property is one of pending
, processing
, ready
, or failed
.
Metadata
See the Metadata section for more details.
Metadata
API Reference
See the API Reference section for a full rundown of the media object, its properties, the available endpoints, and how to use them.