Skip to content

Commit 48d3314

Browse files
committed
Docs edits.
1 parent 0efe4eb commit 48d3314

File tree

4 files changed

+56
-15
lines changed

4 files changed

+56
-15
lines changed

README.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ The OpenTok Java SDK lets you generate
88
applications that run on the JVM. The SDK also includes support for working with
99
[OpenTok archives](http://tokbox.com/opentok/tutorials/archiving).
1010

11-
If you are updating from a previous version of this SDK, see
12-
[Important changes since v2.2.0](#important-changes-since-v220).
13-
1411

1512
# Installation
1613

@@ -151,19 +148,41 @@ Archive archive = opentok.startArchive(sessionId, null);
151148
String archiveId = archive.getId();
152149
```
153150

154-
You can also disable audio or video recording by setting the `hasAudio` or `hasVideo` parameters of
155-
the `startArchive(String sessionId, String name, boolean hasVideo, boolean hasAudio` method to `false`:
151+
You can also disable audio or video recording by calling the `hasAudio(false)` or `hasVideo(false)`
152+
methods of an `AchiveProperties` object you pass into the `OpenTok.startArchive(String sessionId,
153+
ArchiveProperties properties)` method:
156154

157155
```java
158156
import com.opentok.Archive;
157+
import com.opentok.ArchiveProperties;
159158

160159
// Start an audio-only archive
161-
Archive archive = opentok.startArchive(sessionId, null, false, true);
160+
Archive archive = opentok.startArchive(sessionId, new ArchiveProperties.Builder()
161+
.hasVideo(false)
162+
.build()););
163+
164+
// Store this archiveId in the database for later use
165+
String archiveId = archive.getId();
166+
```
167+
168+
Setting the output mode to `Archive.OutputMode.INDIVIDUAL` setting causes each stream in the archive
169+
to be recorded to its own individual file:
170+
171+
```java
172+
import com.opentok.Archive;
173+
import com.opentok.ArchiveProperties;
174+
175+
Archive archive = opentok.startArchive(sessionId, new ArchiveProperties.Builder()
176+
.archiveMode(Archive.OutputMode.INDIVIDUAL)
177+
.build()););
162178

163179
// Store this archiveId in the database for later use
164180
String archiveId = archive.getId();
165181
```
166182

183+
The `Archive.OutputMode.COMPOSED` setting (the default) causes all streams in the archive are
184+
recorded to a single (composed) file.
185+
167186
You can stop the recording of a started Archive using a `com.opentok.Archive` instance's
168187
`stopArchive(String archiveId)` method.
169188

@@ -203,6 +222,15 @@ List<Archive> archives = opentok.listArchives(0, 50);
203222
List<Archive> archives = opentok.listArchives(50, 50);
204223
```
205224

225+
Note that you can also create an automatically archived session, by passing `ArchiveMode.ALWAYS`
226+
into the `archiveMode()` method of the SessionPropertiesBuilder object you use to build the
227+
`sessionProperties` parameter passed into the `OpenTok->createSession()` method (see "Creating
228+
Sessions," above).
229+
230+
For more information on archiving, see the
231+
[OpenTok archiving](https://tokbox.com/opentok/tutorials/archiving/) programming guide.
232+
233+
206234
# Samples
207235

208236
There are two sample applications included with the SDK. To get going as fast as possible, clone the whole

src/main/java/com/opentok/Archive.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ public enum Status {
3333
*/
3434
FAILED,
3535

36+
/**
37+
* The archive is in progress and no clients are publishing streams to the session.
38+
* When an archive is in progress and any client publishes a stream, the status is STARTED.
39+
* When an archive is PAUSED, nothing is recorded. When a client starts publishing a stream,
40+
* the recording starts (or resumes). If all clients disconnect from a session that is being
41+
* archived, the status changes to PAUSED, and after 60 seconds the archive recording stops
42+
* (and the status changes to STOPPED).
43+
*/
3644
PAUSED,
3745

3846
/**
@@ -61,16 +69,17 @@ public enum Status {
6169
}
6270

6371
/**
64-
* Defines values returned by the {@link Archive#getOutputMode} method.
72+
* Defines values used in the
73+
* {@link ArchiveProperties.Builder#outputMode(com.opentok.Archive.OutputMode)} method
74+
* and returned by the {@link Archive#getOutputMode} method.
6575
*/
6676
public enum OutputMode {
6777
/**
68-
* The archive file is available for download from the OpenTok cloud. You can get the URL of
69-
* the download file by calling the {@link Archive#getUrl} method.
78+
* All streams in the archive are recorded to a single (composed) file.
7079
*/
7180
COMPOSED,
7281
/**
73-
* The archive file has been deleted.
82+
* Each stream in the archive is recorded to its own individual file.
7483
*/
7584
INDIVIDUAL;
7685

src/main/java/com/opentok/ArchiveProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ private ArchiveProperties(Builder builder) {
3737
}
3838

3939
/**
40-
* Use this class to create a SessionProperties object.
40+
* Use this class to create a ArchiveProperties object.
4141
*
42-
* @see SessionProperties
42+
* @see ArchiveProperties
4343
*/
4444
public static class Builder {
4545
private String name = null;

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,19 @@ public ArchiveList listArchives(int offset, int count) throws OpenTokException {
372372
/**
373373
* Starts archiving an OpenTok session. This version of the <code>startArchive()</code> method
374374
* lets you disable audio or video recording.
375-
*
376375
* <p>
377-
* Clients must be actively connected to the OpenTok session for you to successfully start recording an archive.
376+
* Clients must be actively connected to the OpenTok session for you to successfully start
377+
* recording an archive.
378378
* <p>
379379
* You can only record one archive at a time for a given session. You can only record archives
380380
* of sessions that use the OpenTok Media Router (sessions with the
381381
* <a href="http://tokbox.com/opentok/tutorials/create-session/#media-mode">media mode</a>
382382
* set to routed); you cannot archive sessions with the media mode set to relayed.
383-
*
383+
* <p>
384+
* For more information on archiving, see the
385+
* <a href="https://tokbox.com/opentok/tutorials/archiving/">OpenTok archiving</a>
386+
* programming guide.
387+
*
384388
* @param sessionId The session ID of the OpenTok session to archive.
385389
*
386390
* @param properties This ArchiveProperties object defines options for the archive.

0 commit comments

Comments
 (0)