Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- type Configuration
- type Info
- type LongPollCallbacks
- type Message
- type MessageBody
- type MessageCandidate
- type MessageData
- type MessageError
- type MessageJSEP
- type MessageMountpoint
- type MessagePluginData
- type MessageWatch
- type Mountpoint
- type PluginData
- type PluginListItem
- type PluginResult
- type Session
- type StreamingHandle
- func (h *StreamingHandle) Create(m Mountpoint) (err error)
- func (h *StreamingHandle) Destroy(id int) (err error)
- func (h *StreamingHandle) List() (ms []int, err error)
- func (h *StreamingHandle) Start(jsep *MessageJSEP) (err error)
- func (h *StreamingHandle) Trickle(c *MessageCandidate) (err error)
- func (h *StreamingHandle) Watch(id int) (err error)
Constants ¶
View Source
const ( StreamingMountpointTypeLive = "live" StreamingMountpointTypeOnDemand = "ondemand" StreamingMountpointTypeRTP = "rtp" StreamingMountpointTypeRSTP = "rstp" )
Mountpoint types
View Source
const (
PluginResultStatusPreparing = "preparing"
)
Variables ¶
View Source
var (
Addr = flag.String("janus-addr", "", "the Janus addr")
)
Flags
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the client
type Configuration ¶
type Configuration struct {
Addr string `toml:"addr"`
Sender astikit.HTTPSenderOptions
}
Configuration represents the lib's configuration
func FlagConfig ¶
func FlagConfig() Configuration
FlagConfig generates a Configuration based on flags
type LongPollCallbacks ¶
type LongPollCallbacks struct {
StreamingPreparing func(transaction string, jsep *MessageJSEP) error
Unknown func(m Message) error
}
LongPollCallback represents long poll callbacks indexed by event name
type Message ¶
type Message struct {
Body interface{} `json:"body,omitempty"`
Candidate *MessageCandidate `json:"candidate,omitempty"`
Data *MessageData `json:"data,omitempty"`
Error *MessageError `json:"error,omitempty"`
Janus string `json:"janus,omitempty"`
JSEP *MessageJSEP `json:"jsep,omitempty"`
Plugin string `json:"plugin,omitempty"`
PluginData *MessagePluginData `json:"plugindata,omitempty"`
Transaction string `json:"transaction,omitempty"`
}
type MessageBody ¶
type MessageBody struct {
Request string `json:"request"`
}
type MessageCandidate ¶
type MessageData ¶
type MessageData struct {
ID int `json:"id"`
}
type MessageError ¶
type MessageJSEP ¶
type MessageMountpoint ¶
type MessageMountpoint struct {
MessageBody
Mountpoint
}
type MessagePluginData ¶
type MessagePluginData struct {
Data *PluginData `json:"data"`
Plugin string `json:"plugin"`
}
type MessageWatch ¶
type MessageWatch struct {
MessageBody
ID int `json:"id"`
OfferVideo bool `json:"offer_video"`
}
type Mountpoint ¶
type Mountpoint struct {
Audio bool `json:"audio,omitempty"`
AudioPayloadType int `json:"audiopt,omitempty"`
AudioPort int `json:"audioport,omitempty"`
AudioRTPMap string `json:"audiortpmap,omitempty"`
Description string `json:"description,omitempty"`
ID int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Permanent bool `json:"permanent,omitempty"`
Type string `json:"type,omitempty"`
Video bool `json:"video,omitempty"`
VideoFMTP string `json:"videofmtp,omitempty"`
VideoPayloadType int `json:"videopt,omitempty"`
VideoPort int `json:"videoport,omitempty"`
VideoRTPMap string `json:"videortpmap,omitempty"`
}
type PluginData ¶
type PluginData struct {
Error string `json:"error,omitempty"`
ErrorCode int `json:"error_code,omitempty"`
List []PluginListItem `json:"list,omitempty"`
Result *PluginResult `json:"result,omitempty"`
Streaming string `json:"streaming,omitempty"`
}
type PluginListItem ¶ added in v0.4.0
type PluginListItem struct {
ID int `json:"id"`
}
type PluginResult ¶
type PluginResult struct {
Status string `json:"status,omitempty"`
}
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents a session
func (*Session) LongPoll ¶
func (s *Session) LongPoll(cbs LongPollCallbacks) (err error)
LongPoll starts long polling
func (*Session) NewStreamingHandle ¶
func (s *Session) NewStreamingHandle() (h *StreamingHandle, err error)
type StreamingHandle ¶
type StreamingHandle struct {
// contains filtered or unexported fields
}
StreamingHandle represents a streaming handle
func (*StreamingHandle) Create ¶ added in v0.4.0
func (h *StreamingHandle) Create(m Mountpoint) (err error)
Create creates a new mountpoint
func (*StreamingHandle) Destroy ¶ added in v0.4.0
func (h *StreamingHandle) Destroy(id int) (err error)
Destroy deletes a mountpoint
func (*StreamingHandle) List ¶ added in v0.4.0
func (h *StreamingHandle) List() (ms []int, err error)
List lists all mountpoint ids
func (*StreamingHandle) Start ¶
func (h *StreamingHandle) Start(jsep *MessageJSEP) (err error)
Start requests to start with the provided jsep
func (*StreamingHandle) Trickle ¶
func (h *StreamingHandle) Trickle(c *MessageCandidate) (err error)
Trickle requests to trickle the provided candidate
func (*StreamingHandle) Watch ¶
func (h *StreamingHandle) Watch(id int) (err error)
Watch requests to watch the provided id
Click to show internal directories.
Click to hide internal directories.