@@ -8,9 +8,6 @@ The OpenTok Java SDK lets you generate
8
8
applications that run on the JVM. The SDK also includes support for working with
9
9
[ OpenTok archives] ( http://tokbox.com/opentok/tutorials/archiving ) .
10
10
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
-
14
11
15
12
# Installation
16
13
@@ -151,19 +148,41 @@ Archive archive = opentok.startArchive(sessionId, null);
151
148
String archiveId = archive. getId();
152
149
```
153
150
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:
156
154
157
155
``` java
158
156
import com.opentok.Archive ;
157
+ import com.opentok.ArchiveProperties ;
159
158
160
159
// 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()););
162
178
163
179
// Store this archiveId in the database for later use
164
180
String archiveId = archive. getId();
165
181
```
166
182
183
+ The ` Archive.OutputMode.COMPOSED ` setting (the default) causes all streams in the archive are
184
+ recorded to a single (composed) file.
185
+
167
186
You can stop the recording of a started Archive using a ` com.opentok.Archive ` instance's
168
187
` stopArchive(String archiveId) ` method.
169
188
@@ -203,6 +222,15 @@ List<Archive> archives = opentok.listArchives(0, 50);
203
222
List<Archive > archives = opentok. listArchives(50 , 50 );
204
223
```
205
224
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
+
206
234
# Samples
207
235
208
236
There are two sample applications included with the SDK. To get going as fast as possible, clone the whole
0 commit comments