This endpoint allows you to update an existing audio or subtitle track associated with a media file. When updating a track, you must provide the new track URL, language name, and language code, ensuring all three parameters are included in the request.
How it works
-
Send a PATCH request to the /on-demand/{mediaId}/tracks/{trackId} endpoint, replacing {mediaId} with the media ID, and {trackId} with the ID of the track you want to update.
-
Provide the necessary details in the request body, including the track URL to update and its corresponding language name and language code.
-
Receive a response confirming the track update.
Webhook Events
After updating a track, your system will receive webhook notifications:
-
After successfully updating a track, your system will receive the webhook event video.media.track.updated.
-
Once the new track is processed and ready, you will receive the webhook event video.media.track.ready.
-
Once the media file is updated with the new track details, a video.media.updated event will be triggered.
Use case: Suppose you previously added a French subtitle track to a video but now need to update it with a different file. By calling this API, you can replace the existing subtitle file (.vtt) with a new one while keeping the same track ID. This is useful when:
- The original track file has errors and needs correction.
- You want to improve subtitle translations or replace an audio track with a better-quality version.