opentok 3.1.0 → 4.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/metrics.yml +17 -0
- data/.travis.yml +3 -1
- data/CODE_OF_CONDUCT.md +128 -0
- data/README.md +98 -49
- data/lib/opentok/archives.rb +13 -2
- data/lib/opentok/broadcasts.rb +1 -1
- data/lib/opentok/client.rb +6 -4
- data/lib/opentok/constants.rb +1 -1
- data/lib/opentok/opentok.rb +4 -2
- data/lib/opentok/sip.rb +0 -2
- data/lib/opentok/version.rb +1 -1
- data/opentok.gemspec +9 -8
- data/sample/Broadcast/Gemfile +4 -0
- data/sample/Broadcast/README.md +201 -0
- data/sample/Broadcast/broadcast_sample.rb +97 -0
- data/sample/Broadcast/public/css/sample.css +64 -0
- data/sample/Broadcast/public/js/host.js +185 -0
- data/sample/Broadcast/public/js/participant.js +85 -0
- data/sample/Broadcast/views/host.erb +82 -0
- data/sample/Broadcast/views/index.erb +32 -0
- data/sample/Broadcast/views/layout.erb +29 -0
- data/sample/Broadcast/views/participant.erb +27 -0
- data/sample/HelloWorld/public/js/helloworld.js +4 -10
- data/sample/HelloWorld/views/index.erb +1 -3
- data/spec/cassettes/OpenTok_Archives/calls_layout_on_archive_object.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/changes_the_layout_of_an_archive.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/http_client_errors/.yml +34 -0
- data/spec/cassettes/OpenTok_Archives/should_create_archives.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/should_create_audio_only_archives.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/should_create_custom_layout_archives.yml +50 -0
- data/spec/cassettes/OpenTok_Archives/should_create_hd_archives.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/should_create_individual_archives.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/should_create_named_archives.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/should_delete_an_archive_by_id.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/should_find_archives_by_id.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/should_find_archives_with_unknown_properties.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/should_find_expired_archives.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/should_find_paused_archives_by_id.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/should_stop_archives.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_all_archives.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_archives_with_an_offset.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_count_number_of_archives.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_part_of_the_archives_when_using_offset_and_count.yml +3 -1
- data/spec/cassettes/OpenTok_Archives/when_many_archives_are_created/should_return_session_archives.yml +3 -1
- data/spec/cassettes/OpenTok_Broadcasts/calls_layout_on_broadcast_object.yml +3 -1
- data/spec/cassettes/OpenTok_Broadcasts/changes_the_layout_of_a_broadcast.yml +3 -1
- data/spec/cassettes/OpenTok_Broadcasts/fetches_a_hls_broadcast_url.yml +3 -1
- data/spec/cassettes/OpenTok_Broadcasts/finds_a_broadcast.yml +3 -1
- data/spec/cassettes/OpenTok_Broadcasts/starts_a_rtmp_broadcast.yml +3 -1
- data/spec/cassettes/OpenTok_Broadcasts/stops_a_broadcast.yml +3 -1
- data/spec/cassettes/OpenTok_Connections/forces_a_connection_to_be_terminated.yml +3 -1
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_always_archived_sessions.yml +3 -1
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_default_sessions.yml +3 -1
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_relayed_media_sessions.yml +3 -1
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_relayed_media_sessions_for_invalid_media_modes.yml +3 -1
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_relayed_media_sessions_with_a_location_hint.yml +3 -1
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_routed_media_sessions.yml +3 -1
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_routed_media_sessions_with_a_location_hint.yml +3 -1
- data/spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_sessions_with_a_location_hint.yml +3 -1
- 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 +3 -1
- data/spec/cassettes/OpenTok_Signals/receives_a_valid_response_for_a_connection.yml +3 -1
- data/spec/cassettes/OpenTok_Signals/receives_a_valid_response_for_all_connections.yml +3 -1
- data/spec/cassettes/OpenTok_Sip/receives_a_valid_response.yml +3 -1
- data/spec/cassettes/OpenTok_Streams/get_all_streams_information.yml +3 -1
- data/spec/cassettes/OpenTok_Streams/get_specific_stream_information.yml +3 -1
- data/spec/cassettes/OpenTok_Streams/layout_working_on_two_stream_list.yml +3 -1
- data/spec/opentok/archives_spec.rb +11 -1
- data/spec/opentok/broadcasts_spec.rb +25 -1
- data/spec/opentok/client_spec.rb +51 -0
- data/spec/opentok/opentok_spec.rb +21 -0
- data/spec/spec_helper.rb +2 -0
- metadata +39 -22
@@ -10,7 +10,9 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
15
|
+
Accept: "*/*"
|
14
16
|
response:
|
15
17
|
status:
|
16
18
|
code: 200
|
@@ -10,9 +10,11 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
14
|
Content-Type:
|
15
15
|
- application/json
|
16
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
17
|
+
Accept: "*/*"
|
16
18
|
response:
|
17
19
|
status:
|
18
20
|
code: 200
|
@@ -10,7 +10,9 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
15
|
+
Accept: "*/*"
|
14
16
|
response:
|
15
17
|
status:
|
16
18
|
code: 200
|
@@ -10,9 +10,11 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
14
|
Content-Type:
|
15
15
|
- application/json
|
16
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
17
|
+
Accept: "*/*"
|
16
18
|
response:
|
17
19
|
status:
|
18
20
|
code: 204
|
@@ -10,7 +10,9 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
15
|
+
Accept: "*/*"
|
14
16
|
response:
|
15
17
|
status:
|
16
18
|
code: 200
|
@@ -10,7 +10,9 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
15
|
+
Accept: "*/*"
|
14
16
|
response:
|
15
17
|
status:
|
16
18
|
code: 200
|
@@ -10,7 +10,9 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
15
|
+
Accept: "*/*"
|
14
16
|
response:
|
15
17
|
status:
|
16
18
|
code: 200
|
@@ -10,7 +10,9 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
15
|
+
Accept: "*/*"
|
14
16
|
response:
|
15
17
|
status:
|
16
18
|
code: 200
|
@@ -10,7 +10,9 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
15
|
+
Accept: "*/*"
|
14
16
|
response:
|
15
17
|
status:
|
16
18
|
code: 200
|
@@ -10,7 +10,9 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
15
|
+
Accept: "*/*"
|
14
16
|
response:
|
15
17
|
status:
|
16
18
|
code: 200
|
@@ -10,7 +10,9 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
15
|
+
Accept: "*/*"
|
14
16
|
response:
|
15
17
|
status:
|
16
18
|
code: 200
|
@@ -10,7 +10,9 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
15
|
+
Accept: "*/*"
|
14
16
|
response:
|
15
17
|
status:
|
16
18
|
code: 200
|
@@ -10,7 +10,9 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %> BOOYAH
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
15
|
+
Accept: "*/*"
|
14
16
|
response:
|
15
17
|
status:
|
16
18
|
code: 200
|
@@ -10,9 +10,11 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
14
|
Content-Type:
|
15
15
|
- application/json
|
16
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
17
|
+
Accept: "*/*"
|
16
18
|
response:
|
17
19
|
status:
|
18
20
|
code: 204
|
@@ -10,9 +10,11 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
14
|
Content-Type:
|
15
15
|
- application/json
|
16
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
17
|
+
Accept: "*/*"
|
16
18
|
response:
|
17
19
|
status:
|
18
20
|
code: 204
|
@@ -10,9 +10,11 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
14
|
Content-Type:
|
15
15
|
- application/json
|
16
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
17
|
+
Accept: "*/*"
|
16
18
|
response:
|
17
19
|
status:
|
18
20
|
code: 200
|
@@ -10,9 +10,11 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
14
|
Content-Type:
|
15
15
|
- application/json
|
16
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
17
|
+
Accept: "*/*"
|
16
18
|
response:
|
17
19
|
status:
|
18
20
|
code: 200
|
@@ -10,9 +10,11 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
14
|
Content-Type:
|
15
15
|
- application/json
|
16
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
17
|
+
Accept: "*/*"
|
16
18
|
response:
|
17
19
|
status:
|
18
20
|
code: 200
|
@@ -10,9 +10,11 @@ http_interactions:
|
|
10
10
|
User-Agent:
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
12
12
|
X-Opentok-Auth:
|
13
|
-
-
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
14
|
Content-Type:
|
15
15
|
- application/json
|
16
|
+
Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
17
|
+
Accept: "*/*"
|
16
18
|
response:
|
17
19
|
status:
|
18
20
|
code: 200
|
@@ -57,6 +57,16 @@ describe OpenTok::Archives do
|
|
57
57
|
expect(archive.output_mode).to eq :individual
|
58
58
|
end
|
59
59
|
|
60
|
+
it "should create custom layout archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
61
|
+
custom_layout = {
|
62
|
+
:type => "custom",
|
63
|
+
:stylesheet => "stream:last-child{display: block;margin: 0;top: 0;left: 0;width: 1px;height: 1px;}stream:first-child{display: block;margin: 0;top: 0;left: 0;width: 100%;height: 100%;}"
|
64
|
+
}
|
65
|
+
archive = archives.create session_id, :layout => custom_layout
|
66
|
+
expect(archive).to be_an_instance_of OpenTok::Archive
|
67
|
+
expect(archive.session_id).to eq session_id
|
68
|
+
end
|
69
|
+
|
60
70
|
it "should stop archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
61
71
|
archive = archives.stop_by_id started_archive_id
|
62
72
|
expect(archive).to be_an_instance_of OpenTok::Archive
|
@@ -78,7 +88,7 @@ describe OpenTok::Archives do
|
|
78
88
|
|
79
89
|
it "should delete an archive by id", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
80
90
|
success = archives.delete_by_id deletable_archive_id
|
81
|
-
expect(success).to
|
91
|
+
expect(success).to be_truthy
|
82
92
|
# expect(archive.status).to eq ""
|
83
93
|
end
|
84
94
|
|
@@ -144,6 +144,27 @@ describe OpenTok::Broadcasts do
|
|
144
144
|
}.to raise_error(ArgumentError)
|
145
145
|
end
|
146
146
|
|
147
|
+
it "raise an error for non valid type" do
|
148
|
+
expect {
|
149
|
+
broadcast.layout(started_broadcast_id, {
|
150
|
+
type: "not-valid",
|
151
|
+
stylesheet: "stream {}"
|
152
|
+
})
|
153
|
+
}.to raise_error(ArgumentError)
|
154
|
+
end
|
155
|
+
|
156
|
+
it "change the layout to custom type with custom stylesheet" do
|
157
|
+
stub_request(:put, "https://api.opentok.com/v2/project/#{api_key}/broadcast/#{started_broadcast_id}/layout").
|
158
|
+
with(body: {type: 'custom', stylesheet: 'stream {float: left; height: 100%; width: 33.33%;}'}).
|
159
|
+
to_return(status: 200)
|
160
|
+
|
161
|
+
response = broadcast.layout(started_broadcast_id, {
|
162
|
+
type: "custom",
|
163
|
+
stylesheet: "stream {float: left; height: 100%; width: 33.33%;}"
|
164
|
+
})
|
165
|
+
expect(response).not_to be_nil
|
166
|
+
end
|
167
|
+
|
147
168
|
it "raise an error if invalid layout type" do
|
148
169
|
expect {
|
149
170
|
broadcast.layout(started_broadcast_id, {
|
@@ -162,10 +183,13 @@ describe OpenTok::Broadcasts do
|
|
162
183
|
}.to raise_error(ArgumentError)
|
163
184
|
end
|
164
185
|
it "changes the layout of a broadcast", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
186
|
+
stub_request(:put, "https://api.opentok.com/v2/project/#{api_key}/broadcast/#{started_broadcast_id}/layout").
|
187
|
+
to_return(status: 200)
|
188
|
+
|
165
189
|
response = broadcast.layout(started_broadcast_id, {
|
166
190
|
:type => "verticalPresentation"
|
167
191
|
})
|
168
192
|
expect(response).not_to be_nil
|
169
193
|
end
|
170
194
|
|
171
|
-
end
|
195
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require "opentok/opentok"
|
2
|
+
require "opentok/version"
|
3
|
+
|
4
|
+
require "spec_helper"
|
5
|
+
require "shared/opentok_generates_tokens"
|
6
|
+
|
7
|
+
describe OpenTok::Client do
|
8
|
+
before(:each) do
|
9
|
+
now = Time.parse("2017-04-18 20:17:40 +1000")
|
10
|
+
allow(Time).to receive(:now) { now }
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:api_key) { "123456" }
|
14
|
+
let(:api_secret) { "1234567890abcdef1234567890abcdef1234567890" }
|
15
|
+
let(:api_url) { "https://api.opentok.com" }
|
16
|
+
|
17
|
+
|
18
|
+
let(:client) { OpenTok::Client.new api_key, api_secret, api_url }
|
19
|
+
subject { client }
|
20
|
+
|
21
|
+
context "when initialized with no options" do
|
22
|
+
it { should be_an_instance_of OpenTok::Client }
|
23
|
+
|
24
|
+
it "should have an api_key property" do
|
25
|
+
expect(client.api_key).to eq api_key
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should have an api_secret property" do
|
29
|
+
expect(client.api_secret).to eq api_secret
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should be able to access HTTParty open_timeout method" do
|
33
|
+
expect(OpenTok::Client).to respond_to(:open_timeout)
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'should have a default timeout_length property of 2 seconds' do
|
37
|
+
expect(client.timeout_length).to eq 2
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context "when initialized with timeout_length custom option" do
|
42
|
+
let(:client) { OpenTok::Client.new api_key, api_secret, api_url, ua_addendum='', :timeout_length => timeout_length }
|
43
|
+
let(:timeout_length) { 10 }
|
44
|
+
|
45
|
+
it { should be_an_instance_of(OpenTok::Client) }
|
46
|
+
|
47
|
+
it "should override timeout_length default with custom integer" do
|
48
|
+
expect(client.timeout_length).to eq 10
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -31,6 +31,10 @@ describe OpenTok::OpenTok do
|
|
31
31
|
expect(opentok.api_url).to eq default_api_url
|
32
32
|
end
|
33
33
|
|
34
|
+
it "has the default timeout set" do
|
35
|
+
expect(opentok.timeout_length).to eq 2
|
36
|
+
end
|
37
|
+
|
34
38
|
include_examples "opentok generates tokens"
|
35
39
|
|
36
40
|
describe "#create_session" do
|
@@ -139,6 +143,23 @@ describe OpenTok::OpenTok do
|
|
139
143
|
# include_examples "generates tokens"
|
140
144
|
end
|
141
145
|
|
146
|
+
context "with a custom timeout_length" do
|
147
|
+
let(:timeout_length) { 10 }
|
148
|
+
let(:opentok) { OpenTok::OpenTok.new api_key, api_secret, :timeout_length => timeout_length }
|
149
|
+
|
150
|
+
it { should be_an_instance_of(OpenTok::OpenTok) }
|
151
|
+
|
152
|
+
it "should have an timeout_length property" do
|
153
|
+
expect(opentok.timeout_length).to eq timeout_length
|
154
|
+
end
|
155
|
+
|
156
|
+
it "should send the custom timeout_length to new instances of OpenTok::Client" do
|
157
|
+
streams = opentok.streams
|
158
|
+
|
159
|
+
expect(streams.instance_variable_get(:@client).timeout_length).to eq timeout_length
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
142
163
|
context "with an addendum to the user agent string" do
|
143
164
|
let(:opentok) { OpenTok::OpenTok.new api_key, api_secret, :ua_addendum => ua_addendum }
|
144
165
|
let(:ua_addendum) { "BOOYAH"}
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentok
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stijn Mathysen
|
@@ -12,20 +12,20 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2020-07-15 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bundler
|
19
19
|
requirement: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- - "
|
21
|
+
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: '1.5'
|
24
24
|
type: :development
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
|
-
- - "
|
28
|
+
- - ">="
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: '1.5'
|
31
31
|
- !ruby/object:Gem::Dependency
|
@@ -34,68 +34,68 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - "~>"
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 12.0.0
|
38
38
|
type: :development
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
42
|
- - "~>"
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
44
|
+
version: 12.0.0
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: rspec
|
47
47
|
requirement: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
49
|
- - "~>"
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version:
|
51
|
+
version: 3.9.0
|
52
52
|
type: :development
|
53
53
|
prerelease: false
|
54
54
|
version_requirements: !ruby/object:Gem::Requirement
|
55
55
|
requirements:
|
56
56
|
- - "~>"
|
57
57
|
- !ruby/object:Gem::Version
|
58
|
-
version:
|
58
|
+
version: 3.9.0
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: webmock
|
61
61
|
requirement: !ruby/object:Gem::Requirement
|
62
62
|
requirements:
|
63
|
-
- - "
|
63
|
+
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: 2.3.2
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
|
-
- - "
|
70
|
+
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: 2.3.2
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: vcr
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
|
-
- - "
|
77
|
+
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: 2.8.0
|
80
80
|
type: :development
|
81
81
|
prerelease: false
|
82
82
|
version_requirements: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
|
-
- - "
|
84
|
+
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: 2.8.0
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: yard
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
|
-
- - "
|
91
|
+
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: 0.9.11
|
94
94
|
type: :development
|
95
95
|
prerelease: false
|
96
96
|
version_requirements: !ruby/object:Gem::Requirement
|
97
97
|
requirements:
|
98
|
-
- - "
|
98
|
+
- - ">="
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: 0.9.11
|
101
101
|
- !ruby/object:Gem::Dependency
|
@@ -116,16 +116,16 @@ dependencies:
|
|
116
116
|
name: httparty
|
117
117
|
requirement: !ruby/object:Gem::Requirement
|
118
118
|
requirements:
|
119
|
-
- - "
|
119
|
+
- - ">="
|
120
120
|
- !ruby/object:Gem::Version
|
121
|
-
version: 0.
|
121
|
+
version: 0.18.0
|
122
122
|
type: :runtime
|
123
123
|
prerelease: false
|
124
124
|
version_requirements: !ruby/object:Gem::Requirement
|
125
125
|
requirements:
|
126
|
-
- - "
|
126
|
+
- - ">="
|
127
127
|
- !ruby/object:Gem::Version
|
128
|
-
version: 0.
|
128
|
+
version: 0.18.0
|
129
129
|
- !ruby/object:Gem::Dependency
|
130
130
|
name: activesupport
|
131
131
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,14 +144,14 @@ dependencies:
|
|
144
144
|
name: jwt
|
145
145
|
requirement: !ruby/object:Gem::Requirement
|
146
146
|
requirements:
|
147
|
-
- - "
|
147
|
+
- - ">="
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: 1.5.6
|
150
150
|
type: :runtime
|
151
151
|
prerelease: false
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
153
|
requirements:
|
154
|
-
- - "
|
154
|
+
- - ">="
|
155
155
|
- !ruby/object:Gem::Version
|
156
156
|
version: 1.5.6
|
157
157
|
description: OpenTok is an API from TokBox that enables websites to weave live group
|
@@ -170,9 +170,11 @@ executables: []
|
|
170
170
|
extensions: []
|
171
171
|
extra_rdoc_files: []
|
172
172
|
files:
|
173
|
+
- ".github/workflows/metrics.yml"
|
173
174
|
- ".gitignore"
|
174
175
|
- ".travis.yml"
|
175
176
|
- ".yardopts"
|
177
|
+
- CODE_OF_CONDUCT.md
|
176
178
|
- CONTRIBUTING.md
|
177
179
|
- DEVELOPING.md
|
178
180
|
- Gemfile
|
@@ -214,6 +216,16 @@ files:
|
|
214
216
|
- sample/Archiving/views/index.erb
|
215
217
|
- sample/Archiving/views/layout.erb
|
216
218
|
- sample/Archiving/views/participant.erb
|
219
|
+
- sample/Broadcast/Gemfile
|
220
|
+
- sample/Broadcast/README.md
|
221
|
+
- sample/Broadcast/broadcast_sample.rb
|
222
|
+
- sample/Broadcast/public/css/sample.css
|
223
|
+
- sample/Broadcast/public/js/host.js
|
224
|
+
- sample/Broadcast/public/js/participant.js
|
225
|
+
- sample/Broadcast/views/host.erb
|
226
|
+
- sample/Broadcast/views/index.erb
|
227
|
+
- sample/Broadcast/views/layout.erb
|
228
|
+
- sample/Broadcast/views/participant.erb
|
217
229
|
- sample/HelloWorld/Gemfile
|
218
230
|
- sample/HelloWorld/README.md
|
219
231
|
- sample/HelloWorld/hello_world.rb
|
@@ -221,8 +233,10 @@ files:
|
|
221
233
|
- sample/HelloWorld/views/index.erb
|
222
234
|
- spec/cassettes/OpenTok_Archives/calls_layout_on_archive_object.yml
|
223
235
|
- spec/cassettes/OpenTok_Archives/changes_the_layout_of_an_archive.yml
|
236
|
+
- spec/cassettes/OpenTok_Archives/http_client_errors/.yml
|
224
237
|
- spec/cassettes/OpenTok_Archives/should_create_archives.yml
|
225
238
|
- spec/cassettes/OpenTok_Archives/should_create_audio_only_archives.yml
|
239
|
+
- spec/cassettes/OpenTok_Archives/should_create_custom_layout_archives.yml
|
226
240
|
- spec/cassettes/OpenTok_Archives/should_create_hd_archives.yml
|
227
241
|
- spec/cassettes/OpenTok_Archives/should_create_individual_archives.yml
|
228
242
|
- spec/cassettes/OpenTok_Archives/should_create_named_archives.yml
|
@@ -262,6 +276,7 @@ files:
|
|
262
276
|
- spec/matchers/token.rb
|
263
277
|
- spec/opentok/archives_spec.rb
|
264
278
|
- spec/opentok/broadcasts_spec.rb
|
279
|
+
- spec/opentok/client_spec.rb
|
265
280
|
- spec/opentok/connection_spec.rb
|
266
281
|
- spec/opentok/opentok_spec.rb
|
267
282
|
- spec/opentok/session_spec.rb
|
@@ -290,16 +305,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
290
305
|
- !ruby/object:Gem::Version
|
291
306
|
version: '0'
|
292
307
|
requirements: []
|
293
|
-
|
294
|
-
rubygems_version: 2.5.2.3
|
308
|
+
rubygems_version: 3.0.0
|
295
309
|
signing_key:
|
296
310
|
specification_version: 4
|
297
311
|
summary: Ruby gem for the OpenTok API
|
298
312
|
test_files:
|
299
313
|
- spec/cassettes/OpenTok_Archives/calls_layout_on_archive_object.yml
|
300
314
|
- spec/cassettes/OpenTok_Archives/changes_the_layout_of_an_archive.yml
|
315
|
+
- spec/cassettes/OpenTok_Archives/http_client_errors/.yml
|
301
316
|
- spec/cassettes/OpenTok_Archives/should_create_archives.yml
|
302
317
|
- spec/cassettes/OpenTok_Archives/should_create_audio_only_archives.yml
|
318
|
+
- spec/cassettes/OpenTok_Archives/should_create_custom_layout_archives.yml
|
303
319
|
- spec/cassettes/OpenTok_Archives/should_create_hd_archives.yml
|
304
320
|
- spec/cassettes/OpenTok_Archives/should_create_individual_archives.yml
|
305
321
|
- spec/cassettes/OpenTok_Archives/should_create_named_archives.yml
|
@@ -339,6 +355,7 @@ test_files:
|
|
339
355
|
- spec/matchers/token.rb
|
340
356
|
- spec/opentok/archives_spec.rb
|
341
357
|
- spec/opentok/broadcasts_spec.rb
|
358
|
+
- spec/opentok/client_spec.rb
|
342
359
|
- spec/opentok/connection_spec.rb
|
343
360
|
- spec/opentok/opentok_spec.rb
|
344
361
|
- spec/opentok/session_spec.rb
|