milmilmilmil
API 参考

Streaming

Direct, remux and HLS streaming endpoints (with thumbnail VTT)

GET
/api/v1/stream/hls/{token}/master.m3u8

Path Parameters

token*string

Response Body

application/vnd.apple.mpegurl

curl -X GET "https://example.com/api/v1/stream/hls/string/master.m3u8"
"string"
GET
/api/v1/stream/hls/{token}/{segment}

Path Parameters

token*string
segment*string

Response Body

video/MP2T

curl -X GET "https://example.com/api/v1/stream/hls/string/string"
"string"
GET
/api/v1/stream/{fileId}/direct

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

fileId*string

Response Body

video/*

curl -X GET "https://example.com/api/v1/stream/string/direct"
"string"
GET
/api/v1/stream/{fileId}/remux

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

fileId*string

Response Body

video/mp4

curl -X GET "https://example.com/api/v1/stream/string/remux"
"string"
GET
/api/v1/stream/{fileId}/sprite.jpg

Served without authentication: the sprite is referenced by the authenticated WebVTT track and is addressed by an unguessable file UUID. Request the thumbnails track first — the sprite is generated there.

Path Parameters

fileId*string
Formatuuid

Response Body

image/jpeg

curl -X GET "https://example.com/api/v1/stream/497f6eca-6276-4993-bfeb-53cbbbba6f08/sprite.jpg"
"string"
GET
/api/v1/stream/{fileId}/thumbnails

WebVTT cues pointing into the sprite sheet served at ../sprite.jpg. The first request renders the sprite, which can take a while; the render keeps running if the client disconnects, so a retry is served from cache.

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

fileId*string
Formatuuid

Response Body

text/vtt

curl -X GET "https://example.com/api/v1/stream/497f6eca-6276-4993-bfeb-53cbbbba6f08/thumbnails"
"string"
POST
/api/v1/stream/{fileId}/transcode

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

fileId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/stream/string/transcode" \  -H "Content-Type: application/json" \  -d '{}'
{  "token": "string",  "status": "string"}