Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data OpenTok
- opentok :: APIKey -> APISecret -> OpenTok
- createSession :: OpenTok -> SessionOptions -> IO (Either OTError Session)
- generateToken :: OpenTok -> SessionId -> TokenOptions -> IO (Either OTError Token)
- type Token = String
- data TokenOptions
- tokenOpts :: TokenOptions
- startArchive :: OpenTok -> ArchiveOptions -> IO (Either OTError Archive)
- stopArchive :: OpenTok -> ArchiveId -> IO (Either OTError Archive)
Documentation
Represents an OpenTok project.
Get your project key and secret from https://tokbox.com/account/
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 #
Generate 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
data TokenOptions Source #
Instances
Show TokenOptions Source # | |
Defined in OpenTok.Token showsPrec :: Int -> TokenOptions -> ShowS # show :: TokenOptions -> String # showList :: [TokenOptions] -> ShowS # | |
Generic TokenOptions Source # | |
Defined in OpenTok.Token type Rep TokenOptions :: * -> * # from :: TokenOptions -> Rep TokenOptions x # to :: Rep TokenOptions x -> TokenOptions # | |
type Rep TokenOptions Source # | |
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" }