Browse Source

Added renegotiation configuration to server.

pull/206/head
Simon Eisenmann 10 years ago committed by Simon Eisenmann
parent
commit
6c1e9791d5
  1. 3
      server.conf.in
  2. 2
      src/app/spreed-webrtc-server/config.go
  3. 3
      static/js/mediastream/usermedia.js
  4. 2
      static/js/services/mediastream.js

3
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 ; 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 ; 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 ; 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. ; server will provide STUN services.
;renegotiation = false
;stunURIs = stun:stun.spreed.me:443 ;stunURIs = stun:stun.spreed.me:443
; TURN server URIs in format host:port?transport=udp|tcp. You can provide ; 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 ; multiple seperated by space. If you do not have at least one TURN server then

2
src/app/spreed-webrtc-server/config.go

@ -36,6 +36,7 @@ type Config struct {
S string // Static URL prefix with version S string // Static URL prefix with version
B string // Base URL B string // Base URL
Token string // Server token Token string // Server token
Renegotiation bool // Renegotiation flag
StunURIs []string // STUN server URIs StunURIs []string // STUN server URIs
TurnURIs []string // TURN server URIs TurnURIs []string // TURN server URIs
Tokens bool // True when we got a tokens file 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), S: fmt.Sprintf("static/ver=%s", ver),
B: basePath, B: basePath,
Token: serverToken, Token: serverToken,
Renegotiation: container.GetBoolDefault("app", "renegotiation", false),
StunURIs: stunURIs, StunURIs: stunURIs,
TurnURIs: turnURIs, TurnURIs: turnURIs,
Tokens: tokens, Tokens: tokens,

3
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 // If true, mute/unmute of audio/video creates a new stream which
// will trigger renegotiation on the peer connection. // will trigger renegotiation on the peer connection.
this.renegotiation = options.renegotiation && true; this.renegotiation = options.renegotiation && true;
if (this.renegotiation) {
console.info("User media with renegotiation created ...");
}
this.audioMute = options.audioMute && true; this.audioMute = options.audioMute && true;
this.videoMute = options.videoMute && true; this.videoMute = options.videoMute && true;

2
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)); var secureKey = sjcl.codec.base64.fromBits(sjcl.hash.sha256.hash(context.Cfg.Token + uaparser().browser.name));
// Apply configuration details. // Apply configuration details.
webrtc.settings.renegotiation = context.Cfg.WebRTC ? context.Cfg.WebRTC.Renegotiation : false; webrtc.settings.renegotiation = context.Cfg.Renegotiation && true;
// mediaStream service API. // mediaStream service API.
var mediaStream = { var mediaStream = {

Loading…
Cancel
Save