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
@@ -13,6 +13,8 @@ http_interactions:
|
|
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
|
@@ -11,6 +11,8 @@ http_interactions:
|
|
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
|
@@ -13,6 +13,8 @@ http_interactions:
|
|
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
|
@@ -11,6 +11,8 @@ http_interactions:
|
|
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
|
@@ -13,6 +13,8 @@ http_interactions:
|
|
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
|
@@ -11,6 +11,8 @@ http_interactions:
|
|
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
|
@@ -11,6 +11,8 @@ http_interactions:
|
|
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
|
@@ -11,6 +11,8 @@ http_interactions:
|
|
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
|
@@ -11,6 +11,8 @@ http_interactions:
|
|
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
|
@@ -11,6 +11,8 @@ http_interactions:
|
|
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
|
@@ -11,6 +11,8 @@ http_interactions:
|
|
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
|
@@ -11,6 +11,8 @@ http_interactions:
|
|
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
|
@@ -11,6 +11,8 @@ http_interactions:
|
|
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
|
@@ -11,6 +11,8 @@ http_interactions:
|
|
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
|
@@ -13,6 +13,8 @@ http_interactions:
|
|
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
|
@@ -13,6 +13,8 @@ http_interactions:
|
|
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
|
@@ -13,6 +13,8 @@ http_interactions:
|
|
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
|
@@ -13,6 +13,8 @@ http_interactions:
|
|
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
|
@@ -13,6 +13,8 @@ http_interactions:
|
|
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
|
@@ -13,6 +13,8 @@ http_interactions:
|
|
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
|
@@ -67,6 +67,16 @@ describe OpenTok::Archives do
|
|
67
67
|
expect(archive.session_id).to eq session_id
|
68
68
|
end
|
69
69
|
|
70
|
+
it "should create layout archives with screenshare layout types", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
71
|
+
screenshare_layout = {
|
72
|
+
:type => "bestFit",
|
73
|
+
:screenshare_type => "verticalPresentation"
|
74
|
+
}
|
75
|
+
archive = archives.create session_id, :layout => screenshare_layout
|
76
|
+
expect(archive).to be_an_instance_of OpenTok::Archive
|
77
|
+
expect(archive.session_id).to eq session_id
|
78
|
+
end
|
79
|
+
|
70
80
|
it "should stop archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
71
81
|
archive = archives.stop_by_id started_archive_id
|
72
82
|
expect(archive).to be_an_instance_of OpenTok::Archive
|
@@ -159,6 +169,25 @@ describe OpenTok::Archives do
|
|
159
169
|
})
|
160
170
|
}.to raise_error(ArgumentError)
|
161
171
|
end
|
172
|
+
|
173
|
+
it "raise an error if invalid layout type with screenshare_type" do
|
174
|
+
expect {
|
175
|
+
archives.layout(started_archive_id, {
|
176
|
+
type: "pip",
|
177
|
+
screenshare_type: "bestFit"
|
178
|
+
})
|
179
|
+
}.to raise_error(ArgumentError)
|
180
|
+
end
|
181
|
+
|
182
|
+
it "raise an error if invalid layout screenshare_type" do
|
183
|
+
expect {
|
184
|
+
archives.layout(started_archive_id, {
|
185
|
+
type: "bestFit",
|
186
|
+
screenshare_type: "pip1"
|
187
|
+
})
|
188
|
+
}.to raise_error(ArgumentError)
|
189
|
+
end
|
190
|
+
|
162
191
|
it "calls layout on archive object", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
163
192
|
archive = archives.find findable_archive_id
|
164
193
|
expect(archive).to be_an_instance_of OpenTok::Archive
|
@@ -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, {
|
@@ -151,6 +172,25 @@ describe OpenTok::Broadcasts do
|
|
151
172
|
})
|
152
173
|
}.to raise_error(ArgumentError)
|
153
174
|
end
|
175
|
+
|
176
|
+
it "raise an error if invalid layout type with screenshare_type" do
|
177
|
+
expect {
|
178
|
+
broadcast.layout(started_broadcast_id, {
|
179
|
+
type: "pip",
|
180
|
+
screenshare_type: "bestFit"
|
181
|
+
})
|
182
|
+
}.to raise_error(ArgumentError)
|
183
|
+
end
|
184
|
+
|
185
|
+
it "raise an error if invalid layout screenshare_type" do
|
186
|
+
expect {
|
187
|
+
broadcast.layout(started_broadcast_id, {
|
188
|
+
type: "bestFit",
|
189
|
+
screenshare_type: "pip1"
|
190
|
+
})
|
191
|
+
}.to raise_error(ArgumentError)
|
192
|
+
end
|
193
|
+
|
154
194
|
it "calls layout on broadcast object", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
155
195
|
b = broadcast.find started_broadcast_id
|
156
196
|
expect(b).to be_an_instance_of OpenTok::Broadcast
|
@@ -161,11 +201,26 @@ describe OpenTok::Broadcasts do
|
|
161
201
|
)
|
162
202
|
}.to raise_error(ArgumentError)
|
163
203
|
end
|
204
|
+
|
164
205
|
it "changes the layout of a broadcast", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
206
|
+
stub_request(:put, "https://api.opentok.com/v2/project/#{api_key}/broadcast/#{started_broadcast_id}/layout").
|
207
|
+
to_return(status: 200)
|
208
|
+
|
165
209
|
response = broadcast.layout(started_broadcast_id, {
|
166
210
|
:type => "verticalPresentation"
|
167
211
|
})
|
168
212
|
expect(response).not_to be_nil
|
169
213
|
end
|
170
214
|
|
171
|
-
|
215
|
+
it "changes the screenshare option in the layout of a broadcast", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
216
|
+
stub_request(:put, "https://api.opentok.com/v2/project/#{api_key}/broadcast/#{started_broadcast_id}/layout").
|
217
|
+
to_return(status: 200)
|
218
|
+
|
219
|
+
response = broadcast.layout(started_broadcast_id, {
|
220
|
+
:type => "bestFit",
|
221
|
+
:screenshare_type => "bestFit"
|
222
|
+
})
|
223
|
+
expect(response).not_to be_nil
|
224
|
+
end
|
225
|
+
|
226
|
+
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"}
|
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.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stijn Mathysen
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2021-01-28 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bundler
|
@@ -118,14 +118,14 @@ dependencies:
|
|
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
|
@@ -170,9 +170,11 @@ executables: []
|
|
170
170
|
extensions: []
|
171
171
|
extra_rdoc_files: []
|
172
172
|
files:
|
173
|
+
- ".github/workflows/ci.yml"
|
174
|
+
- ".github/workflows/metrics.yml"
|
173
175
|
- ".gitignore"
|
174
|
-
- ".travis.yml"
|
175
176
|
- ".yardopts"
|
177
|
+
- CODE_OF_CONDUCT.md
|
176
178
|
- CONTRIBUTING.md
|
177
179
|
- DEVELOPING.md
|
178
180
|
- Gemfile
|
@@ -237,6 +239,7 @@ files:
|
|
237
239
|
- spec/cassettes/OpenTok_Archives/should_create_custom_layout_archives.yml
|
238
240
|
- spec/cassettes/OpenTok_Archives/should_create_hd_archives.yml
|
239
241
|
- spec/cassettes/OpenTok_Archives/should_create_individual_archives.yml
|
242
|
+
- spec/cassettes/OpenTok_Archives/should_create_layout_archives_with_screenshare_layout_types.yml
|
240
243
|
- spec/cassettes/OpenTok_Archives/should_create_named_archives.yml
|
241
244
|
- spec/cassettes/OpenTok_Archives/should_delete_an_archive_by_id.yml
|
242
245
|
- spec/cassettes/OpenTok_Archives/should_find_archives_by_id.yml
|
@@ -274,6 +277,7 @@ files:
|
|
274
277
|
- spec/matchers/token.rb
|
275
278
|
- spec/opentok/archives_spec.rb
|
276
279
|
- spec/opentok/broadcasts_spec.rb
|
280
|
+
- spec/opentok/client_spec.rb
|
277
281
|
- spec/opentok/connection_spec.rb
|
278
282
|
- spec/opentok/opentok_spec.rb
|
279
283
|
- spec/opentok/session_spec.rb
|
@@ -302,7 +306,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
302
306
|
- !ruby/object:Gem::Version
|
303
307
|
version: '0'
|
304
308
|
requirements: []
|
305
|
-
rubygems_version: 3.1.
|
309
|
+
rubygems_version: 3.1.4
|
306
310
|
signing_key:
|
307
311
|
specification_version: 4
|
308
312
|
summary: Ruby gem for the OpenTok API
|
@@ -315,6 +319,7 @@ test_files:
|
|
315
319
|
- spec/cassettes/OpenTok_Archives/should_create_custom_layout_archives.yml
|
316
320
|
- spec/cassettes/OpenTok_Archives/should_create_hd_archives.yml
|
317
321
|
- spec/cassettes/OpenTok_Archives/should_create_individual_archives.yml
|
322
|
+
- spec/cassettes/OpenTok_Archives/should_create_layout_archives_with_screenshare_layout_types.yml
|
318
323
|
- spec/cassettes/OpenTok_Archives/should_create_named_archives.yml
|
319
324
|
- spec/cassettes/OpenTok_Archives/should_delete_an_archive_by_id.yml
|
320
325
|
- spec/cassettes/OpenTok_Archives/should_find_archives_by_id.yml
|
@@ -352,6 +357,7 @@ test_files:
|
|
352
357
|
- spec/matchers/token.rb
|
353
358
|
- spec/opentok/archives_spec.rb
|
354
359
|
- spec/opentok/broadcasts_spec.rb
|
360
|
+
- spec/opentok/client_spec.rb
|
355
361
|
- spec/opentok/connection_spec.rb
|
356
362
|
- spec/opentok/opentok_spec.rb
|
357
363
|
- spec/opentok/session_spec.rb
|