Limits and errors
Field limits
| Limit | Value |
|---|---|
capability_seconds (playback credential lifetime) | 100–3000 seconds, 600 by default |
allowed_origins entries | at most 20; an empty array means any origin |
renditions | one or more of 480, 720, 1080, no repeats, all three by default |
description length | at most 2000 characters |
speeds | numbers from 0.25 to 4, and 1 must be included |
accent_color | #rrggbb |
default_quality | auto or one of the renditions |
content_id bytes | at most 64 |
Readiness and polling
Transcoding completion has no callback. After creating a content or changing its asset, poll readiness with GET /content/v1/contents/{content_id} (every 10 seconds is enough) and publish once it is ready. Magnitude: a ten-minute video takes about a minute, longer ones proportionally. A readiness of failed means one of the wanted renditions failed to transcode; check the asset’s format, or adjust renditions and save again.
Large uploads
A single video asset is capped at 20 GiB (a Media limit). A large file does not send its bytes through the backend; the backend signs and the browser uploads directly:
- The backend calls
POST /file/v1/uploads/signedwithfilename,bytes(the exact byte count),content_typeandpurpose:"user_data". Up to 100 MB (104857600 bytes) it returns oneurlfor a single PUT; above that it returnsparts[].url(64000000 bytes per part by default), acomplete_urland astatus_url. - The browser splits the file by
part_sizeand PUTs each part straight to itsparts[].url, in any order (each PUT needs its exactContent-Length, andContent-Typewhere needed). When every part is done it POSTscomplete_urlwith no body. After a break it GETsstatus_urlto see the received parts and resends only the missing ones. - Once the file object is there, poll
GET /file/v1/files/{file_id}until the state isactive, then the backend callsPOST /media/v1/libraries/{library_id}/assets/importwith{"file_id":"file-…"}to import it as an asset.
All three upload addresses allow any origin cross-origin (the preflight answers 204 with Access-Control-Allow-Origin: *), so the browser uploads the parts itself and the bytes never pass through your backend. The signed addresses are one-time credentials: a single PUT defaults to 900 seconds, multipart to 7 days; re-sign after expiry.
Very long originals: Media’s understanding and clipping agents may time out; this does not affect Content transcoding or playback.
Error codes
| Code | HTTP | Fix |
|---|---|---|
CONTENT_NOT_FOUND | 404 | The content does not exist, belongs to another organization, or is archived; check the id |
VERSION_NOT_FOUND | 404 | The named version does not exist |
SOURCE_NOT_FOUND | 404 | The source asset is missing from the library or was deleted |
CONTENT_INVALID_STATE | 409 | The state forbids the action: take a published content down before archiving, and archived is final |
SOURCE_NOT_READY | 409 | The target version is still transcoding; wait for readiness to be ready |
CONTENT_NOT_PUBLISHED | 403 | The content is not published, so the play was refused; publish it first |
RESOURCE_NOT_GRANTED | 403 | No valid viewer token, or the token’s grant does not cover this content |
CUSTOMER_BLOCKED | 403 | The viewer is blocked |
ORIGIN_NOT_ALLOWED | 403 | The request origin is not in allowed_origins |
SIGN_IN_REVOKED | 401 | The sign-in was revoked; sign in again with a new grant code |
SIGN_IN_EXPIRED | 401 | The sign-in expired; sign in again with a new grant code |
ACCESS_TOKEN_EXPIRED | 401 | The access token expired but the sign-in is live; renew it (the browser scripts do this) |
UPSTREAM_UNAVAILABLE | 502 | An upstream is unavailable (Media or the token issuer); retry later |
INVALID_PARAMS | 400 | A request field is wrong; fix what message names |
Billing
- Transcoding: billed by output duration, $0.003 per output minute (not asset duration).
- Playback delivery: metered, shown in your organization’s usage as
media.delivery; the current unit price is 0.
Regions and network
Playback, the browser scripts and the API are all reached through the Hong Kong entry. Speed from mainland China depends on the network, and 1080p may step down automatically at peak hours.
Next steps
- Access and publishing: publish, take down, archive and origin limits, which the status errors above refer to.
- Player: how a viewer starts a play, renews the token and gets renditions.
- Content API: every operation and error code.