jonmumm / opentok

Ruby gem for opentok api

Home Page:https://rubygems.org/gems/opentok

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Ruby gem for opentok api

https://rubygems.org/gems/opentok

License:MIT License


Languages

Language:Ruby 75.6%Language:JavaScript 24.4%