Create player streamer
A PlayerStreamer resource provides the ability to send a livestream to a JavaScript, iOS, or Android Player SDK.
Body
-
The maximum time, in seconds, that the PlayerStreamer 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 PlayerStreamer, regardless of whether media is still streaming.
-
The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See Status Callbacks for more details.
-
The HTTP method Twilio should use to call the
status_callbackURL. Can bePOSTorGETand the default isPOST.Values are
HEAD,GET,POST,PATCH,PUT, orDELETE. -
Specifies whether the PlayerStreamer is configured to stream video. Defaults to
true.
curl \
-X POST https://media.twilio.com/v1/PlayerStreamers \
--user "username:password" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'MaxDuration=42&StatusCallback=https%3A%2F%2Fexample.com&StatusCallbackMethod=HEAD&Video=true'
{
"MaxDuration": 42,
"StatusCallback": "https://example.com",
"StatusCallbackMethod": "HEAD",
"Video": true
}
{
"MaxDuration": 42,
"StatusCallback": "https://example.com",
"StatusCallbackMethod": "HEAD",
"Video": true
}
{
"account_sid": "string",
"date_created": "2023-05-04T09:42:00+00:00",
"date_updated": "2023-05-04T09:42:00+00:00",
"ended_reason": "ended-via-api",
"links": {},
"max_duration": 42,
"sid": "string",
"status": "created",
"status_callback": "https://example.com",
"status_callback_method": "HEAD",
"url": "https://example.com",
"video": true
}
{
"account_sid": "string",
"date_created": "2025-05-04T09:42:00Z",
"date_updated": "2025-05-04T09:42:00Z",
"ended_reason": "ended-via-api",
"links": {},
"max_duration": 42,
"sid": "string",
"status": "created",
"status_callback": "https://example.com",
"status_callback_method": "HEAD",
"url": "https://example.com",
"video": true
}