Skip to content

Commit 9650a64

Browse files
committed
Docs edits for hasAudio/hasVideo (startArchive).
And other minor docs edits.
1 parent 8682230 commit 9650a64

File tree

2 files changed

+49
-6
lines changed

2 files changed

+49
-6
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The OpenTok Java SDK lets you generate
66
[sessions](http://tokbox.com/opentok/tutorials/create-session/) and
77
[tokens](http://tokbox.com/opentok/tutorials/create-token/) for [OpenTok](http://www.tokbox.com/)
88
applications that run on the JVM. This version of the SDK also includes support for working
9-
with [OpenTok 2.0 archives](http://tokbox.com/#archiving).
9+
with [OpenTok archives](http://tokbox.com/#archiving).
1010

1111
If you are updating from a previous version of this SDK, see
1212
[Important changes since v2.2.0](#important-changes-since-v220).
@@ -143,6 +143,19 @@ Archive archive = opentok.startArchive(sessionId, null);
143143
String archiveId = archive.getId();
144144
```
145145

146+
You can also disable audio or video recording by setting the `hasAudio` or `hasVideo` parameters of
147+
the `startArchive(String sessionId, String name, boolean hasVideo, boolean hasAudio` method to `false`:
148+
149+
```java
150+
import com.opentok.Archive;
151+
152+
// Start an audio-only archive
153+
Archive archive = opentok.startArchive(sessionId, null, false, true);
154+
155+
// Store this archiveId in the database for later use
156+
String archiveId = archive.getId();
157+
```
158+
146159
You can stop the recording of a started Archive using a `com.opentok.Archive` instance's
147160
`stopArchive(String archiveId)` method.
148161

@@ -221,8 +234,7 @@ OpenTok TURN server to relay audio-video streams.
221234

222235
**Changes in v2.2.0:**
223236

224-
This version of the SDK includes support for working with OpenTok 2.0 archives. (This API does not
225-
work with OpenTok 1.0 archives.)
237+
This version of the SDK includes support for working with OpenTok archives.
226238

227239
This version of the SDK includes a number of improvements in the API design. These include a number
228240
of API changes. See the OpenTok 2.2 SDK Reference for details on the new API.

src/main/java/com/opentok/OpenTok.java

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,32 @@ public ArchiveList listArchives(int offset, int count) throws OpenTokException {
369369
}
370370
}
371371

372+
/**
373+
* Starts archiving an OpenTok session. This version of the <code>startArchive()</code> method
374+
* lets you disable audio or video recording.
375+
*
376+
* <p>
377+
* Clients must be actively connected to the OpenTok session for you to successfully start recording an archive.
378+
* <p>
379+
* You can only record one archive at a time for a given session. You can only record archives
380+
* of sessions that use the OpenTok Media Router (sessions with the
381+
* <a href="http://tokbox.com/opentok/tutorials/create-session/#media-mode">media mode</a>
382+
* set to routed); you cannot archive sessions with the media mode set to relayed.
383+
*
384+
* @param sessionId The session ID of the OpenTok session to archive.
385+
*
386+
* @param name The name of the archive. You can use this name to identify the archive. It is a property
387+
* of the Archive object, and it is a property of archive-related events in the OpenTok client libraries.
388+
*
389+
* @return The Archive object. This object includes properties defining the archive, including the archive ID.
390+
*/
372391
public Archive startArchive(String sessionId, String name) throws OpenTokException {
373392
return startArchive(sessionId, name, true, true);
374393
}
375394

376395
/**
377-
* Starts archiving an OpenTok 2.0 session.
396+
* Starts archiving an OpenTok session. This version of the <code>startArchive()</code> method
397+
* lets you disable audio or video recording.
378398
*
379399
* <p>
380400
* Clients must be actively connected to the OpenTok session for you to successfully start recording an archive.
@@ -385,8 +405,19 @@ public Archive startArchive(String sessionId, String name) throws OpenTokExcepti
385405
* set to routed); you cannot archive sessions with the media mode set to relayed.
386406
*
387407
* @param sessionId The session ID of the OpenTok session to archive.
408+
*
388409
* @param name The name of the archive. You can use this name to identify the archive. It is a property
389-
* of the Archive object, and it is a property of archive-related events in the OpenTok JavaScript SDK.
410+
* of the Archive object, and it is a property of archive-related events in the OpenTok client libraries.
411+
*
412+
* @param hasVideo Whether the archive will include an audio track (<code>true</code>) or not
413+
* <code>false</code>). The default value is <code>true</code> (an audio track is included). If you set
414+
* both <code>hasAudio</code> and <code>hasAudio</code> to <code>false</code>, the call to the
415+
* <code>startArchive()</code> method results in an error.
416+
*
417+
* @param hasAudio Whether the archive will include a video track (<code>true</code>) or not
418+
* <code>false</code>). The default value is <code>true</code> (a video track is included). If you set
419+
* both <code>hasAudio</code> and <code>hasAudio</code> to <code>false</code>, the call to the
420+
* <code>startArchive()</code> method results in an error.
390421
*
391422
* @return The Archive object. This object includes properties defining the archive, including the archive ID.
392423
*/
@@ -410,7 +441,7 @@ public Archive startArchive(String sessionId, String name, boolean hasVideo, boo
410441
* session being archived.
411442
*
412443
* @param archiveId The archive ID of the archive you want to stop recording.
413-
* @return The Archive object corresponding to the archive being STOPPED.
444+
* @return The Archive object corresponding to the archive being stopped.
414445
*/
415446
public Archive stopArchive(String archiveId) throws OpenTokException {
416447

0 commit comments

Comments
 (0)