webrtc removed unused function.

This commit is contained in:
Miroslav Šedivý 2020-10-31 20:11:32 +01:00
parent 06282d8064
commit dadac4f145
2 changed files with 0 additions and 10 deletions

View File

@ -13,6 +13,5 @@ type WebRTCManager interface {
type Peer interface {
SignalAnswer(sdp string) error
WriteData(v interface{}) error
Destroy() error
}

View File

@ -1,8 +1,6 @@
package webrtc
import (
"sync"
"github.com/pion/webrtc/v2"
)
@ -14,19 +12,12 @@ type Peer struct {
settings *webrtc.SettingEngine
connection *webrtc.PeerConnection
configuration *webrtc.Configuration
mu sync.Mutex
}
func (peer *Peer) SignalAnswer(sdp string) error {
return peer.connection.SetRemoteDescription(webrtc.SessionDescription{SDP: sdp, Type: webrtc.SDPTypeAnswer})
}
func (peer *Peer) WriteData(v interface{}) error {
peer.mu.Lock()
defer peer.mu.Unlock()
return nil
}
func (peer *Peer) Destroy() error {
if peer.connection != nil && peer.connection.ConnectionState() == webrtc.PeerConnectionStateConnected {
if err := peer.connection.Close(); err != nil {