IVS / Client / get_stream

get_stream#

IVS.Client.get_stream(**kwargs)#

Gets information about the active (live) stream on a specified channel.

See also: AWS API Documentation

Request Syntax

response = client.get_stream(
    channelArn='string'
)
Parameters:

channelArn (string) –

[REQUIRED]

Channel ARN for stream to be accessed.

Return type:

dict

Returns:

Response Syntax

{
    'stream': {
        'channelArn': 'string',
        'health': 'HEALTHY'|'STARVING'|'UNKNOWN',
        'playbackUrl': 'string',
        'startTime': datetime(2015, 1, 1),
        'state': 'LIVE'|'OFFLINE',
        'streamId': 'string',
        'viewerCount': 123
    }
}

Response Structure

  • (dict) –

    • stream (dict) –

      • channelArn (string) –

        Channel ARN for the stream.

      • health (string) –

        The stream’s health.

      • playbackUrl (string) –

        URL of the master playlist, required by the video player to play the HLS stream.

      • startTime (datetime) –

        Time of the stream’s start. This is an ISO 8601 timestamp; note that this is returned as a string.

      • state (string) –

        The stream’s state. Do not rely on the OFFLINE state, as the API may not return it; instead, a “NotBroadcasting” error will indicate that the stream is not live.

      • streamId (string) –

        Unique identifier for a live or previously live stream in the specified channel.

      • viewerCount (integer) –

        A count of concurrent views of the stream. Typically, a new view appears in viewerCount within 15 seconds of when video playback starts and a view is removed from viewerCount within 1 minute of when video playback ends. A value of -1 indicates that the request timed out; in this case, retry.

Exceptions

  • IVS.Client.exceptions.ResourceNotFoundException

  • IVS.Client.exceptions.AccessDeniedException

  • IVS.Client.exceptions.ValidationException

  • IVS.Client.exceptions.ChannelNotBroadcasting