Create media processor
A MediaProcessor resource provides the ability to capture content from a web application with a Twilio Media Extension to create a livestream.
Body
-
MaxDuration integer
The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming.
-
StatusCallback string(uri)
The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See Status Callbacks for details.
-
The Media Extension name or URL. Ex:
video-composer-v1
-
The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific Media Extension you are using for more information about the context to send.
-
User-defined environment variables for the Media Extension, represented as a JSON dictionary of key/value strings. See the documentation for the specific Media Extension you are using for more information about whether you need to provide this.
-
StatusCallbackMethod string(http-method)
The HTTP method Twilio should use to call the
status_callback
URL. Can bePOST
orGET
and the default isPOST
.Values are
HEAD
,GET
,POST
,PATCH
,PUT
, orDELETE
.
curl \
-X POST https://media.twilio.com/v1/MediaProcessors \
--user "username:password" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'Extension=string&ExtensionContext=string&MaxDuration=42&StatusCallback=https%3A%2F%2Fexample.com&StatusCallbackMethod=HEAD'
{
"Extension": "string",
"ExtensionContext": "string",
"MaxDuration": 42,
"StatusCallback": "https://example.com",
"StatusCallbackMethod": "HEAD"
}
{
"MaxDuration": 42,
"StatusCallback": "https://example.com",
"Extension": "string",
"ExtensionContext": "string",
"StatusCallbackMethod": "HEAD"
}
{
"account_sid": "string",
"date_created": "2023-05-04T09:42:00+00:00",
"date_updated": "2023-05-04T09:42:00+00:00",
"ended_reason": "string",
"extension": "string",
"extension_context": "string",
"max_duration": 42,
"sid": "string",
"status": "failed",
"status_callback": "https://example.com",
"status_callback_method": "HEAD",
"url": "https://example.com"
}
{
"account_sid": "string",
"date_created": "2024-05-04T09:42:00+00:00",
"date_updated": "2024-05-04T09:42:00+00:00",
"ended_reason": "string",
"extension": "string",
"extension_context": "string",
"max_duration": 42,
"sid": "string",
"status": "failed",
"status_callback": "https://example.com",
"status_callback_method": "HEAD",
"url": "https://example.com"
}