Cloudflare.StreamLiveInput (Cloudflare v0.5.0)

Copy Markdown View Source

Stream Live Inputs

Create a live input

POST /accounts/{account_id}/stream/live_inputs

Creates a live input, and returns credentials that you or your users can use to stream live video to Cloudflare Stream.

Responses

200 Create a live input response.

Data is at body["result"]

{
  "created": "*string*",
  "deleteRecordingAfterDays": "*number*",
  "enabled": "*boolean*",
  "meta": {},
  "modified": "*string*",
  "recording": {
    "allowedOrigins": [
      "*string*"
    ],
    "hideLiveViewerCount": "*boolean*",
    "mode": "*string*",
    "requireSignedURLs": "*boolean*",
    "timeoutSeconds": "*integer*"
  },
  "rtmps": {
    "streamKey": "*string*",
    "url": "*string*"
  },
  "rtmpsPlayback": {
    "streamKey": "*string*",
    "url": "*string*"
  },
  "srt": {
    "passphrase": "*string*",
    "streamId": "*string*",
    "url": "*string*"
  },
  "srtPlayback": {
    "passphrase": "*string*",
    "streamId": "*string*",
    "url": "*string*"
  },
  "status": "*string*",
  "uid": "*string*",
  "webRTC": {
    "url": "*string*"
  },
  "webRTCPlayback": {
    "url": "*string*"
  }
}
4XX Create a live input response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "result": {},
  "success": "*boolean*"
}

List live inputs

GET /accounts/{account_id}/stream/live_inputs

Lists the live inputs created for an account. To get the credentials needed to stream to a specific live input, request a single live input.

Responses

200 List live inputs response.

Data is at body["result"]

{
  "liveInputs": [
    null
  ],
  "range": "*integer*",
  "total": "*integer*"
}
4XX List live inputs response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Update a live input

PUT /accounts/{account_id}/stream/live_inputs/{live_input_identifier}

Updates a specified live input.

Responses

200 Update a live input response.

Data is at body["result"]

{
  "created": "*string*",
  "deleteRecordingAfterDays": "*number*",
  "enabled": "*boolean*",
  "meta": {},
  "modified": "*string*",
  "recording": {
    "allowedOrigins": [
      "*string*"
    ],
    "hideLiveViewerCount": "*boolean*",
    "mode": "*string*",
    "requireSignedURLs": "*boolean*",
    "timeoutSeconds": "*integer*"
  },
  "rtmps": {
    "streamKey": "*string*",
    "url": "*string*"
  },
  "rtmpsPlayback": {
    "streamKey": "*string*",
    "url": "*string*"
  },
  "srt": {
    "passphrase": "*string*",
    "streamId": "*string*",
    "url": "*string*"
  },
  "srtPlayback": {
    "passphrase": "*string*",
    "streamId": "*string*",
    "url": "*string*"
  },
  "status": "*string*",
  "uid": "*string*",
  "webRTC": {
    "url": "*string*"
  },
  "webRTCPlayback": {
    "url": "*string*"
  }
}
4XX Update a live input response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Retrieve a live input

GET /accounts/{account_id}/stream/live_inputs/{live_input_identifier}

Retrieves details of an existing live input.

Responses

200 Retrieve a live input response.

Data is at body["result"]

{
  "created": "*string*",
  "deleteRecordingAfterDays": "*number*",
  "enabled": "*boolean*",
  "meta": {},
  "modified": "*string*",
  "recording": {
    "allowedOrigins": [
      "*string*"
    ],
    "hideLiveViewerCount": "*boolean*",
    "mode": "*string*",
    "requireSignedURLs": "*boolean*",
    "timeoutSeconds": "*integer*"
  },
  "rtmps": {
    "streamKey": "*string*",
    "url": "*string*"
  },
  "rtmpsPlayback": {
    "streamKey": "*string*",
    "url": "*string*"
  },
  "srt": {
    "passphrase": "*string*",
    "streamId": "*string*",
    "url": "*string*"
  },
  "srtPlayback": {
    "passphrase": "*string*",
    "streamId": "*string*",
    "url": "*string*"
  },
  "status": "*string*",
  "uid": "*string*",
  "webRTC": {
    "url": "*string*"
  },
  "webRTCPlayback": {
    "url": "*string*"
  }
}
4XX Retrieve a live input response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Delete a live input

DELETE /accounts/{account_id}/stream/live_inputs/{live_input_identifier}

Prevents a live input from being streamed to and makes the live input inaccessible to any future API calls.

Responses

200 Delete a live input response.

Data is at body["result"]

4XX Delete a live input response failure.

Disable a live input

POST /accounts/{account_id}/stream/live_inputs/{live_input_identifier}/disable

Prevents a live input from being streamed to and makes the live input inaccessible to any future API calls until enabled.

Responses

200 Disable a live input response.

Data is at body["result"]

{
  "created": "*string*",
  "deleteRecordingAfterDays": "*number*",
  "enabled": "*boolean*",
  "meta": {},
  "modified": "*string*",
  "recording": {
    "allowedOrigins": [
      "*string*"
    ],
    "hideLiveViewerCount": "*boolean*",
    "mode": "*string*",
    "requireSignedURLs": "*boolean*",
    "timeoutSeconds": "*integer*"
  },
  "rtmps": {
    "streamKey": "*string*",
    "url": "*string*"
  },
  "rtmpsPlayback": {
    "streamKey": "*string*",
    "url": "*string*"
  },
  "srt": {
    "passphrase": "*string*",
    "streamId": "*string*",
    "url": "*string*"
  },
  "srtPlayback": {
    "passphrase": "*string*",
    "streamId": "*string*",
    "url": "*string*"
  },
  "status": "*string*",
  "uid": "*string*",
  "webRTC": {
    "url": "*string*"
  },
  "webRTCPlayback": {
    "url": "*string*"
  }
}
4XX Disable a live input response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Enable a live input

POST /accounts/{account_id}/stream/live_inputs/{live_input_identifier}/enable

Allows a live input to be streamed to and makes the live input accessible to any future API calls.

Responses

200 Enable a live input response.

Data is at body["result"]

{
  "created": "*string*",
  "deleteRecordingAfterDays": "*number*",
  "enabled": "*boolean*",
  "meta": {},
  "modified": "*string*",
  "recording": {
    "allowedOrigins": [
      "*string*"
    ],
    "hideLiveViewerCount": "*boolean*",
    "mode": "*string*",
    "requireSignedURLs": "*boolean*",
    "timeoutSeconds": "*integer*"
  },
  "rtmps": {
    "streamKey": "*string*",
    "url": "*string*"
  },
  "rtmpsPlayback": {
    "streamKey": "*string*",
    "url": "*string*"
  },
  "srt": {
    "passphrase": "*string*",
    "streamId": "*string*",
    "url": "*string*"
  },
  "srtPlayback": {
    "passphrase": "*string*",
    "streamId": "*string*",
    "url": "*string*"
  },
  "status": "*string*",
  "uid": "*string*",
  "webRTC": {
    "url": "*string*"
  },
  "webRTCPlayback": {
    "url": "*string*"
  }
}
4XX Enable a live input response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Create a new output, connected to a live input

POST /accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs

Creates a new output that can be used to simulcast or restream live video to other RTMP or SRT destinations. Outputs are always linked to a specific live input — one live input can have many outputs.

Responses

200 Create a new output, connected to a live input response.

Data is at body["result"]

null
4XX Create a new output, connected to a live input response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "result": {},
  "success": "*boolean*"
}

List all outputs associated with a specified live input

GET /accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs

Retrieves all outputs associated with a specified live input.

Responses

200 List all outputs associated with a specified live input response.

Data is at body["result"]

[
  null
]
4XX List all outputs associated with a specified live input response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Update an output

PUT /accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs/{output_identifier}

Updates the state of an output.

Responses

200 Update an output response.

Data is at body["result"]

null
4XX Update an output response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "documentation_url": "*string*",
      "message": "*string*",
      "source": {
        "pointer": "*string*"
      }
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Delete an output

DELETE /accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs/{output_identifier}

Deletes an output and removes it from the associated live input.

Responses

200 Delete an output response.

Data is at body["result"]

4XX Delete an output response failure.

Summary

Functions

client(opts \\ [])

create(body, opts \\ [])

@spec create(
  body :: Restlax.Resource.action_body(),
  opts :: Restlax.Resource.action_options()
) ::
  {:ok, map()} | {:error, term()}

create!(body, opts \\ [])

@spec create!(
  body :: Restlax.Resource.action_body(),
  opts :: Restlax.Resource.action_options()
) ::
  map() | no_return()

delete(id, opts \\ [])

@spec delete(id :: term(), opts :: Restlax.Resource.action_options()) ::
  {:ok, map()} | {:error, term()}

delete!(id, opts \\ [])

@spec delete!(id :: term(), opts :: Restlax.Resource.action_options()) ::
  map() | no_return()

disable(live_input_id, opts \\ [])

Disables a live input (POST action).

enable(live_input_id, opts \\ [])

Enables a live input (POST action).

index(opts \\ [])

@spec index(opts :: Restlax.Resource.action_options()) ::
  {:ok, map()} | {:error, term()}

index!(opts \\ [])

@spec index!(opts :: Restlax.Resource.action_options()) :: map() | no_return()

outputs(live_input_id, opts \\ [])

Lists outputs associated with a live input.

path_for(id, opts \\ [])

@spec path_for(term(), [{:action, String.t()}]) :: String.t()

show(id, opts \\ [])

@spec show(id :: term(), opts :: Restlax.Resource.action_options()) ::
  {:ok, map()} | {:error, term()}

show!(id, opts \\ [])

@spec show!(id :: term(), opts :: Restlax.Resource.action_options()) ::
  map() | no_return()

update(id, body, opts \\ [])

@spec update(
  id :: term(),
  body :: Restlax.Resource.action_body(),
  opts :: Restlax.Resource.action_options()
) :: {:ok, map()} | {:error, term()}

update!(id, body, opts \\ [])

@spec update!(
  id :: term(),
  body :: Restlax.Resource.action_body(),
  opts :: Restlax.Resource.action_options()
) :: map() | no_return()