diff --git a/janus.go b/janus.go index 09d4cc0..61a4cee 100644 --- a/janus.go +++ b/janus.go @@ -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() { diff --git a/types.go b/types.go index 74c2a5a..86b19cd 100644 --- a/types.go +++ b/types.go @@ -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{} }, @@ -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"` }