mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-28 08:27:09 +02:00
private mode implementation.
This commit is contained in:
parent
f549171ded
commit
d004ddd68f
12 changed files with 160 additions and 11 deletions
|
@ -15,6 +15,7 @@ type WebRTCPeerCtx struct {
|
|||
connection *webrtc.PeerConnection
|
||||
dataChannel *webrtc.DataChannel
|
||||
changeVideo func(videoID string) error
|
||||
setPaused func(isPaused bool)
|
||||
iceTrickle bool
|
||||
}
|
||||
|
||||
|
@ -122,6 +123,19 @@ func (peer *WebRTCPeerCtx) SetVideoID(videoID string) error {
|
|||
return peer.changeVideo(videoID)
|
||||
}
|
||||
|
||||
func (peer *WebRTCPeerCtx) SetPaused(isPaused bool) error {
|
||||
peer.mu.Lock()
|
||||
defer peer.mu.Unlock()
|
||||
|
||||
if peer.connection == nil {
|
||||
return types.ErrWebRTCConnectionNotFound
|
||||
}
|
||||
|
||||
peer.logger.Info().Bool("is_paused", isPaused).Msg("set paused")
|
||||
peer.setPaused(isPaused)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (peer *WebRTCPeerCtx) Destroy() {
|
||||
peer.mu.Lock()
|
||||
defer peer.mu.Unlock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue