Skip to content

Latest commit

 

History

History
52 lines (31 loc) · 1.77 KB

README.textile

File metadata and controls

52 lines (31 loc) · 1.77 KB

* UPDATE *

I will no longer be maintaining this gem. Please refer to https://github.com/stijnster/opentok as the authorative source for updates to this gem.

Thank you.

Karmen

Opentok

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. Check out http://www.tokbox.com/ and http://www.tokbox.com/opentok/tools/js/gettingstarted for more information.

This is the official Opentok rubygem.

Installation

To install using bundler, add Opentok to you gemfile and run `bundle install`:

gem 'opentok'

To install as a regular gem just type `gem install opentok`

How it works

API-key and secret

Request your api-key and secret at http://www.tokbox.com/opentok/tools/js/apikey. You can use the staging environment for testing. The gem uses this staging environment by default.

Create a session

With the following code, you can generate a valid session_id.


@api_key = 0 # should be a number
@api_secret = ‘’ # should be a string
@location = ’localhost’ # give Opentok a hint on where you are running your application

@opentok = OpenTok::OpenTokSDK.new @api_key, @api_secret

session_id @opentok.create_session(host)

Create tokens

With the generated session_id, you can start generating tokens for each user.


opentok.generate_token :session_id => "#{session_id}"

Typically you would create one session_id and store it (in e.g. a setting) and share that session_id between all users.