mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
server -> client signaling
This commit is contained in:
@ -9,11 +9,6 @@ const (
|
||||
SIGNAL_PROVIDE = "signal/provide"
|
||||
)
|
||||
|
||||
const (
|
||||
IDENTITY_PROVIDE = "identity/provide"
|
||||
IDENTITY_DETAILS = "identity/details"
|
||||
)
|
||||
|
||||
const (
|
||||
MEMBER_LIST = "member/list"
|
||||
MEMBER_CONNECTED = "member/connected"
|
||||
|
@ -13,19 +13,16 @@ type Disconnect struct {
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type Identity struct {
|
||||
type SignalProvide struct {
|
||||
Event string `json:"event"`
|
||||
ID string `json:"id"`
|
||||
SDP string `json:"sdp"`
|
||||
}
|
||||
|
||||
type IdentityDetails struct {
|
||||
type SignalAnswer struct {
|
||||
Event string `json:"event"`
|
||||
Username string `json:"username"`
|
||||
}
|
||||
|
||||
type Signal struct {
|
||||
Event string `json:"event"`
|
||||
SDP string `json:"sdp"`
|
||||
SDP string `json:"sdp"`
|
||||
}
|
||||
|
||||
type MembersList struct {
|
||||
|
@ -16,14 +16,14 @@ type Session interface {
|
||||
Member() *Member
|
||||
SetMuted(muted bool)
|
||||
SetName(name string) error
|
||||
SetConnected(connected bool) error
|
||||
SetSocket(socket WebScoket) error
|
||||
SetPeer(peer Peer) error
|
||||
Address() *string
|
||||
Kick(message string) error
|
||||
Write(v interface{}) error
|
||||
Send(v interface{}) error
|
||||
WriteAudioSample(sample Sample) error
|
||||
WriteVideoSample(sample Sample) error
|
||||
SignalAnwser(sdp string) error
|
||||
}
|
||||
|
||||
type SessionManager interface {
|
||||
@ -39,8 +39,6 @@ type SessionManager interface {
|
||||
Destroy(id string) error
|
||||
Clear() error
|
||||
Brodcast(v interface{}, exclude interface{}) error
|
||||
WriteAudioSample(sample Sample) error
|
||||
WriteVideoSample(sample Sample) error
|
||||
OnHost(listener func(id string))
|
||||
OnHostCleared(listener func(id string))
|
||||
OnDestroy(listener func(id string))
|
||||
|
@ -8,13 +8,12 @@ type Sample struct {
|
||||
type WebRTCManager interface {
|
||||
Start()
|
||||
Shutdown() error
|
||||
CreatePeer(id string, sdp string) (string, Peer, error)
|
||||
CreatePeer(id string, session Session) (string, error)
|
||||
ChangeScreenSize(width int, height int, rate int) error
|
||||
}
|
||||
|
||||
type Peer interface {
|
||||
WriteVideoSample(sample Sample) error
|
||||
WriteAudioSample(sample Sample) error
|
||||
SignalAnwser(sdp string) error
|
||||
WriteData(v interface{}) error
|
||||
Destroy() error
|
||||
}
|
||||
|
Reference in New Issue
Block a user