Suggestions

close search

Class: OpenTok::Archives

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

Overview

A class for working with OpenTok archives.

Instance Method Summary

Instance Method Details

- (ArchiveList) all(options = {})

Returns an ArchiveList, which is an array of archives that are completed and in-progress, for your API key.

Parameters:

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

    A hash with keys defining which range of archives to retrieve.

Options Hash (options):

  • :offset (integer)

    Optional. The index offset of the first archive. 0 is offset of the most recently started archive. 1 is the offset of the archive that started prior to the most recent archive. If you do not specify an offset, 0 is used.

  • :count (integer)

    Optional. The number of archives to be returned. The maximum number of archives returned is 1000.

Returns:

  • (ArchiveList)

    An ArchiveList object, which is an array of Archive objects.

Raises:

  • (ArgumentError)

- (Archive) create(session_id, options = {})

Starts archiving an OpenTok session.

Clients must be actively connected to the OpenTok session for you to successfully start recording an archive.

You can only record one archive at a time for a given session. You can only record archives of sessions that use the OpenTok Media Router (sessions with the media mode set to routed); you cannot archive sessions with the media mode set to relayed.

For more information on archiving, see the OpenTok archiving programming guide.

:name.

Parameters:

  • session_id (String)

    The session ID of the OpenTok session to archive.

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

    A hash with the key ‘name’, ‘has_audio’, and ‘has_video’ (or

Options Hash (options):

  • :name (String)

    This is the name of the archive. You can use this name to identify the archive. It is a property of the Archive object, and it is a property of archive-related events in the OpenTok client SDKs.

  • :has_audio (true, false)

    Whether the archive will include an audio track (true) or not false). The default value is true (an audio track is included). If you set both has_audio and has_video to false, the call to the create() method results in an error.

  • :has_video (true, false)

    Whether the archive will include a video track (true) or not false). The default value is true (a video track is included). If you set both has_audio and has_video to false, the call to the create() method results in an error.

  • :output_mode (String)

    Whether all streams in the archive are recorded to a single file (:composed, the default) or to individual files (:individual). For more information on archiving and the archive file formats, see the OpenTok archiving programming guide.

Returns:

  • (Archive)

    The Archive object, which includes properties defining the archive, including the archive ID.

Raises:

  • (OpenTokArchiveError)

    The archive could not be started. The request was invalid or the session has no connected clients.

  • (OpenTokAuthenticationError)

    Authentication failed while starting an archive. Invalid API key.

  • (OpenTokArchiveError)

    The archive could not be started. The session ID does not exist.

  • (OpenTokArchiveError)

    The archive could not be started. The session could be peer-to-peer or the session is already being recorded.

  • (OpenTokArchiveError)

    The archive could not be started.

- (Object) delete_by_id(archive_id)

Deletes an OpenTok archive.

You can only delete an archive which has a status of "available", "uploaded", or "deleted". Deleting an archive removes its record from the list of archives. For an "available" archive, it also removes the archive file, making it unavailable for download. For a "deleted" archive, the archive remains deleted.

Parameters:

  • archive_id (String)

    The archive ID of the archive you want to delete.

Raises:

- (Archive) find(archive_id)

Gets an Archive object for the given archive ID.

Parameters:

  • archive_id (String)

    The archive ID.

Returns:

  • (Archive)

    The Archive object.

Raises:

- (Archive) stop_by_id(archive_id)

Stops an OpenTok archive that is being recorded.

Archives automatically stop recording after 120 minutes or when all clients have disconnected from the session being archived.

Parameters:

  • archive_id (String)

    The archive ID of the archive you want to stop recording.

Returns:

  • (Archive)

    The Archive object corresponding to the archive being stopped.

Raises: