opentok 4.0.0 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +30 -0
- data/.github/workflows/metrics.yml +17 -0
- data/CODE_OF_CONDUCT.md +128 -0
- data/README.md +67 -47
- data/lib/opentok/archive.rb +1 -1
- data/lib/opentok/archives.rb +17 -5
- data/lib/opentok/broadcasts.rb +24 -9
- data/lib/opentok/client.rb +6 -4
- data/lib/opentok/constants.rb +1 -1
- data/lib/opentok/opentok.rb +4 -2
- data/lib/opentok/version.rb +1 -1
- data/opentok.gemspec +1 -1
- data/spec/cassettes/OpenTok_Archives/calls_layout_on_archive_object.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/changes_the_layout_of_an_archive.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/should_create_archives.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/should_create_audio_only_archives.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/should_create_custom_layout_archives.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/should_create_hd_archives.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/should_create_individual_archives.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/should_create_layout_archives_with_screenshare_layout_types.yml +50 -0
- data/spec/cassettes/OpenTok_Archives/should_create_named_archives.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/should_delete_an_archive_by_id.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/should_find_archives_by_id.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/should_find_archives_with_unknown_properties.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/should_find_expired_archives.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/should_find_paused_archives_by_id.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/should_stop_archives.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_all_archives.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_archives_with_an_offset.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_count_number_of_archives.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_part_of_the_archives_when_using_offset_and_count.yml +2 -0
- data/spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_session_archives.yml +2 -0
- data/spec/cassettes/OpenTok_Broadcasts/calls_layout_on_broadcast_object.yml +2 -0
- data/spec/cassettes/OpenTok_Broadcasts/changes_the_layout_of_a_broadcast.yml +2 -0
- data/spec/cassettes/OpenTok_Broadcasts/fetches_a_hls_broadcast_url.yml +2 -0
- data/spec/cassettes/OpenTok_Broadcasts/finds_a_broadcast.yml +2 -0
- data/spec/cassettes/OpenTok_Broadcasts/starts_a_rtmp_broadcast.yml +2 -0
- data/spec/cassettes/OpenTok_Broadcasts/stops_a_broadcast.yml +2 -0
- data/spec/cassettes/OpenTok_Connections/forces_a_connection_to_be_terminated.yml +2 -0
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_always_archived_sessions.yml +2 -0
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_default_sessions.yml +2 -0
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_relayed_media_sessions.yml +2 -0
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_relayed_media_sessions_for_invalid_media_modes.yml +2 -0
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_relayed_media_sessions_with_a_location_hint.yml +2 -0
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_routed_media_sessions.yml +2 -0
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_routed_media_sessions_with_a_location_hint.yml +2 -0
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_sessions_with_a_location_hint.yml +2 -0
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/with_an_addendum_to_the_user_agent_string/should_append_the_addendum_to_the_user_agent_header.yml +2 -0
- data/spec/cassettes/OpenTok_Signals/receives_a_valid_response_for_a_connection.yml +2 -0
- data/spec/cassettes/OpenTok_Signals/receives_a_valid_response_for_all_connections.yml +2 -0
- data/spec/cassettes/OpenTok_Sip/receives_a_valid_response.yml +2 -0
- data/spec/cassettes/OpenTok_Streams/get_all_streams_information.yml +2 -0
- data/spec/cassettes/OpenTok_Streams/get_specific_stream_information.yml +2 -0
- data/spec/cassettes/OpenTok_Streams/layout_working_on_two_stream_list.yml +2 -0
- data/spec/opentok/archives_spec.rb +29 -0
- data/spec/opentok/broadcasts_spec.rb +56 -1
- data/spec/opentok/client_spec.rb +51 -0
- data/spec/opentok/opentok_spec.rb +21 -0
- metadata +12 -6
- data/.travis.yml +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e2192eea0d5c896fc1251eb57055f59c1e057d62827177d6a60a7498ff30d68
|
4
|
+
data.tar.gz: d6d321140b14b5386da8431ddb4894a63b1c3a420d015d55adfbdc67e9fe67fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83dffe63858be64be98373afa2b8d3b68b8eb4dd659a65e96283dda20518bd7359bddc1e84ed9c3a892db6aacfe33600b6f8e892085597a09ddb1fccb45090e2
|
7
|
+
data.tar.gz: ba71675fd11e9bf767e06af79018774b74da072e701d806664bcb8dfffba59fcfa79fe9e5ef80fe0e45734601247fa0376f890ceca85cc543dfd097722b84bf1
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
strategy:
|
12
|
+
matrix:
|
13
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
14
|
+
ruby: [2.5, 2.6, 2.7, 3.0]
|
15
|
+
exclude:
|
16
|
+
- os: windows-latest
|
17
|
+
ruby: 3.0
|
18
|
+
runs-on: ${{ matrix.os }}
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v2
|
21
|
+
- name: Set up Ruby
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
25
|
+
- name: Install dependencies
|
26
|
+
run: bundle install
|
27
|
+
- name: Run tests
|
28
|
+
run: bundle exec rake spec
|
29
|
+
env:
|
30
|
+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: Aggregit
|
2
|
+
|
3
|
+
on:
|
4
|
+
schedule:
|
5
|
+
- cron: "0 0 * * *"
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
recordMetrics:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: michaeljolley/aggregit@v1
|
12
|
+
with:
|
13
|
+
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
14
|
+
project_id: ${{ secrets.project_id }}
|
15
|
+
private_key: ${{ secrets.private_key }}
|
16
|
+
client_email: ${{ secrets.client_email }}
|
17
|
+
firebaseDbUrl: ${{ secrets.firebaseDbUrl }}
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
10
|
+
and orientation.
|
11
|
+
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
13
|
+
diverse, inclusive, and healthy community.
|
14
|
+
|
15
|
+
## Our Standards
|
16
|
+
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
18
|
+
community include:
|
19
|
+
|
20
|
+
- Demonstrating empathy and kindness toward other people
|
21
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
22
|
+
- Giving and gracefully accepting constructive feedback
|
23
|
+
- Accepting responsibility and apologizing to those affected by our mistakes,
|
24
|
+
and learning from the experience
|
25
|
+
- Focusing on what is best not just for us as individuals, but for the
|
26
|
+
overall community
|
27
|
+
|
28
|
+
Examples of unacceptable behavior include:
|
29
|
+
|
30
|
+
- The use of sexualized language or imagery, and sexual attention or
|
31
|
+
advances of any kind
|
32
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
33
|
+
- Public or private harassment
|
34
|
+
- Publishing others' private information, such as a physical or email
|
35
|
+
address, without their explicit permission
|
36
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
37
|
+
professional setting
|
38
|
+
|
39
|
+
## Enforcement Responsibilities
|
40
|
+
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
44
|
+
or harmful.
|
45
|
+
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
49
|
+
decisions when appropriate.
|
50
|
+
|
51
|
+
## Scope
|
52
|
+
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
54
|
+
an individual is officially representing the community in public spaces.
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
56
|
+
posting via an official social media account, or acting as an appointed
|
57
|
+
representative at an online or offline event.
|
58
|
+
|
59
|
+
## Enforcement
|
60
|
+
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
62
|
+
reported to the community leaders responsible for enforcement at
|
63
|
+
devrel@vonage.com.
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
65
|
+
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
67
|
+
reporter of any incident.
|
68
|
+
|
69
|
+
## Enforcement Guidelines
|
70
|
+
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
73
|
+
|
74
|
+
### 1. Correction
|
75
|
+
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
77
|
+
unprofessional or unwelcome in the community.
|
78
|
+
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
82
|
+
|
83
|
+
### 2. Warning
|
84
|
+
|
85
|
+
**Community Impact**: A violation through a single incident or series
|
86
|
+
of actions.
|
87
|
+
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
92
|
+
like social media. Violating these terms may lead to a temporary or
|
93
|
+
permanent ban.
|
94
|
+
|
95
|
+
### 3. Temporary Ban
|
96
|
+
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
98
|
+
sustained inappropriate behavior.
|
99
|
+
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
101
|
+
communication with the community for a specified period of time. No public or
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
104
|
+
Violating these terms may lead to a permanent ban.
|
105
|
+
|
106
|
+
### 4. Permanent Ban
|
107
|
+
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
111
|
+
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
113
|
+
the community.
|
114
|
+
|
115
|
+
## Attribution
|
116
|
+
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
118
|
+
version 2.0, available at
|
119
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
120
|
+
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
122
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
123
|
+
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
125
|
+
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
128
|
+
https://www.contributor-covenant.org/translations.
|
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# OpenTok Ruby SDK
|
2
2
|
|
3
|
-
|
3
|
+
![Coverage Status](https://github.com/opentok/OpenTok-Ruby-SDK/workflows/CI/badge.svg)
|
4
|
+
[![codecov](https://codecov.io/gh/opentok/OpenTok-Ruby-SDK/branch/master/graph/badge.svg)](https://codecov.io/gh/opentok/opentok-ruby-sdk)
|
5
|
+
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
|
6
|
+
|
7
|
+
<img src="https://assets.tokbox.com/img/vonage/Vonage_VideoAPI_black.svg" height="48px" alt="Tokbox is now known as Vonage" />
|
4
8
|
|
5
9
|
The OpenTok Ruby SDK lets you generate
|
6
10
|
[sessions](https://tokbox.com/developer/guides/create-session/) and
|
@@ -49,18 +53,32 @@ require "opentok"
|
|
49
53
|
opentok = OpenTok::OpenTok.new api_key, api_secret
|
50
54
|
```
|
51
55
|
|
56
|
+
### Initialization Options
|
57
|
+
|
58
|
+
You can specify a custom timeout value for HTTP requests when initializing a new `OpenTok::OpenTok`
|
59
|
+
object:
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
require "opentok"
|
63
|
+
|
64
|
+
opentok = OpenTok::OpenTok.new api_key, api_secret, :timeout_length => 10
|
65
|
+
```
|
66
|
+
|
67
|
+
The value for `:timeout_length` is an integer representing the number of seconds to wait for an HTTP
|
68
|
+
request to complete. The default is set to 2 seconds.
|
69
|
+
|
52
70
|
## Creating Sessions
|
53
71
|
|
54
72
|
To create an OpenTok Session, use the `OpenTok#create_session(properties)` method.
|
55
73
|
The `properties` parameter is an optional Hash used to specify the following:
|
56
74
|
|
57
|
-
|
75
|
+
- Whether the session uses the [OpenTok Media
|
58
76
|
Router](https://tokbox.com/developer/guides/create-session/#media-mode),
|
59
77
|
which is required for some OpenTok features (such as archiving)
|
60
78
|
|
61
|
-
|
79
|
+
- A location hint for the OpenTok server.
|
62
80
|
|
63
|
-
|
81
|
+
- Whether the session is automatically archived.
|
64
82
|
|
65
83
|
The `session_id` method of the returned `OpenTok::Session` instance is useful to
|
66
84
|
get a sessionId that can be saved to a persistent store (such as a database).
|
@@ -108,11 +126,11 @@ token = session.generate_token({
|
|
108
126
|
});
|
109
127
|
```
|
110
128
|
|
111
|
-
## Working with Streams
|
129
|
+
## Working with Streams
|
112
130
|
|
113
131
|
Use this method to get information for an OpenTok stream or for all streams in a session.
|
114
132
|
For example, you can call this method to get information about layout classes used by an
|
115
|
-
OpenTok stream.
|
133
|
+
OpenTok stream.
|
116
134
|
|
117
135
|
To get information of a specific stream in a session, call
|
118
136
|
`opentok.streams.find(session_id, stream_id)`. The return object is a `Stream` object and
|
@@ -139,8 +157,7 @@ expect(all_streams[0].layoutClassList[1]).to eq "focus"
|
|
139
157
|
You can only archive sessions that use the OpenTok Media Router
|
140
158
|
(sessions with the media mode set to routed).
|
141
159
|
|
142
|
-
You can start the recording of an OpenTok Session using the `opentok.archives.create(session_id,
|
143
|
-
options)` method. This will return an `OpenTok::Archive` instance. The parameter `options` is an
|
160
|
+
You can start the recording of an OpenTok Session using the `opentok.archives.create(session_id, options)` method. This will return an `OpenTok::Archive` instance. The parameter `options` is an
|
144
161
|
optional Hash used to set the `has_audio`, `has_video`, and `name` options. Note that you can
|
145
162
|
only start an Archive on a Session that has clients connected.
|
146
163
|
|
@@ -170,7 +187,7 @@ recorded to a single (composed) file.
|
|
170
187
|
|
171
188
|
For composed archives you can set the resolution of the archive, either "640x480" (SD, the default)
|
172
189
|
or "1280x720" (HD). The `resolution` parameter is optional and could be included in the options
|
173
|
-
hash (second argument) of the `opentok.archives.create()` method.
|
190
|
+
hash (second argument) of the `opentok.archives.create()` method.
|
174
191
|
|
175
192
|
```ruby
|
176
193
|
opts = {
|
@@ -262,15 +279,15 @@ opentok.archives.layout(archive_id, opts)
|
|
262
279
|
|
263
280
|
The hash `opts` has two entries:
|
264
281
|
|
265
|
-
|
282
|
+
- The `type` is the layout type for the archive. Valid values are "bestFit" (best fit)
|
266
283
|
"custom" (custom), "horizontalPresentation" (horizontal presentation),
|
267
284
|
"pip" (picture-in-picture), and "verticalPresentation" (vertical presentation)).
|
268
285
|
|
269
|
-
|
270
|
-
(For other layout types, do not set the stylesheet property.)
|
286
|
+
- If you specify a "custom" layout type, set the `stylesheet` property.
|
287
|
+
(For other layout types, do not set the stylesheet property.)
|
271
288
|
|
272
289
|
See [Customizing the video layout for composed archives](https://tokbox.com/developer/guides/archiving/layout-control.html)
|
273
|
-
for more details.
|
290
|
+
for more details.
|
274
291
|
|
275
292
|
You can set the initial layout class for a client's streams by setting the layout option when you
|
276
293
|
create the token for the client, using the `opentok.generate_token` method. And you can also change
|
@@ -296,7 +313,7 @@ For more information on setting stream layout classes, see the
|
|
296
313
|
[Changing the composed archive layout classes for an OpenTok
|
297
314
|
stream](https://tokbox.com/developer/rest/#change-stream-layout-classes-composed).
|
298
315
|
|
299
|
-
Please keep in mind that the `streams.layout` method applies to archive and broadcast streams only.
|
316
|
+
Please keep in mind that the `streams.layout` method applies to archive and broadcast streams only.
|
300
317
|
|
301
318
|
For more information on archiving, see the
|
302
319
|
[OpenTok archiving](https://tokbox.com/opentok/tutorials/archiving/) programming guide.
|
@@ -305,7 +322,7 @@ For more information on archiving, see the
|
|
305
322
|
|
306
323
|
You can send a signal using the `opentok.signals.send(session_id, connection_id, opts)` method.
|
307
324
|
If `connection_id` is nil or an empty string, then the signal is send to all valid connections in
|
308
|
-
the session.
|
325
|
+
the session.
|
309
326
|
|
310
327
|
An example of `opts` field can be as follows:
|
311
328
|
|
@@ -316,11 +333,11 @@ opts = { :type => "chat",
|
|
316
333
|
```
|
317
334
|
|
318
335
|
The maximum length of the `type` string is 128 bytes, and it must contain only letters
|
319
|
-
(A-Z and a-z), numbers (0-9), '-', '_', and '~'.
|
336
|
+
(A-Z and a-z), numbers (0-9), '-', '\_', and '~'.
|
320
337
|
|
321
338
|
The `data` string must not exceed the maximum size (8 kB).
|
322
339
|
|
323
|
-
The `connection_id` and `opts` parameter are jointly optional by default. Hence you can also
|
340
|
+
The `connection_id` and `opts` parameter are jointly optional by default. Hence you can also
|
324
341
|
use `opentok.signals.send(session_id)`
|
325
342
|
|
326
343
|
For more information on signaling, see the
|
@@ -334,16 +351,17 @@ To successfully start broadcasting a session, at least one publishing client mus
|
|
334
351
|
the session.
|
335
352
|
|
336
353
|
You can only have one active live streaming broadcast at a time for a session (however, having more
|
337
|
-
than one would not be useful).
|
354
|
+
than one would not be useful).
|
338
355
|
|
339
356
|
The live streaming broadcast can target one HLS endpoint and up to five RTMP servers simultaneously
|
340
|
-
for a session.
|
357
|
+
for a session.
|
341
358
|
|
342
359
|
You can only start live streaming for sessions that use the OpenTok Media Router (with the
|
343
360
|
media mode set to routed). You cannot use live streaming with sessions that have the media mode set
|
344
361
|
to relayed.
|
345
362
|
|
346
363
|
To create a HLS only broadcast:
|
364
|
+
|
347
365
|
```ruby
|
348
366
|
opts = {
|
349
367
|
:outputs => {
|
@@ -369,43 +387,45 @@ broadcast = opentok.broadcasts.create(session_id, opts)
|
|
369
387
|
```
|
370
388
|
|
371
389
|
The returned Broadcast object has information about the broadcast, like id, sessionId , projectId,
|
372
|
-
createdAt, updatedAt, resolution, status, and a Hash of broadcastUrls. The broadcastUrls
|
390
|
+
createdAt, updatedAt, resolution, status, and a Hash of broadcastUrls. The broadcastUrls
|
373
391
|
consists of an HLS URL and an array of RTMP objects. The RTMP objects resembles the `rtmp` value
|
374
|
-
in `opts` in the example above.
|
392
|
+
in `opts` in the example above.
|
375
393
|
|
376
394
|
For more information on broadcast, see the
|
377
395
|
[OpenTok Broadcast guide](https://tokbox.com/developer/rest/#start_broadcast) programming guide.
|
378
396
|
|
379
|
-
To get information about a broadcast stream
|
397
|
+
To get information about a broadcast stream
|
398
|
+
|
380
399
|
```ruby
|
381
400
|
my_broadcast = opentok.broadcasts.find broadcast_id
|
382
401
|
```
|
402
|
+
|
383
403
|
The Broadcast object returned has properties describing the broadcast, like id, sessionId,
|
384
|
-
projectId, createdAt, updatedAt, resolution, status, and a Hash of broadcastUrls. The broadcastUrls
|
404
|
+
projectId, createdAt, updatedAt, resolution, status, and a Hash of broadcastUrls. The broadcastUrls
|
385
405
|
consists of an HLS URL and an array of RTMP objects. The RTMP objects resembles the `rtmp` value
|
386
|
-
in `opts` in the example above.
|
406
|
+
in `opts` in the example above.
|
387
407
|
|
388
408
|
To stop a broadcast:
|
389
409
|
|
390
410
|
```ruby
|
391
411
|
my_broadcast = opentok.broadcasts.stop broadcast_id
|
392
|
-
|
412
|
+
|
393
413
|
# stop at a broadcast object level too
|
394
|
-
#
|
414
|
+
#
|
395
415
|
my_broadcast = opentok.broadcasts.find broadcast_id
|
396
416
|
ret_broadcast = my_broadcast.stop
|
397
|
-
|
398
|
-
# Both the above returned objects has the "broadcastUrls" property as a nil value and the status
|
417
|
+
|
418
|
+
# Both the above returned objects has the "broadcastUrls" property as a nil value and the status
|
399
419
|
# property value is "stopped"
|
400
420
|
```
|
401
421
|
|
422
|
+
To change the layout of a broadcast dynamically
|
402
423
|
|
403
|
-
To change the layout of a broadcast dynamically
|
404
424
|
```ruby
|
405
425
|
opentok.broadcasts.layout(started_broadcast_id, {
|
406
426
|
:type => "verticalPresentation"
|
407
427
|
})
|
408
|
-
|
428
|
+
|
409
429
|
# On an object level
|
410
430
|
my_broadcast = opentok.broadcasts.find broadcast_id
|
411
431
|
my_broadcast.layout(
|
@@ -417,28 +437,28 @@ opentok.broadcasts.layout(started_broadcast_id, {
|
|
417
437
|
|
418
438
|
The hash above has two entries.
|
419
439
|
|
420
|
-
|
440
|
+
- The `type` is the layout type for the archive. Valid values are "bestFit" (best fit),
|
421
441
|
"custom" (custom), "horizontalPresentation" (horizontal presentation),
|
422
|
-
"pip" (picture-in-picture), and "verticalPresentation" (vertical presentation).
|
442
|
+
"pip" (picture-in-picture), and "verticalPresentation" (vertical presentation).
|
423
443
|
|
424
|
-
|
425
|
-
do not set the stylesheet property.)
|
444
|
+
- If you specify a "custom" layout type, set the `stylesheet` property. (For other layout types,
|
445
|
+
do not set the stylesheet property.)
|
426
446
|
|
427
447
|
Refer to [Customizing the video layout for composed
|
428
448
|
archives](https://tokbox.com/developer/guides/archiving/layout-control.html)
|
429
|
-
for more details.
|
449
|
+
for more details.
|
430
450
|
|
431
451
|
You can also change the layout of an individual stream dynamically. Refer to
|
432
452
|
[working with Streams](#working-with-streams).
|
433
453
|
|
434
|
-
## Force disconnect
|
454
|
+
## Force disconnect
|
435
455
|
|
436
456
|
You can cause a client to be forced to disconnect from a session by using the
|
437
457
|
`opentok.connections.forceDisconnect(session_id, connection_id)` method.
|
438
458
|
|
439
459
|
## Initiating a SIP call
|
440
460
|
|
441
|
-
You can initiate a SIP call using the `opentok.sip.dial(session_id, token, sip_uri, opts)` method.
|
461
|
+
You can initiate a SIP call using the `opentok.sip.dial(session_id, token, sip_uri, opts)` method.
|
442
462
|
This requires a SIP URL. You will often need to pass options for authenticating to the SIP provider
|
443
463
|
and specifying encrypted session establishment.
|
444
464
|
|
@@ -453,15 +473,14 @@ response = opentok.sip.dial(session_id, token, "sip:+15128675309@acme.pstn.examp
|
|
453
473
|
For more information on SIP Interconnect, see the
|
454
474
|
[OpenTok SIP Interconnect](https://tokbox.com/developer/guides/sip/) developer guide.
|
455
475
|
|
456
|
-
|
457
476
|
# Samples
|
458
477
|
|
459
478
|
There are three sample applications included in this repository. To get going as fast as possible, clone the whole
|
460
479
|
repository and read the README in each of the sample directories:
|
461
480
|
|
462
|
-
|
463
|
-
|
464
|
-
|
481
|
+
- [HelloWorld](sample/HelloWorld/README.md)
|
482
|
+
- [Archiving](sample/Archiving/README.md)
|
483
|
+
- [Broadcast](sample/Broadcast/README.md)
|
465
484
|
|
466
485
|
# Documentation
|
467
486
|
|
@@ -485,7 +504,7 @@ about each release.
|
|
485
504
|
|
486
505
|
The SDK adds support for Ruby v2.7 and now requires Ruby v2.1.0 or higher.
|
487
506
|
For Ruby v2.0.0 please continue to use the OpenTok Ruby SDK v3.0.0.
|
488
|
-
For Ruby v1.9.3 please continue to use the OpenTok Ruby SDK v2.5.0.
|
507
|
+
For Ruby v1.9.3 please continue to use the OpenTok Ruby SDK v2.5.0.
|
489
508
|
|
490
509
|
**Changes in v3.0.0:**
|
491
510
|
|
@@ -511,15 +530,16 @@ See the reference documentation
|
|
511
530
|
<http://www.tokbox.com/opentok/libraries/server/ruby/reference/index.html> and in the
|
512
531
|
docs directory of the SDK.
|
513
532
|
|
514
|
-
|
515
533
|
# Development and Contributing
|
516
534
|
|
517
535
|
Interested in contributing? We :heart: pull requests! See the [Development](DEVELOPING.md) and
|
518
536
|
[Contribution](CONTRIBUTING.md) guidelines.
|
519
537
|
|
520
|
-
|
538
|
+
## Getting Help
|
521
539
|
|
522
|
-
|
540
|
+
We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:
|
523
541
|
|
524
|
-
|
525
|
-
|
542
|
+
- Open an issue on this repository
|
543
|
+
- See <https://support.tokbox.com/> for support options
|
544
|
+
- Tweet at us! We're [@VonageDev on Twitter](https://twitter.com/VonageDev)
|
545
|
+
- Or [join the Vonage Developer Community Slack](https://developer.nexmo.com/community/slack)
|