opentok 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +4 -0
- data/lib/open_tok/open_tok_sdk.rb +10 -4
- data/lib/open_tok/version.rb +1 -1
- metadata +4 -4
data/CHANGES
CHANGED
@@ -33,7 +33,7 @@ module OpenTok
|
|
33
33
|
|
34
34
|
class OpenTokSDK
|
35
35
|
attr_accessor :api_url
|
36
|
-
|
36
|
+
|
37
37
|
@@TOKEN_SENTINEL = "T1=="
|
38
38
|
@@SDK_VERSION = "tbruby-%s" % [ VERSION ]
|
39
39
|
|
@@ -47,11 +47,11 @@ module OpenTok
|
|
47
47
|
def initialize(partner_id, partner_secret, options = nil)
|
48
48
|
@partner_id = partner_id
|
49
49
|
@partner_secret = partner_secret.strip
|
50
|
-
|
50
|
+
|
51
51
|
if options.is_a?(::Hash)
|
52
52
|
@api_url = options[:api_url] || API_URL
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
unless @api_url
|
56
56
|
@api_url = API_URL
|
57
57
|
end
|
@@ -62,10 +62,11 @@ module OpenTok
|
|
62
62
|
# * +:create_time+
|
63
63
|
# * +:expire_time+ (optional) The time when the token will expire, defined as an integer value for a Unix timestamp (in seconds). If you do not specify this value, tokens expire in 24 hours after being created.
|
64
64
|
# * +:role+ (optional) Added in OpenTok v0.91.5. This defines the role the user will have. There are three roles: subscriber, publisher, and moderator.
|
65
|
+
# * +:connection_data+ (optional) Added in OpenTok v0.91.20. A string containing metadata describing the connection.
|
65
66
|
#
|
66
67
|
# See http://www.tokbox.com/opentok/tools/documentation/overview/token_creation.html for more information on all options.
|
67
68
|
def generate_token(opts = {})
|
68
|
-
{:session_id=>nil, :create_time=>nil, :expire_time=>nil, :role=>nil}.merge!(opts)
|
69
|
+
{:session_id=>nil, :create_time=>nil, :expire_time=>nil, :role=>nil, :connection_data=>nil}.merge!(opts)
|
69
70
|
|
70
71
|
create_time = opts[:create_time].nil? ? Time.now : opts[:create_time]
|
71
72
|
session_id = opts[:session_id].nil? ? '' : opts[:session_id]
|
@@ -82,6 +83,11 @@ module OpenTok
|
|
82
83
|
data_params[:expire_time] = opts[:expire_time].to_i
|
83
84
|
end
|
84
85
|
|
86
|
+
if not opts[:connection_data].nil?
|
87
|
+
raise OpenTokException.new 'Connection data must be less than 1000 characters' if opts[:connection_data].length > 1000
|
88
|
+
data_params[:connection_data] = opts[:connection_data]
|
89
|
+
end
|
90
|
+
|
85
91
|
data_string = data_params.urlencode
|
86
92
|
|
87
93
|
sig = sign_string(data_string, @partner_secret)
|
data/lib/open_tok/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentok
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Stijn Mathysen
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-11-
|
19
|
+
date: 2011-11-30 00:00:00 Z
|
20
20
|
dependencies: []
|
21
21
|
|
22
22
|
description: OpenTok is a free set of APIs from TokBox that enables websites to weave live group video communication into their online experience. With OpenTok you have the freedom and flexibility to create the most engaging web experience for your users. OpenTok is currently available as a JavaScript and ActionScript 3.0 library. This gem allows you to connect to the API from within Ruby (and Rails)
|