audio_tracks
Creates, updates, deletes, gets or lists an audio_tracks resource.
Overview
| Name | audio_tracks |
| Type | Resource |
| Id | cloudflare.streams.audio_tracks |
Fields
The following fields are returned by SELECT queries:
- list
Lists additional audio tracks on a video.
| Name | Datatype | Description |
|---|---|---|
default | boolean | Denotes whether the audio track will be played by default in a player. |
label | string | A string to uniquely identify the track amongst other audio track labels for the specified video. (example: director commentary) |
status | string | Specifies the processing status of the video. (queued, ready, error) |
uid | string | A Cloudflare-generated unique identifier for a media item. (example: ea95132c15732412d22c1476fa83f27a) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_id, identifier | Lists additional audio tracks on a video. Note this API will not return information for audio attached to the video upload. | |
copy | insert | account_id, identifier, label | Adds an additional audio track to a video using the provided audio track URL. | |
edit | update | account_id, identifier, audio_identifier | 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. | |
delete | delete | account_id, identifier, audio_identifier | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
audio_identifier | string | |
identifier | string | Resource identifier. |
SELECT examples
- list
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
- copy
- Manifest
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
;
# Description fields are for documentation purposes
- name: audio_tracks
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the audio_tracks resource.
- name: identifier
value: "{{ identifier }}"
description: Required parameter for the audio_tracks resource.
- name: label
value: "{{ label }}"
description: |
A string to uniquely identify the track amongst other audio track labels for the specified video.
- name: url
value: "{{ url }}"
description: |
An audio track URL. The server must be publicly routable and support `HTTP HEAD` requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` requests with a `content-range` header that includes the size of the file.
UPDATE examples
- edit
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
- delete
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
;