opentok-0.0.4: An OpenTok SDK for Haskell

Safe HaskellNone
LanguageHaskell2010

OpenTok

Synopsis

Documentation

data OpenTok Source #

Represents an OpenTok project.

Get your project key and secret from https://tokbox.com/account/

Instances
Show OpenTok Source # 
Instance details

Defined in OpenTok

opentok :: APIKey -> APISecret -> OpenTok Source #

Get an OpenTok project

ot = opentok "my_api_key" "my_api_secret"

createSession :: OpenTok -> SessionOptions -> IO (Either OTError Session) Source #

Create a new OpenTok Session

options = sessionOpts { mediaMode = Routed }
session <- createSession ot sessionOpts

generateToken :: OpenTok -> SessionId -> TokenOptions -> IO (Either OTError Token) Source #

Generate a token.

let options = tokenOpts { connectionData = "name:tim" }
token <- generateToken ot options

type Token = String Source #

An access token for an OpenTok Session

data TokenOptions Source #

Information on user roles and other options can be found at https://tokbox.com/developer/guides/create-token/

Instances
Show TokenOptions Source # 
Instance details

Defined in OpenTok.Token

Generic TokenOptions Source # 
Instance details

Defined in OpenTok.Token

Associated Types

type Rep TokenOptions :: * -> * #

type Rep TokenOptions Source # 
Instance details

Defined in OpenTok.Token

tokenOpts :: TokenOptions Source #

Default Token options

TokenOptions
  { _role                       = Publisher
  , _expireTime                 = Nothing
  , _connectionData             = Nothing
  , _initialLayoutClassList     = Nothing
}

startArchive :: OpenTok -> ArchiveOptions -> IO (Either OTError Archive) Source #

Start recording an archive of an OpenTok session

startArchive ot archiveOpts { sessionId = "your_session_id" }

stopArchive :: OpenTok -> ArchiveId -> IO (Either OTError Archive) Source #

Stop recording an archive of an OpenTok session

stopArchive ot "your_session_id"

listArchives :: OpenTok -> ListArchiveOptions -> IO (Either OTError ArchiveCollection) Source #

Get a list of all archives for a project or a single session

listArchives ot listArchiveOpts { _forSessionId = "some_session_id" }

deleteArchive :: OpenTok -> ArchiveId -> IO (Either OTError ArchiveId) Source #

Delete an Archive

deleteArchive ot "some_archive_id"