Browse Source

Added modules section to config file to allow to disable screensharing, youtube and presentation support.

pull/168/head
Simon Eisenmann 11 years ago
parent
commit
076bcdb271
  1. 9
      html/main.html
  2. 6
      server.conf.in
  3. 16
      src/app/spreed-webrtc-server/config.go
  4. 6
      static/js/directives/directives.js
  5. 47
      static/js/directives/menu.js
  6. 10
      static/partials/menu.html

9
html/main.html

@ -22,14 +22,7 @@ @@ -22,14 +22,7 @@
<div class="navbar-collapse collapse" collapse="isCollapsed">
<ul class="nav navbar-nav navbar-right right">
<li class="ng-cloak">
<button title="{{_('Share a YouTube video')}}" class="btn aenablebtn btn-youtubevideo" ng-show="status=='connected' || status=='conference' || layout.youtubevideo" ng-model="layout.youtubevideo" btn-checkbox><i class="fa fa-youtube"></i></button>
<button title="{{_('Share a file as presentation')}}" class="btn aenablebtn btn-presentation" ng-show="status=='connected' || status=='conference' || layout.presentation" ng-model="layout.presentation" btn-checkbox><i class="fa fa-folder-open-o"></i></button>
<button title="{{_('Share your screen')}}" class="btn aenablebtn btn-screenshare" ng-disabled="!supported.screensharing" ng-show="status=='connected' || status=='conference' || layout.screenshare" ng-model="layout.screenshare" btn-checkbox><i class="fa fa-desktop"></i></button>
<button title="{{_('Chat')}}" class="btn btn-chat" ng-class="{messagesunseen: chatMessagesUnseen>0}" ng-model="layout.chat" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa fa-comments-o"></i><span class="badge" ng-show="chatMessagesUnseen" ng-bind="chatMessagesUnseen"></span></button>
<button ng-show="myid && myuserid" title="{{_('Contacts')}}" class="btn btn-contacts" ng-click="openContactsManager()"><i class="fa fa-sitemap"></i></button>
<button title="{{_('Mute microphone')}}" class="btn btn-mutemicrophone amutebtn" ng-model="microphoneMute" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa"></i></button>
<button title="{{_('Turn camera off')}}" class="btn btn-mutecamera amutebtn" ng-model="cameraMute" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa"></i></button>
<button title="{{_('Settings')}}" class="btn btn-settings" ng-model="layout.settings" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa fa-cog"></i></button>
<menu></menu>
</li>
</ul>
</div>

6
server.conf.in

@ -115,6 +115,12 @@ serverRealm = local @@ -115,6 +115,12 @@ serverRealm = local
; to test your CSP before putting it into production.
;contentSecurityPolicyReportOnly =
[modules]
; Modules provide optional functionality. Modules are enabled by default and can be disabled by setting false to their corresponding configuration.
;screensharing = true
;youtube = true
;presentation = true
[log]
;logfile = /var/log/spreed-webrtc-server.log

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

@ -23,11 +23,11 @@ package main @@ -23,11 +23,11 @@ package main
import (
"fmt"
"github.com/strukturag/phoenix"
"log"
"net/http"
"strings"
"time"
"github.com/strukturag/phoenix"
)
type Config struct {
@ -46,6 +46,7 @@ type Config struct { @@ -46,6 +46,7 @@ type Config struct {
DefaultRoomEnabled bool // Flag if default room ("") is enabled
Plugin string // Plugin to load
AuthorizeRoomCreation bool // Whether a user account is required to create rooms
Modules []string // List of enabled modules
globalRoomID string // Id of the global room (not exported to Javascript)
contentSecurityPolicy string // HTML content security policy
contentSecurityPolicyReportOnly string // HTML content security policy in report only mode
@ -85,6 +86,16 @@ func NewConfig(container phoenix.Container, tokens bool) *Config { @@ -85,6 +86,16 @@ func NewConfig(container phoenix.Container, tokens bool) *Config {
turnURIs := strings.Split(turnURIsString, " ")
trimAndRemoveDuplicates(&turnURIs)
// Get enabled modules.
allModules := []string{"screensharing", "youtube", "presentation"}
modules := allModules[:0]
for _, module := range allModules {
if container.GetBoolDefault("modules", module, true) {
modules = append(modules, module)
}
}
log.Println("Enabled modules:", modules)
return &Config{
Title: container.GetStringDefault("app", "title", "Spreed WebRTC"),
ver: ver,
@ -101,6 +112,7 @@ func NewConfig(container phoenix.Container, tokens bool) *Config { @@ -101,6 +112,7 @@ func NewConfig(container phoenix.Container, tokens bool) *Config {
DefaultRoomEnabled: container.GetBoolDefault("app", "defaultRoomEnabled", true),
Plugin: container.GetStringDefault("app", "plugin", ""),
AuthorizeRoomCreation: container.GetBoolDefault("app", "authorizeRoomCreation", false),
Modules: modules,
globalRoomID: container.GetStringDefault("app", "globalRoom", ""),
contentSecurityPolicy: container.GetStringDefault("app", "contentSecurityPolicy", ""),
contentSecurityPolicyReportOnly: container.GetStringDefault("app", "contentSecurityPolicyReportOnly", ""),

6
static/js/directives/directives.js

@ -47,7 +47,8 @@ define([ @@ -47,7 +47,8 @@ define([
'directives/youtubevideo',
'directives/bfi',
'directives/title',
'directives/welcome'], function(_, onEnter, onEscape, statusMessage, buddyList, buddyPictureCapture, buddyPictureUpload, settings, chat, audioVideo, usability, audioLevel, fileInfo, screenshare, roomBar, socialShare, page, contactRequest, defaultDialog, pdfcanvas, odfcanvas, presentation, youtubevideo, bfi, title, welcome) {
'directives/welcome',
'directives/menu'], function(_, onEnter, onEscape, statusMessage, buddyList, buddyPictureCapture, buddyPictureUpload, settings, chat, audioVideo, usability, audioLevel, fileInfo, screenshare, roomBar, socialShare, page, contactRequest, defaultDialog, pdfcanvas, odfcanvas, presentation, youtubevideo, bfi, title, welcome, menu) {
var directives = {
onEnter: onEnter,
@ -74,7 +75,8 @@ define([ @@ -74,7 +75,8 @@ define([
youtubevideo: youtubevideo,
bfi: bfi,
title: title,
welcome: welcome
welcome: welcome,
menu: menu
};
var initialize = function(angModule) {

47
static/js/directives/menu.js

@ -0,0 +1,47 @@ @@ -0,0 +1,47 @@
/*
* Spreed WebRTC.
* Copyright (C) 2013-2015 struktur AG
*
* This file is part of Spreed WebRTC.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
"use strict";
define(['text!partials/menu.html'], function(template) {
// menu
return ["mediaStream", function(mediaStream) {
var link = function($scope, $element) {
$scope.modules = mediaStream.config.Modules || [];
$scope.withModule = function(m) {
return $scope.modules.indexOf(m) !== -1;
};
};
return {
restrict: 'E',
replace: true,
scope: true,
template: template,
link: link
}
}];
});

10
static/partials/menu.html

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<span>
<button ng-if="withModule('youtube')" title="{{_('Share a YouTube video')}}" class="btn aenablebtn btn-youtubevideo" ng-show="status=='connected' || status=='conference' || layout.youtubevideo" ng-model="layout.youtubevideo" btn-checkbox><i class="fa fa-youtube"></i></button>
<button ng-if="withModule('presentation')" title="{{_('Share a file as presentation')}}" class="btn aenablebtn btn-presentation" ng-show="status=='connected' || status=='conference' || layout.presentation" ng-model="layout.presentation" btn-checkbox><i class="fa fa-folder-open-o"></i></button>
<button ng-if="withModule('screensharing')" title="{{_('Share your screen')}}" class="btn aenablebtn btn-screenshare" ng-disabled="!supported.screensharing" ng-show="status=='connected' || status=='conference' || layout.screenshare" ng-model="layout.screenshare" btn-checkbox><i class="fa fa-desktop"></i></button>
<button title="{{_('Chat')}}" class="btn btn-chat" ng-class="{messagesunseen: chatMessagesUnseen>0}" ng-model="layout.chat" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa fa-comments-o"></i><span class="badge" ng-show="chatMessagesUnseen" ng-bind="chatMessagesUnseen"></span></button>
<button ng-show="myid && myuserid" title="{{_('Contacts')}}" class="btn btn-contacts" ng-click="openContactsManager()"><i class="fa fa-sitemap"></i></button>
<button title="{{_('Mute microphone')}}" class="btn btn-mutemicrophone amutebtn" ng-model="microphoneMute" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa"></i></button>
<button title="{{_('Turn camera off')}}" class="btn btn-mutecamera amutebtn" ng-model="cameraMute" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa"></i></button>
<button title="{{_('Settings')}}" class="btn btn-settings" ng-model="layout.settings" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa fa-cog"></i></button>
</span>
Loading…
Cancel
Save