Archived
2
0

Implicit control gain (#108)

* add client side implicit hosting.

* add server side implicit hosting.

* update changelog.

* allow clipboard & keybaord access.
This commit is contained in:
Miroslav Šedivý
2021-12-11 14:34:28 +01:00
committed by GitHub
parent f08ed0fc28
commit 7d1fa28d88
21 changed files with 125 additions and 38 deletions

View File

@ -22,6 +22,8 @@ type WebRTC struct {
NAT1To1IPs []string
TCPMUX int
UDPMUX int
ImplicitControl bool
}
func (WebRTC) Init(cmd *cobra.Command) error {
@ -65,6 +67,12 @@ func (WebRTC) Init(cmd *cobra.Command) error {
return err
}
// TODO: Should be moved to session config.
cmd.PersistentFlags().Bool("implicitcontrol", false, "if enabled members can gain control implicitly")
if err := viper.BindPFlag("implicitcontrol", cmd.PersistentFlags().Lookup("implicitcontrol")); err != nil {
return err
}
return nil
}
@ -120,4 +128,7 @@ func (s *WebRTC) Set() {
s.EphemeralMin = min
s.EphemeralMax = max
}
// TODO: Should be moved to session config.
s.ImplicitControl = viper.GetBool("implicitcontrol")
}

View File

@ -38,6 +38,8 @@ type SessionManager interface {
ClearHost()
Has(id string) bool
Get(id string) (Session, bool)
SetControlLocked(locked bool)
CanControl(id string) bool
Members() []*Member
Admins() []*Member
Destroy(id string)

View File

@ -13,6 +13,7 @@ type WebRTCManager interface {
CreatePeer(id string, session Session) (Peer, error)
ICELite() bool
ICEServers() []webrtc.ICEServer
ImplicitControl() bool
}
type Peer interface {