Suggestions

close search

Add Messaging, Voice, and Authentication to your apps with Vonage Communications APIs

Visit the Vonage API Developer Portal

Class: OpenTok::Streams

Inherits:
Object
Defined in:
lib/opentok/streams.rb

Overview

A class for working with OpenTok streams. It includes methods for getting info about OpenTok streams and for setting layout classes for streams.

Instance Method Summary

Instance Method Details

#all(session_id) ⇒ StreamList

Use this method to get information on all OpenTok streams in a session.

For example, you can call this method to get information about layout classes used by OpenTok streams. The layout classes define how the stream is displayed in the layout of a live streaming broadcast or a composed archive. For more information, see Assigning layout classes to streams in live streaming broadcasts and Customizing the video layout for composed archives.

Parameters:

  • session_id (String)

    The session ID of the OpenTok session.

Returns:

  • (StreamList)

    The StreamList of Stream objects.

Raises:

  • (ArgumentError)

    The stream_id or session_id is invalid.

  • (OpenTokAuthenticationError)

    You are not authorized to fetch the stream information. Check your authentication credentials.

  • (OpenTokError)

    An OpenTok server error.

#find(session_id, stream_id) ⇒ Stream

Use this method to get information on an OpenTok stream.

For example, you can call this method to get information about layout classes used by an OpenTok stream. The layout classes define how the stream is displayed in the layout of a broadcast stream. For more information, see Assigning layout classes to streams in live streaming broadcasts and Customizing the video layout for composed archives.

Parameters:

  • session_id (String)

    The session ID of the OpenTok session.

  • stream_id (String)

    The stream ID within the session.

Returns:

  • (Stream)

    The Stream object.

Raises:

  • (ArgumentError)

    stream_id or session_id is invalid.

  • (OpenTokAuthenticationError)

    You are not authorized to fetch the stream information. Check your authentication credentials.

  • (OpenTokError)

    An OpenTok server error.

#layout(session_id, opts) ⇒ Object

Use this method to set the layout of a composed (archive or broadcast) OpenTok stream.

For example, you can call this method to set the layout classes of an OpenTok stream. The layout classes define how the stream is displayed in the layout of a live streaming broadcast or a composed archive. For more information, see Assigning layout classes to streams in live streaming broadcasts and Customizing the video layout for composed archives.

For more information, see Layouthttps://tokbox.com/developer/rest/#change-stream-layout-classes-composed

Parameters:

  • session_id (String)

    The session ID of the OpenTok session.

  • opts (Hash)

    A hash with one key items and value as array of objects having stream_id and layoutClassList properties.

Raises:

  • (ArgumentError)

    The session_id is invalid.

  • (OpenTokAuthenticationError)

    You are not authorized to fetch the stream information. Check your authentication credentials.

  • (OpenTokStreamLayoutError)

    The layout operation could not be performed due to incorrect layout values.

  • (OpenTokError)

    An OpenTok server error.