This endpoint allows you to add an audio or subtitle track to an existing media file using its media ID. You need to provide the track URL along with its type (audio or subtitle), language name and language code in the request payload.
How it works
-
Send a POST request to the /on-demand/{mediaId}/tracks endpoint, replacing {mediaId} with the media ID.
-
Provide the necessary details in the request body, including the track URL, type, language name, and language code.
-
Receive a response containing a unique track ID and the details of the newly added track.
Webhook Events
-
After successfully adding a track, your system will receive the webhook event video.media.track.created.
-
Once the track is processed and ready, you will receive the webhook event video.media.track.ready.
-
Finally, an update event video.media.updated will notify your system about the media's updated status.
Use case: Suppose you have a video uploaded to the FastPix platform, and you want to add an Italian audio track to it. By calling this API, you can attach an external audio file (https://static.fastpix.io/music-1.mp3) to the media file. Similarly, if you need to add subtitles in different languages, you can specify type: "subtitle" with the corresponding subtitle file, language code and language name.