Skip to content
中文

Limits and errors

Field limits

LimitValue
capability_seconds (playback credential lifetime)100–3000 seconds, 600 by default
allowed_origins entriesat most 20; an empty array means any origin
renditionsone or more of 480, 720, 1080, no repeats, all three by default
description lengthat most 2000 characters
speedsnumbers from 0.25 to 4, and 1 must be included
accent_color#rrggbb
default_qualityauto or one of the renditions
content_id bytesat 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:

  1. The backend calls POST /file/v1/uploads/signed with filename, bytes (the exact byte count), content_type and purpose:"user_data". Up to 100 MB (104857600 bytes) it returns one url for a single PUT; above that it returns parts[].url (64000000 bytes per part by default), a complete_url and a status_url.
  2. The browser splits the file by part_size and PUTs each part straight to its parts[].url, in any order (each PUT needs its exact Content-Length, and Content-Type where needed). When every part is done it POSTs complete_url with no body. After a break it GETs status_url to see the received parts and resends only the missing ones.
  3. Once the file object is there, poll GET /file/v1/files/{file_id} until the state is active, then the backend calls POST /media/v1/libraries/{library_id}/assets/import with {"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

CodeHTTPFix
CONTENT_NOT_FOUND404The content does not exist, belongs to another organization, or is archived; check the id
VERSION_NOT_FOUND404The named version does not exist
SOURCE_NOT_FOUND404The source asset is missing from the library or was deleted
CONTENT_INVALID_STATE409The state forbids the action: take a published content down before archiving, and archived is final
SOURCE_NOT_READY409The target version is still transcoding; wait for readiness to be ready
CONTENT_NOT_PUBLISHED403The content is not published, so the play was refused; publish it first
RESOURCE_NOT_GRANTED403No valid viewer token, or the token’s grant does not cover this content
CUSTOMER_BLOCKED403The viewer is blocked
ORIGIN_NOT_ALLOWED403The request origin is not in allowed_origins
SIGN_IN_REVOKED401The sign-in was revoked; sign in again with a new grant code
SIGN_IN_EXPIRED401The sign-in expired; sign in again with a new grant code
ACCESS_TOKEN_EXPIRED401The access token expired but the sign-in is live; renew it (the browser scripts do this)
UPSTREAM_UNAVAILABLE502An upstream is unavailable (Media or the token issuer); retry later
INVALID_PARAMS400A 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.