Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gugat committed Feb 8, 2014
1 parent 921405f commit ea0c763
Show file tree
Hide file tree
Showing 20 changed files with 20,101 additions and 218 deletions.
5 changes: 5 additions & 0 deletions bigbluebutton-client/locale/en_US/bbbResources.properties
Expand Up @@ -21,6 +21,11 @@ bbb.micSettings.cancel = Cancel
bbb.micSettings.cancel.toolTip = Cancel joining the audio conference
bbb.micSettings.access.helpButton = Open tutorial videos in a new page.
bbb.micSettings.access.title = Audio Settings. Focus will remain in this audio settings window until the window is closed.
bbb.micSettings.webrtc.title = WebRTC Support
bbb.micSettings.webrtc.capableBrowser = Your browser supports WebRTC.
bbb.micSettings.webrtc.capableBrowser.dontuseit = Click not to use WebRTC
bbb.micSettings.webrtc.capableBrowser.dontuseit.toolTip = Click here if you don't want to use the WebRTC technology (recommended if you have problems using it).
bbb.micSettings.webrtc.notCapableBrowser = Currently this system only supports WebRTC on Google Chrome. You will still be able to join the voice conference using the Adobe Flash Platform.
bbb.mainToolbar.helpBtn = Help
bbb.mainToolbar.logoutBtn = Logout
bbb.mainToolbar.logoutBtn.toolTip = Log out
Expand Down
2 changes: 1 addition & 1 deletion bigbluebutton-client/locale/it_IT/bbbResources.properties
@@ -1,4 +1,4 @@
bbb.mainshell.locale.version = 0.8
bbb.mainshell.locale.version = 0.80
bbb.mainshell.statusProgress.connecting = Connessione alla conferenza in corso...
bbb.mainshell.statusProgress.loading = Caricamento {0}
bbb.mainshell.statusProgress.cannotConnectServer = Errore di connessione.
Expand Down
5 changes: 5 additions & 0 deletions bigbluebutton-client/locale/pt_BR/bbbResources.properties
Expand Up @@ -21,6 +21,11 @@ bbb.micSettings.cancel = Cancelar
bbb.micSettings.cancel.toolTip = Cancelar a entrada na conferência de voz
bbb.micSettings.access.helpButton = Abrir os vídeos tutoriais em uma nova janela.
bbb.micSettings.access.title = Configurações de som. O foco permanecerá na janela de configurações de som até que a janela seja fechada.
bbb.micSettings.webrtc.title = Suporte a WebRTC
bbb.micSettings.webrtc.capableBrowser = Seu navegador suporta WebRTC.
bbb.micSettings.webrtc.capableBrowser.dontuseit = Clique para não utilizar WebRTC
bbb.micSettings.webrtc.capableBrowser.dontuseit.toolTip = Clique aqui se não desejar utilizar a tecnologia WebRTC (recomendado se você tiver problemas ao utilizá-la).
bbb.micSettings.webrtc.notCapableBrowser = Atualmente este sistema suporta WebRTC apenas no Google Chrome. Você ainda será capaz de acionar seu áudio utilizando a plataforma Adobe Flash.
bbb.mainToolbar.helpBtn = Ajuda
bbb.mainToolbar.logoutBtn = Sair
bbb.mainToolbar.logoutBtn.toolTip = Sair da sessão
Expand Down
1 change: 1 addition & 0 deletions bigbluebutton-client/resources/config.xml.template
Expand Up @@ -51,6 +51,7 @@
skipCheck="false"
showButton="true"
enabledEchoCancel="true"
useWebrtcIfAvailable="true"
dependsOn="UsersModule"
/>

Expand Down
98 changes: 95 additions & 3 deletions bigbluebutton-client/resources/prod/BigBlueButton.html
@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>BigBlueButton</title>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css" media="screen">
html, body, #content { height:100%; }
Expand Down Expand Up @@ -43,23 +43,38 @@
<script src="lib/bbb_blinker.js" language="javascript"></script>
<script src="lib/bbb_deskshare.js" language="javascript"></script>
<script src="lib/bbb_api_bridge.js" language="javascript"></script>
<script src="lib/jssip-devel.js" language="javascript"></script>
<script src="lib/bbb_webrtc_bridge_jssip.js" language="javascript"></script>
<!-- <script src="lib/sipml5api.js" language="javascript"></script> -->
<!-- <script src="lib/bbb_webrtc_bridge_sipml5.js" language="javascript"></script> -->
<script>
window.chatLinkClicked = function(url) {
window.open(url, '_blank');
window.focus();
}
</script>
</head>

<body>
<div>
<!-- <button onclick="hangUp()">Hang up</button>
<button onclick="callIntoConference()">Call</button>-->
<audio id="audio-remote" autoplay="autoplay" />

<audio id="local-media" autoplay="autoplay" />
<audio id="remote-media" autoplay="autoplay" />
</div>

<div id="content">
<div id="altFlash">
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</div>
</div>
<button id="enterFlash" type="button" class="visually-hidden" onclick="startFlashFocus();" value="Focus the client" >Focus the client</button>
<button id="enterFlash" type="button" class="visually-hidden" onclick="startFlashFocus();" value="Click to focus the client"/>
<div id="notifications" aria-live="polite" role="region" aria-label="Chat Notifications"></div>
</body>

<script type="text/javascript">
// Work around pixel alignment bug with Chrome 21 on Mac.
Expand All @@ -82,5 +97,82 @@
}
});
</script>
</body>
</html>

<script type="text/javascript">

var fsServer = null;

var callIntoConference = function(callback) {
if (!isWebrtcCapable()) {
callback("Browser version not supported");
return;
}

BBB.getMyUserInfo(function(userInfo) {
console.log("User info callback [myUserID=" + userInfo.myUserID
+ ",myUsername=" + userInfo.myUsername + ",myAvatarURL=" + userInfo.myAvatarURL
+ ",myRole=" + userInfo.myRole + ",amIPresenter=" + userInfo.amIPresenter
+ ",dialNumber=" + userInfo.dialNumber + ",voiceBridge=" + userInfo.voiceBridge + "].");
var callerIdName = userInfo.myUserID + "-bbbID-" + userInfo.myUsername;

// setup a timer to call the error callback
var checkSuccessCallback = function(e) {
if (e.userID == userInfo.myUserID) {
console.info("Received the event from Flash that I've joined the voice conference");
BBB.unlisten('UserJoinedVoiceEvent', checkSuccessCallback);
}
}

BBB.listen('UserJoinedVoiceEvent', checkSuccessCallback);

console.log(callerIdName);
webrtc_call(callerIdName, userInfo.voiceBridge, fsServer, callback);
});
}

var joinWebRTCVoiceConference = function(){
console.log("Joining to the voice conference");
var callback = function(err) {
if (err) {
console.info("Failed to call: " + err);
} else {
console.info("Success to call");
}
BBB.joinWebRTCVoiceConferenceCallback(err);
}

callIntoConference(callback);
}

var leaveWebRTCVoiceConference = function(){
console.log("Leaving the voice conference");
var callback = function(err) {
if (err) {
console.info("Failed to hang up: " + err);
} else {
console.info("Success to hang up");
}
BBB.leaveWebRTCVoiceConferenceCallback(err);
}

webrtc_hangup(callback);
}

var startWebrtcAudioTest = function(){
console.log("Testing webrtc audio");
webrtc_call("tester", "9196", fsServer, function(message){
console.log("You should hear yourself talking");
});
}

var stopWebrtcAudioTest = function(){
console.log("Stopping webrtc audio test");
webrtc_hangup(function(){
console.log("Webrtc audio test stopped");
});
}


</script>

18 changes: 18 additions & 0 deletions bigbluebutton-client/resources/prod/lib/bbb_api_bridge.js
Expand Up @@ -415,6 +415,24 @@
swfObj.deletePresentationRequest(presentationID);
}
}

/**
*
*/
BBB.joinWebRTCVoiceConferenceCallback = function(message) {
var swfObj = getSwfObj();
if (swfObj) {
swfObj.joinWebRTCVoiceConferenceCallback(message);
}
}

BBB.leaveWebRTCVoiceConferenceCallback = function(message) {
var swfObj = getSwfObj();
if (swfObj) {
swfObj.leaveWebRTCVoiceConferenceCallback(message);
}
}


// Third-party JS apps should use this to query if the BBB SWF file is ready to handle calls.
BBB.isSwfClientReady = function() {
Expand Down
117 changes: 117 additions & 0 deletions bigbluebutton-client/resources/prod/lib/bbb_webrtc_bridge_jssip.js
@@ -0,0 +1,117 @@


var bbbAudioConference;
var currentSession;

// Hang Up webrtc call
function webrtc_hangup(callback) {
console.log("Terminating current session");
currentSession.terminate(); // allows calling multiple times
callback();
}

// Call
function webrtc_call(username, voiceBridge, server, callback) {
var sayswho = navigator.sayswho,
browser = sayswho[0],
version = +(sayswho[1].split('.')[0]);


if currentSession currentSession.terminate();

console.log("Browser: " + browser + ", version: " + version);
if ( !( (browser == "Chrome" && version > 27) || (browser == "Firefox" && version > 26) ) ) {
callback("Browser version not supported");
return;
}

server = server || window.document.location.host;
console.log("user " + username + " calling to " + voiceBridge);

var configuration = {
uri: 'sip:' + username + '@' + server,
// password: freeswitchPassword,
// ws_servers: 'wss://' + server + ':7443',
ws_servers: 'ws://' + server + ':5066',
display_name: username,
// authorization_user: freeswitchUser,
register: false,
// register_expires: null,
// no_answer_timeout: null,
trace_sip: true,
stun_servers: "stun:74.125.134.127:19302",
// turn_servers: null,
// use_preloaded_route: null,
// connection_recovery_min_interval: null,
// connection_recovery_max_interval: null,
// hack_via_tcp: null,
// hack_ip_in_contact: null
};


bbbAudioConference = new JsSIP.UA(configuration);
bbbAudioConference.on('newRTCSession', function(e) {
console.log("New Webrtc session created!");
currentSession = e.data.session;
});
bbbAudioConference.start();
// Make an audio/video call:
// HTML5 <video> elements in which local and remote video will be shown
var selfView = document.getElementById('local-media');
var remoteView = document.getElementById('remote-media');



console.log("Registering callbacks to desired call events..");
var eventHandlers = {
'progress': function(e){
console.log('call is in progress');
},
'failed': function(e){
console.log('call failed with cause: '+ e.data.cause);
},
'ended': function(e){
console.log('call ended with cause: '+ e.data.cause);
},
'started': function(e){
var rtcSession = e.sender;

console.log('BigBlueButton call started');

// Attach local stream to selfView
if (rtcSession.getLocalStreams().length > 0) {
console.log("Got local stream");
}

// Attach remote stream to remoteView
if (rtcSession.getRemoteStreams().length > 0) {
console.log("Got remote stream");
remoteView.src = window.URL.createObjectURL(rtcSession.getRemoteStreams()[0]);
}

callback();
}
};

console.log("Setting options.. ");
var options = {
'eventHandlers': eventHandlers,
'mediaConstraints': {'audio': true, 'video': false}
};

console.log("Calling to " + voiceBridge + "....");
bbbAudioConference.call('sip:' + voiceBridge + '@' + server, options);


}

// http://stackoverflow.com/questions/5916900/detect-version-of-browser
navigator.sayswho= (function(){
var ua= navigator.userAgent,
N= navigator.appName,
tem,
M= ua.match(/(opera|chrome|safari|firefox|msie|trident)\/?\s*([\d\.]+)/i) || [];
M= M[2]? [M[1], M[2]]:[N, navigator.appVersion, '-?'];
if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
return M;
})();

0 comments on commit ea0c763

Please sign in to comment.