diff --git a/server.conf.in b/server.conf.in index a02df90c..4cede67e 100644 --- a/server.conf.in +++ b/server.conf.in @@ -43,7 +43,10 @@ listen = 127.0.0.1:8080 ; STUN server URIs in format host:port. You can provide multiple seperated by ; space. If you do not have one use a public one like stun.spreed.me:443. If ; you have a TURN server you do not need to set an STUN server as the TURN +; Renegotiation support flag. Set to true to tell clients that they can +; renegoiate peer connections when required. Defaults to false. ; server will provide STUN services. +;renegotiation = false ;stunURIs = stun:stun.spreed.me:443 ; TURN server URIs in format host:port?transport=udp|tcp. You can provide ; multiple seperated by space. If you do not have at least one TURN server then diff --git a/src/app/spreed-webrtc-server/config.go b/src/app/spreed-webrtc-server/config.go index 94dbd11f..89a14c54 100644 --- a/src/app/spreed-webrtc-server/config.go +++ b/src/app/spreed-webrtc-server/config.go @@ -36,6 +36,7 @@ type Config struct { S string // Static URL prefix with version B string // Base URL Token string // Server token + Renegotiation bool // Renegotiation flag StunURIs []string // STUN server URIs TurnURIs []string // TURN server URIs Tokens bool // True when we got a tokens file @@ -112,6 +113,7 @@ func NewConfig(container phoenix.Container, tokens bool) *Config { S: fmt.Sprintf("static/ver=%s", ver), B: basePath, Token: serverToken, + Renegotiation: container.GetBoolDefault("app", "renegotiation", false), StunURIs: stunURIs, TurnURIs: turnURIs, Tokens: tokens, diff --git a/static/js/mediastream/usermedia.js b/static/js/mediastream/usermedia.js index d2bac007..8f67c78c 100644 --- a/static/js/mediastream/usermedia.js +++ b/static/js/mediastream/usermedia.js @@ -133,6 +133,9 @@ define(['jquery', 'underscore', 'audiocontext', 'webrtc.adapter'], function($, _ // If true, mute/unmute of audio/video creates a new stream which // will trigger renegotiation on the peer connection. this.renegotiation = options.renegotiation && true; + if (this.renegotiation) { + console.info("User media with renegotiation created ..."); + } this.audioMute = options.audioMute && true; this.videoMute = options.videoMute && true; diff --git a/static/js/services/mediastream.js b/static/js/services/mediastream.js index 899e39a2..da0c0c85 100644 --- a/static/js/services/mediastream.js +++ b/static/js/services/mediastream.js @@ -44,7 +44,7 @@ define([ var secureKey = sjcl.codec.base64.fromBits(sjcl.hash.sha256.hash(context.Cfg.Token + uaparser().browser.name)); // Apply configuration details. - webrtc.settings.renegotiation = context.Cfg.WebRTC ? context.Cfg.WebRTC.Renegotiation : false; + webrtc.settings.renegotiation = context.Cfg.Renegotiation && true; // mediaStream service API. var mediaStream = {