Skip to content

Commit 55a4971

Browse files
committed
Merge pull request #74 from opentok/archiving-updates
Archiving updates
2 parents 9419f96 + a226f39 commit 55a4971

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2471
-162
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ jdk:
77
notifications:
88
slack:
99
secure: fGRoClN1IQiZvokEiqmKOrF7EeaNQDHDHqUMaT4n7d3qW2fMe3N8ZLxlIDlzgJ2pv09VWqK7rmPgdhJR8yVG7OE4QQ5kzR59xD8ePN0j0jf6W6eOBPq3a9UUarnny21LFsShvRMZ/BaXcvTox1zMVltpMGFw2K4ijH8+ZvdkNz8=
10+
before_script:
11+
- echo $JAVA_OPTS
12+
- export JAVA_OPTS="$JAVA_OPTS -Xmx1024m"

README.md

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
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/)
8-
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).
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).
8+
applications that run on the JVM. The SDK also includes support for working with
9+
[OpenTok archives](http://tokbox.com/opentok/tutorials/archiving).
1310

1411

1512
# Installation
@@ -72,6 +69,7 @@ method. The `properties` parameter is optional and it is used to specify two thi
7269

7370
* Whether the session uses the OpenTok Media Router
7471
* A location hint for the OpenTok server.
72+
* Whether the session is automatically archived.
7573

7674
An instance can be initialized using the `com.opentok.SessionProperties.Builder` class.
7775
The `sessionId` property of the returned `com.opentok.Session` instance, which you can read using
@@ -80,6 +78,7 @@ the `getSessionId()` method, is useful to get an identifier that can be saved to
8078

8179
```java
8280
import com.opentok.MediaMode;
81+
import com.opentok.ArchiveMode;
8382
import com.opentok.Session;
8483
import com.opentok.SessionProperties;
8584

@@ -96,6 +95,12 @@ Session session = opentok.createSession(new SessionProperties.Builder()
9695
.location("12.34.56.78")
9796
.build());
9897

98+
// A session that is automatically archived (it must used the routed media mode)
99+
Session session = opentok.createSession(new SessionProperties.Builder()
100+
.mediaMode(MediaMode.ROUTED)
101+
.archiveMode(ArchiveMode.ALWAYS)
102+
.build());
103+
99104
// Store this sessionId in the database for later use:
100105
String sessionId = session.getSessionId();
101106
```
@@ -143,6 +148,41 @@ Archive archive = opentok.startArchive(sessionId, null);
143148
String archiveId = archive.getId();
144149
```
145150

151+
You can also disable audio or video recording by calling the `hasAudio(false)` or `hasVideo(false)`
152+
methods of an `ArchiveProperties` builder, and passing the built object into the
153+
`OpenTok.startArchive(String sessionId, ArchiveProperties properties)` method:
154+
155+
```java
156+
import com.opentok.Archive;
157+
import com.opentok.ArchiveProperties;
158+
159+
// Start an audio-only archive
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()););
178+
179+
// Store this archiveId in the database for later use
180+
String archiveId = archive.getId();
181+
```
182+
183+
The `Archive.OutputMode.COMPOSED` setting (the default) causes all streams in the archive to be
184+
recorded to a single (composed) file.
185+
146186
You can stop the recording of a started Archive using a `com.opentok.Archive` instance's
147187
`stopArchive(String archiveId)` method.
148188

@@ -182,6 +222,15 @@ List<Archive> archives = opentok.listArchives(0, 50);
182222
List<Archive> archives = opentok.listArchives(50, 50);
183223
```
184224

225+
Note that you can also create an automatically archived session, by passing `ArchiveMode.ALWAYS`
226+
into the `archiveMode()` method of the `SessionProperties.Builder` 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+
185234
# Samples
186235

187236
There are two sample applications included with the SDK. To get going as fast as possible, clone the whole
@@ -221,8 +270,7 @@ OpenTok TURN server to relay audio-video streams.
221270

222271
**Changes in v2.2.0:**
223272

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.)
273+
This version of the SDK includes support for working with OpenTok archives.
226274

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

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,7 @@ uploadArchives {
119119
}
120120
}
121121
}
122+
123+
test {
124+
maxHeapSize = "1024m"
125+
}

docs/allclasses-frame.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (version 1.7.0_71) on Thu Feb 19 05:51:07 EST 2015 -->
5+
<!-- Generated by javadoc (version 1.7.0_71) on Fri May 22 13:27:06 PDT 2015 -->
66
<title>All Classes (OpenTok Java SDK Reference)</title>
7-
<meta name="date" content="2015-02-19">
7+
<meta name="date" content="2015-05-22">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
</head>
1010
<body>
1111
<h1 class="bar">All Classes</h1>
1212
<div class="indexContainer">
1313
<ul>
1414
<li><a href="com/opentok/Archive.html" title="class in com.opentok" target="classFrame">Archive</a></li>
15+
<li><a href="com/opentok/Archive.OutputMode.html" title="enum in com.opentok" target="classFrame">Archive.OutputMode</a></li>
1516
<li><a href="com/opentok/Archive.Status.html" title="enum in com.opentok" target="classFrame">Archive.Status</a></li>
1617
<li><a href="com/opentok/ArchiveList.html" title="class in com.opentok" target="classFrame">ArchiveList</a></li>
18+
<li><a href="com/opentok/ArchiveMode.html" title="enum in com.opentok" target="classFrame">ArchiveMode</a></li>
19+
<li><a href="com/opentok/ArchiveProperties.html" title="class in com.opentok" target="classFrame">ArchiveProperties</a></li>
20+
<li><a href="com/opentok/ArchiveProperties.Builder.html" title="class in com.opentok" target="classFrame">ArchiveProperties.Builder</a></li>
1721
<li><a href="com/opentok/exception/InvalidArgumentException.html" title="class in com.opentok.exception" target="classFrame">InvalidArgumentException</a></li>
1822
<li><a href="com/opentok/MediaMode.html" title="enum in com.opentok" target="classFrame">MediaMode</a></li>
1923
<li><a href="com/opentok/OpenTok.html" title="class in com.opentok" target="classFrame">OpenTok</a></li>

docs/allclasses-noframe.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (version 1.7.0_71) on Thu Feb 19 05:51:07 EST 2015 -->
5+
<!-- Generated by javadoc (version 1.7.0_71) on Fri May 22 13:27:06 PDT 2015 -->
66
<title>All Classes (OpenTok Java SDK Reference)</title>
7-
<meta name="date" content="2015-02-19">
7+
<meta name="date" content="2015-05-22">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
</head>
1010
<body>
1111
<h1 class="bar">All Classes</h1>
1212
<div class="indexContainer">
1313
<ul>
1414
<li><a href="com/opentok/Archive.html" title="class in com.opentok">Archive</a></li>
15+
<li><a href="com/opentok/Archive.OutputMode.html" title="enum in com.opentok">Archive.OutputMode</a></li>
1516
<li><a href="com/opentok/Archive.Status.html" title="enum in com.opentok">Archive.Status</a></li>
1617
<li><a href="com/opentok/ArchiveList.html" title="class in com.opentok">ArchiveList</a></li>
18+
<li><a href="com/opentok/ArchiveMode.html" title="enum in com.opentok">ArchiveMode</a></li>
19+
<li><a href="com/opentok/ArchiveProperties.html" title="class in com.opentok">ArchiveProperties</a></li>
20+
<li><a href="com/opentok/ArchiveProperties.Builder.html" title="class in com.opentok">ArchiveProperties.Builder</a></li>
1721
<li><a href="com/opentok/exception/InvalidArgumentException.html" title="class in com.opentok.exception">InvalidArgumentException</a></li>
1822
<li><a href="com/opentok/MediaMode.html" title="enum in com.opentok">MediaMode</a></li>
1923
<li><a href="com/opentok/OpenTok.html" title="class in com.opentok">OpenTok</a></li>

0 commit comments

Comments
 (0)