Documentation
¶
Index ¶
- Constants
- type Archive
- type ArchiveMode
- type MediaMode
- type Role
- type Session
- func (s *Session) StartArchiving(archiveVideo bool, archiveAudio bool, ctx ...context.Context) (*Archive, error)
- func (s *Session) Token(role Role, connectionData string, expiration int64) (string, error)
- func (s *Session) Tokens(n int, multithread bool, role Role, connectionData string, expiration int64) []string
- type Tokbox
Constants ¶
View Source
const ( // Publisher A publisher can publish streams, subscribe to streams, and signal. Publisher Role = "publisher" // Subscriber A subscriber can only subscribe to streams. Subscriber = "subscriber" // Moderator In addition to the privileges granted to a publisher, // in clients using the OpenTok.js 2.2 library, // a moderator can call the <code>forceUnpublish()</code> and <code>forceDisconnect()</code> // method of the Session object. Moderator = "moderator" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Archive ¶
type Archive struct { CreatedAt int `json:"createdAt"` Duration int `json:"duration"` HasAudio bool `json:"hasAudio"` HasVideo bool `json:"hasVideo"` ID string `json:"id"` Name string `json:"name"` OutputMode string `json:"outputMode"` ProjectID int `json:"projectId"` Reason string `json:"reason"` Resolution string `json:"resolution"` SessionID string `json:"sessionId"` Size int `json:"side"` Status string `json:"status"` URL string `json:"url"` S *Session `json:"-"` }
Archive struct represents archive create response
type ArchiveMode ¶
type ArchiveMode string
ArchiveMode is the mode of archiving
const ( // ManualArchive The session will be manually archived (default option). ManualArchive ArchiveMode = "manual" // AlwaysArchive The session will be automatically archived. AlwaysArchive = "always" )
type MediaMode ¶
type MediaMode string
MediaMode is the mode of media
const ( // MediaRouter The session will send streams using the OpenTok Media Router. MediaRouter MediaMode = "disabled" // P2P The session will attempt send streams directly between clients. // If clients cannot connect due to firewall restrictions, // the session uses the OpenTok TURN server to relay streams. P2P = "enabled" )
type Session ¶
type Session struct { SessionID string `json:"session_id"` ProjectID string `json:"project_id"` PartnerID string `json:"partner_id"` CreateDt string `json:"create_dt"` SessionStatus string `json:"session_status"` MediaServerURL string `json:"media_server_url"` T *Tokbox `json:"-"` }
Session tokbox session
func (*Session) StartArchiving ¶
func (s *Session) StartArchiving(archiveVideo bool, archiveAudio bool, ctx ...context.Context) (*Archive, error)
StartArchiving starts archiving session
type Tokbox ¶
type Tokbox struct {
// contains filtered or unexported fields
}
Tokbox is the main struct to be used for API
func (*Tokbox) NewSession ¶
func (t *Tokbox) NewSession(location string, mm MediaMode, am ArchiveMode, ctx ...context.Context) (*Session, error)
NewSession Creates a new tokbox session or returns an error. See README file for full documentation: https://github.com/aogz/tokbox NOTE: ctx must be nil if *not* using Google App Engine
Click to show internal directories.
Click to hide internal directories.