Skip to content

Instantly share code, notes, and snippets.

Last active May 29, 2016 11:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save BitOfUniverse/10acf4aaaacdbc851c8fb59b51479bdc to your computer and use it in GitHub Desktop.
class UsersController < ApplicationController
before_action :authenticate_user!
def stream
@stream = || current_user.create_stream
gon.opentok = opentok_data(@stream)
def watch
@stream = User.find(params[:id]).stream
gon.opentok = opentok_data(@stream)
def opentok_data(stream)
token = OpenTokClient.generate_token(stream.opentok_session_id)
{ sessionId: stream.opentok_session_id, apiKey: Figaro.env.opentok_api_key, token: token }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment