An object representing an OpenTok archive.
Do not call the new()
constructor. To start recording an archive, call the
OpenTok.startArchive() method.
Properties:
Name | Type | Description |
---|---|---|
createdAt |
Number | The time at which the archive was created, in milliseconds since the UNIX epoch. |
duration |
String | The duration of the archive, in seconds. |
hasAudio |
Boolean | Whether the archive has an audio track (true ) or not (false ).
You can prevent audio from being recorded by setting
hasAudio to false
in the options parameter you pass into the
OpenTok.startArchive() method. |
hasVideo |
Boolean | Whether the archive has an video track (true ) or not (false ).
You can prevent video from being recorded by setting
hasVideo to false
in the options parameter you pass into the
OpenTok.startArchive() method. |
id |
String | The archive ID. |
name |
String | The name of the archive. If no name was provided when the archive was created, this is set to null. |
streamMode |
String | The stream mode for the archive. This can be set to one of the the following:
|
outputMode |
String | The output mode to be generated for this archive, which can be one of the following:
|
projectId |
String | The API key associated with the archive. |
reason |
String | For archives with the status "stopped" or "failed", this string describes the reason the archive stopped (such as "maximum duration exceeded") or failed. |
resolution |
String | The resolution of the archive (either "640x480", "1280x720" or "1920x1080"). This property is only set for composed archives. |
sessionId |
String | The session ID of the OpenTok session associated with this archive. |
size |
Number | The size of the MP4 file. For archives that have not been generated, this value is set to 0. |
status |
String | The status of the archive, which can be one of the following:
|
url |
String | The download URL of the available MP4 file. This is only set for an archive with the status set to "available"; for other archives, (including archives with the status "uploaded") this property is set to null. The download URL is obfuscated, and the file is only available from the URL for 10 minutes. To generate a new URL, call the OpenTok.getArchive() or OpenTok.listArchives() method. |
multiArchiveTag |
String | Set this to support recording multiple archives for the same session simultaneously. Set this to a unique string for each simultaneous archive of an ongoing session. You must also set this option when manually starting an archive that is automatically archived. Note that the multiArchiveTag value is not included in the response for the methods to list archives and retrieve archive information. If you do not specify a unique multiArchiveTag, you can only record one archive at a time for a given session. See Simultaneous archives. |
Methods
Name | Description |
---|---|
delete(callback) |
Deletes the OpenTok archive. |
stop(callback) |
Stops the recording of the archive. |
delete(callback)
Deletes the OpenTok archive.
You can only delete an archive which has a status of "available" or "uploaded". 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.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | The function to call upon completing the operation. On successfully deleting the archive, the function is called with no arguments passed in. On failure, an error object is passed into the function. |
stop(callback)
Stops the recording of the archive.
Archives automatically stop recording after 120 minutes or when all clients have disconnected from the session being archived.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | The function to call upon completing the operation. Two arguments
are passed to the function:
|