Path parameters
-
The SID of the CompositionHook resource to update.
Body
-
AudioSources array[string]
An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in
audio_sources
except those specified inaudio_sources_excluded
. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example,student*
includes tracks namedstudent
as well asstudentTeam
. -
AudioSourcesExcluded array[string]
An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in
audio_sources
except for those specified inaudio_sources_excluded
. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example,student*
excludesstudent
as well asstudentTeam
. This parameter can also be empty. -
Enabled boolean
Whether the composition hook is active. When
true
, the composition hook will be triggered for every completed Group Room in the account. Whenfalse
, the composition hook never triggers. -
Format string
The container format of the media files used by the compositions created by the composition hook. Can be:
mp4
orwebm
and the default iswebm
. Ifmp4
orwebm
,audio_sources
must have one or more tracks and/or avideo_layout
element must contain a validvideo_sources
list, otherwise an error occurs.Values are
mp4
orwebm
. -
A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account.
-
Resolution string
A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to
640x480
. The string's format is{width}x{height}
where:- 16 <=
{width}
<= 1280 - 16 <=
{height}
<= 1280 {width}
*{height}
<= 921,600
Typical values are:
- HD =
1280x720
- PAL =
1024x576
- VGA =
640x480
- CIF =
320x240
Note that the
resolution
imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See Specifying Video Layouts for more info. - 16 <=
-
StatusCallback string(uri)
The URL we should call using the
status_callback_method
to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. -
StatusCallbackMethod string(http-method)
The HTTP method we should use to call
status_callback
. Can be:POST
orGET
and the default isPOST
.Values are
HEAD
,GET
,POST
,PATCH
,PUT
, orDELETE
. -
Trim boolean
Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is
true
. Compositions withtrim
enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See Specifying Video Layouts for more info. -
A JSON object that describes the video layout of the composition hook in terms of regions. See Specifying Video Layouts for more info.
curl \
-X POST https://video.twilio.com/v1/CompositionHooks/{Sid} \
--user "username:password" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'AudioSources=string&AudioSourcesExcluded=string&Enabled=true&Format=mp4&FriendlyName=string&Resolution=string&StatusCallback=https%3A%2F%2Fexample.com&StatusCallbackMethod=HEAD&Trim=true'
{
"AudioSources": [
"string"
],
"AudioSourcesExcluded": [
"string"
],
"Enabled": true,
"Format": "mp4",
"FriendlyName": "string",
"Resolution": "string",
"StatusCallback": "https://example.com",
"StatusCallbackMethod": "HEAD",
"Trim": true
}
{
"AudioSources": [
"string"
],
"AudioSourcesExcluded": [
"string"
],
"Enabled": true,
"Format": "mp4",
"FriendlyName": "string",
"Resolution": "string",
"StatusCallback": "https://example.com",
"StatusCallbackMethod": "HEAD",
"Trim": true
}
{
"account_sid": "string",
"audio_sources": [
"string"
],
"audio_sources_excluded": [
"string"
],
"date_created": "2023-05-04T09:42:00+00:00",
"date_updated": "2023-05-04T09:42:00+00:00",
"enabled": true,
"format": "mp4",
"friendly_name": "string",
"resolution": "string",
"sid": "string",
"status_callback": "https://example.com",
"status_callback_method": "HEAD",
"trim": true,
"url": "https://example.com"
}
{
"account_sid": "string",
"audio_sources": [
"string"
],
"audio_sources_excluded": [
"string"
],
"date_created": "2024-05-04T09:42:00+00:00",
"date_updated": "2024-05-04T09:42:00+00:00",
"enabled": true,
"format": "mp4",
"friendly_name": "string",
"resolution": "string",
"sid": "string",
"status_callback": "https://example.com",
"status_callback_method": "HEAD",
"trim": true,
"url": "https://example.com"
}