Turn a video's direct MP4 link on or off
const url = 'https://api.ebitex.io/assets/management/v1/assets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/direct-mp4';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"enabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.ebitex.io/assets/management/v1/assets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/direct-mp4 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "enabled": true }'Turns the direct MP4 link on or off for a public video, with { "enabled": true } or { "enabled": false }. The link is a plain .mp4 file at a public URL, for tools that cannot play a streaming video (a social scheduler, an email, a <video> tag). It is off until you turn it on. Turning it on starts the file being made for every rendition and answers at once with each rendition processing; read the link with GET on the same path until each is ready. Asking again retries a rendition that failed.
The link is not limited by the Video hosting list in the Assets settings. Anyone who has the URL can download or embed the video from any site, which uses your video delivery allowance. Turn the link off, or delete the asset, to withdraw it. The video stays public either way.
The delivered asset’s video file carries the URL as mp4Url while the link is on and ready, and has no such member otherwise.
Key: an Assets management key with assets.management.write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "enabled": true}Responses
Section titled “ Responses ”The same shape as GET.
missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired.
payment_required: the organization’s subscription needs attention.
scope_denied: the key is not an Assets management key. permission_denied: a read key was used for a write. app_not_available: Assets is not enabled for the organization. origin_denied or ip_denied: the key was used from an origin or address outside its restrictions.
not_found: there is no such asset in the organization.
direct_mp4_requires_public_video: the asset is not a video, or is not public yet. direct_mp4_unavailable: this environment has no video delivery host. asset_changed: the asset changed while the request was being made; read it again and retry.
too_many_failed_authentications: too many bad keys from this address; rate_limited: too many requests from the organization. Retry-After says how long to wait.
stream_unavailable: turning the link off could not remove the MP4 for every rendition, so it may still be served. Try again.