Create player streamer

POST /v1/PlayerStreamers

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.

  • StatusCallback string(uri)

    The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See Status Callbacks for more details.

  • StatusCallbackMethod string(http-method)

    The HTTP method Twilio should use to call the status_callback URL. Can be POST or GET and the default is POST.

    Values are HEAD, GET, POST, PATCH, PUT, or DELETE.

  • Video boolean

    Specifies whether the PlayerStreamer is configured to stream video. Defaults to true.

Responses

  • Created

    Hide response attributes Show response attributes object
    • account_sid string | null

      The SID of the Account that created the resource

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • date_created string(date-time) | null

      The ISO 8601 date and time in GMT when the resource was created

    • date_updated string(date-time) | null

      The ISO 8601 date and time in GMT when the resource was last updated

    • ended_reason string | null

      The reason why a PlayerStreamer ended

      Values are ended-via-api, max-duration-exceeded, stream-disconnected-by-source, or unexpected-failure.

    • max_duration integer | null

      Maximum PlayerStreamer duration in seconds

    • sid string | null

      The unique string that identifies the resource

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^VJ[0-9a-fA-F]{32}$.

    • status string | null

      The status of the PlayerStreamer

      Values are created, started, ended, or failed.

    • status_callback string(uri) | null

      The URL to which Twilio will send PlayerStreamer event updates

    • status_callback_method string(http-method) | null

      The HTTP method Twilio should use to call the status_callback URL

      Values are HEAD, GET, POST, PATCH, PUT, or DELETE.

    • url string(uri) | null

      The absolute URL of the resource

    • video boolean | null

      Whether the PlayerStreamer is configured to stream video

POST /v1/PlayerStreamers
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'
Request example
{
  "MaxDuration": 42,
  "StatusCallback": "https://example.com",
  "StatusCallbackMethod": "HEAD",
  "Video": true
}
Request examples
{
  "MaxDuration": 42,
  "StatusCallback": "https://example.com",
  "StatusCallbackMethod": "HEAD",
  "Video": true
}
Response examples (201)
{
  "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
}
Response examples (201)
{
  "account_sid": "string",
  "date_created": "2024-05-04T09:42:00+00:00",
  "date_updated": "2024-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
}