Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion janus.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (gateway *Gateway) send(msg map[string]interface{}, transaction chan interf
}

func passMsg(ch chan interface{}, msg interface{}) {
ch <- msg
ch <- msg
}

func (gateway *Gateway) ping() {
Expand Down
12 changes: 12 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package janus

var msgtypes = map[string]func() interface{}{
"trickle": func() interface{} { return &TrickleMsg{} },
"error": func() interface{} { return &ErrorMsg{} },
"success": func() interface{} { return &SuccessMsg{} },
"detached": func() interface{} { return &DetachedMsg{} },
Expand All @@ -40,6 +41,17 @@ type BaseMsg struct {
Handle uint64 `json:"sender"`
}

type TrickleMsg struct {
Candidate Candidate `json:"candidate"`
}

type Candidate struct {
Completed bool `json:"completed"`
SdpMid *string `json:"sdpMid"`
SdpMLineIndex *uint16 `json:"sdpMLineIndex"`
Candidate string `json:"candidate"`
}

type ErrorMsg struct {
Err ErrorData `json:"error"`
}
Expand Down