You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::KinesisVideoMedia::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-kinesisvideomedia/lib/aws-sdk-kinesisvideomedia/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



153
154
155
# File 'gems/aws-sdk-kinesisvideomedia/lib/aws-sdk-kinesisvideomedia/client.rb', line 153

def initialize(*args)
  super
end

Instance Method Details

#get_media(params = {}) ⇒ Types::GetMediaOutput

Use this API to retrieve media content from a Kinesis video stream. In the request, you identify stream name or stream Amazon Resource Name (ARN), and the starting chunk. Kinesis Video Streams then returns a stream of chunks in order by fragment number.

You must first call the GetDataEndpoint API to get an endpoint to which you can then send the GetMedia requests.

When you put media data (fragments) on a stream, Kinesis Video Streams stores each incoming fragment and related metadata in what is called a "chunk." For more information, see . The GetMedia API returns a stream of these chunks starting from the chunk that you specify in the request.

The following limits apply when using the GetMedia API:

  • A client can call GetMedia up to five times per second per stream.

  • Kinesis Video Streams sends media data at a rate of up to 25 megabytes per second (or 200 megabits per second) during a GetMedia session.

Examples:

Request syntax with placeholder values


resp = client.get_media({
  stream_name: "StreamName",
  stream_arn: "ResourceARN",
  start_selector: { # required
    start_selector_type: "FRAGMENT_NUMBER", # required, accepts FRAGMENT_NUMBER, SERVER_TIMESTAMP, PRODUCER_TIMESTAMP, NOW, EARLIEST, CONTINUATION_TOKEN
    after_fragment_number: "FragmentNumberString",
    start_timestamp: Time.now,
    continuation_token: "ContinuationToken",
  },
})

Response structure


resp.content_type #=> String
resp.payload #=> IO

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :stream_name (String)

    The Kinesis video stream name from where you want to get the media content. If you don't specify the streamName, you must specify the streamARN.

  • :stream_arn (String)

    The ARN of the stream from where you want to get the media content. If you don't specify the streamARN, you must specify the streamName.

  • :start_selector (required, Types::StartSelector)

    Identifies the starting chunk to get from the specified stream.

Returns:

See Also:



222
223
224
225
# File 'gems/aws-sdk-kinesisvideomedia/lib/aws-sdk-kinesisvideomedia/client.rb', line 222

def get_media(params = {}, options = {}, &block)
  req = build_request(:get_media, params)
  req.send_request(options, &block)
end