Skip to main content

audio_tracks

Creates, updates, deletes, gets or lists an audio_tracks resource.

Overview

Nameaudio_tracks
TypeResource
Idcloudflare.streams.audio_tracks

Fields

The following fields are returned by SELECT queries:

Lists additional audio tracks on a video.

NameDatatypeDescription
defaultbooleanDenotes whether the audio track will be played by default in a player.
labelstringA string to uniquely identify the track amongst other audio track labels for the specified video. (example: director commentary)
statusstringSpecifies the processing status of the video. (queued, ready, error)
uidstringA Cloudflare-generated unique identifier for a media item. (example: ea95132c15732412d22c1476fa83f27a)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_id, identifierLists additional audio tracks on a video. Note this API will not return information for audio attached to the video upload.
copyinsertaccount_id, identifier, labelAdds an additional audio track to a video using the provided audio track URL.
editupdateaccount_id, identifier, audio_identifierEdits additional audio tracks on a video. Editing the default status of an audio track to true will mark all other audio tracks on the video default status to false.
deletedeleteaccount_id, identifier, audio_identifierDeletes additional audio tracks on a video. Deleting a default audio track is not allowed. You must assign another audio track as default prior to deletion.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
audio_identifierstring
identifierstringResource identifier.

SELECT examples

Lists additional audio tracks on a video. Note this API will not return information for audio attached to the video upload.

SELECT
default,
label,
status,
uid
FROM cloudflare.streams.audio_tracks
WHERE account_id = '{{ account_id }}' -- required
AND identifier = '{{ identifier }}' -- required
;

INSERT examples

Adds an additional audio track to a video using the provided audio track URL.

INSERT INTO cloudflare.streams.audio_tracks (
label,
url,
account_id,
identifier
)
SELECT
'{{ label }}' /* required */,
'{{ url }}',
'{{ account_id }}',
'{{ identifier }}'
RETURNING
errors,
messages,
result,
success
;

UPDATE examples

Edits additional audio tracks on a video. Editing the default status of an audio track to true will mark all other audio tracks on the video default status to false.

UPDATE cloudflare.streams.audio_tracks
SET
default = {{ default }},
label = '{{ label }}'
WHERE
account_id = '{{ account_id }}' --required
AND identifier = '{{ identifier }}' --required
AND audio_identifier = '{{ audio_identifier }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Deletes additional audio tracks on a video. Deleting a default audio track is not allowed. You must assign another audio track as default prior to deletion.

DELETE FROM cloudflare.streams.audio_tracks
WHERE account_id = '{{ account_id }}' --required
AND identifier = '{{ identifier }}' --required
AND audio_identifier = '{{ audio_identifier }}' --required
;