Skip to content

mcassagnes/opentok-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opentok-rest

Unofficial OpenTok REST API for Node. Not all features are available in the official Node client (most BETA features), this is why we made this module.

Build Status

Getting started

npm install opentok-rest
// or
yarn install opentok-rest
const OpenTokRest = require('opentok-rest')
const opentok = new OpenTokRest('opentok-key', 'opentok-secret')

Broadcast

Start a broadcast

opentok.broadcast.start(sessionId, outputs)
  .then(broadcast => {
    // resolves an opentok broadcast object.
  })

See doc for an example object: https://tokbox.com/developer/rest/#start_broadcast

Start a broadcast

opentok.broadcast.stop(broadcastId)
  .then(broadcast => {
    // resolves an opentok broadcast object.
    // example response: https://tokbox.com/developer/rest/#stop_broadcast
  })
  .catch(...)

Set the layout

See https://tokbox.com/developer/rest/#change_live_streaming_layout for layout options

opentok.broadcast.setLayout(broadcastId, layout)
  .then(...)
  .catch(...)

Archive

Set the layout

See https://tokbox.com/developer/beta/archive-custom-layout/#dynamically-changing-the-layout-type-while-the-session-is-being-archived for layout options

opentok.archive.setLayout(archiveId, layout)
  .then(...)
  .catch(...)

About

Unofficial OpenTok REST-only API for Node

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published