Merge branch 'switch-to-sipjs' of https://github.com/SenecaCDOT-BigBlueButton/bigbluebutton into switch-to-sipjs

This commit is contained in:
Richard Alam 2014-08-09 12:24:35 -07:00
commit 1994eece36
4 changed files with 103 additions and 46 deletions

View File

@ -44,7 +44,7 @@
<script src="lib/bbb_deskshare.js" language="javascript"></script>
<script src="lib/bbb_api_bridge.js" language="javascript"></script>
<script src="lib/sip-0.6.1.js" language="javascript"></script>
<script src="lib/bbb_webrtc_bridge_jssip.js" language="javascript"></script>
<script src="lib/bbb_webrtc_bridge_sip.js" language="javascript"></script>
<script>
window.chatLinkClicked = function(url) {
window.open(url, '_blank');

View File

@ -55,11 +55,8 @@ function joinWebRTCVoiceConference() {
function leaveWebRTCVoiceConference() {
console.log("Leaving the voice conference");
var callback = function(request) {
BBB.leaveWebRTCVoiceConferenceCallback();
}
webrtc_hangup(callback);
webrtc_hangup();
}
function startWebRTCAudioTest(){
@ -95,17 +92,13 @@ function startWebRTCAudioTest(){
function stopWebRTCAudioTest(){
console.log("Stopping webrtc audio test");
var callback = function(request) {
BBB.leaveWebRTCVoiceConferenceCallback();
}
webrtc_hangup(callback);
webrtc_hangup();
}
function stopWebRTCAudioTestJoinConference(){
console.log("Stopping webrtc audio test and joining conference afterwards");
var callback = function(request) {
BBB.leaveWebRTCVoiceConferenceCallback();
joinWebRTCVoiceConference();
}
@ -154,8 +147,7 @@ function webrtc_call(username, voiceBridge, callback) {
return;
}
// CHANGE THIS BACK BEFORE MERGING
var server = "dev.bigbluebutton.org"; // window.document.location.host;
var server = window.document.location.host;
console.log("user " + username + " calling to " + voiceBridge);
if (!userAgent) {
@ -196,22 +188,25 @@ function make_call(username, voiceBridge, server, callback) {
console.log("Calling to " + voiceBridge + "....");
currentSession = userAgent.invite('sip:' + voiceBridge + '@' + server, options);
console.log('call connecting');
callback({'status':'connecting'});
// The connecting event fires before the listener can be added
currentSession.on('connecting', function(){
//console.log('call connecting');
//callback({'status':'connecting'});
});
currentSession.on('failed', function(response, cause){
console.log('call failed with cause: '+ cause);
callback({'status':'failed', 'cause': cause});
});
currentSession.on('bye', function(request){
console.log('call ended ' + newSession.endTime);
console.log('call ended ' + currentSession.endTime);
callback({'status':'ended'});
});
currentSession.on('accepted', function(data){
console.log('BigBlueButton call started');
callback({'status':'started'});
});
currentSession.on('connecting', function(){
console.log('call connecting');
callback({'status':'connecting'});
});
}
function webrtc_hangup(callback) {

View File

@ -390,7 +390,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function handleWebRTCMediaRequestEvent(event:WebRTCMediaEvent):void {
var browser:String = "Firefox";//event.browser;
var browser:String = ExternalInterface.call("determineBrowser")[0];
if (browser == "Firefox") {
var ffBrowser:FirefoxMicPermissionImage = PopUpManager.createPopUp(mdiCanvas, FirefoxMicPermissionImage, true) as FirefoxMicPermissionImage;
ffBrowser.addEventListener(FlexEvent.CREATION_COMPLETE, function(e:Event):void {

View File

@ -19,6 +19,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
-->
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:mate="http://mate.asfusion.com/"
width="600" height="350"
creationComplete="onCreationComplete()"
styleName="micSettingsWindowStyle"
@ -26,6 +27,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
close="onCancelClicked()"
keyDown="handleKeyDown(event)">
<mate:Listener type="{WebRTCEchoTestEvent.WEBRTC_ECHO_TEST_STARTED}" method="handleWebRTCEchoTestStartedEvent" />
<mate:Listener type="{WebRTCEchoTestEvent.WEBRTC_ECHO_TEST_ENDED}" method="handleWebRTCEchoTestEndedEvent" />
<mate:Listener type="{WebRTCCallEvent.WEBRTC_CALL_CONNECTING}" method="handleWebRTCCallConnectingEvent" />
<mate:Listener type="{WebRTCCallEvent.WEBRTC_CALL_STARTED}" method="handleWebRTCCallStartedEvent" />
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
@ -36,6 +42,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.api.JSAPI;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.modules.phone.PhoneOptions;
import org.bigbluebutton.modules.phone.events.WebRTCCallEvent;
import org.bigbluebutton.modules.phone.events.WebRTCEchoTestEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
@ -56,14 +63,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function onCreationComplete():void {
setCurrentState("connectingecho");
}
private function yesButtonClicked():void {
trace(LOG + "Echo test passed.");
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(new WebRTCEchoTestEvent(WebRTCEchoTestEvent.WEBRTC_ECHO_TEST_HAS_AUDIO));
onCancelClicked();
setCurrentState("endingecho");
}
private function noButtonClicked():void {
@ -73,6 +80,22 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
onCancelClicked();
}
private function handleWebRTCEchoTestStartedEvent(e:WebRTCEchoTestEvent):void {
setCurrentState("started");
}
private function handleWebRTCEchoTestEndedEvent(e:WebRTCEchoTestEvent):void {
setCurrentState("ended");
}
private function handleWebRTCCallConnectingEvent(e:WebRTCCallEvent):void {
setCurrentState("connectingcall");
}
private function handleWebRTCCallStartedEvent(e:WebRTCCallEvent):void {
onCancelClicked();
}
private function onHelpButtonClicked():void {
}
@ -82,7 +105,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
</mx:Script>
<mx:VBox width="100%" height="100%" paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="5">
<mx:Canvas width="100%">
<mx:Canvas id="cnvTitle" width="100%">
<mx:TextArea borderSkin="{null}"
editable="false"
text="Audio Echo Test"
@ -97,30 +120,69 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
click="onHelpButtonClicked()"
accessibilityName="{ResourceUtil.getInstance().getString('bbb.micSettings.access.helpButton')}"/>
</mx:Canvas>
<mx:HBox width="100%">
<mx:Text width="100%" text="{ResourceUtil.getInstance().getString('bbb.micSettings.recommendHeadset')}"
styleName="micSettingsWindowSpeakIntoMicLabelStyle" />
<mx:Image source="@Embed('assets/headset-earbuds.png')"/>
</mx:HBox>
<mx:HBox width="100%">
<mx:Text width="100%" text="{ResourceUtil.getInstance().getString('bbb.micSettings.speakIntoMic')}"
styleName="micSettingsWindowSpeakIntoMicLabelStyle" />
</mx:HBox>
<mx:HRule width="100%"/>
<mx:Spacer height="10"/>
<mx:HBox width="100%" horizontalAlign="right" horizontalGap="18">
<mx:Text width="100%" text="{ResourceUtil.getInstance().getString('bbb.micSettings.echoTestMicPrompt')}"
styleName="micSettingsWindowSpeakIntoMicLabelStyle" />
<mx:Button id="yesButton" label="{ResourceUtil.getInstance().getString('bbb.micSettings.echoTestAudioYes')}"
click="yesButtonClicked()" styleName="micSettingsWindowPlaySoundButtonStyle"
toolTip=""/>
<mx:Button id="noButton"
label="{ResourceUtil.getInstance().getString('bbb.micSettings.echoTestAudioNo')}"
styleName="micSettingsWindowPlaySoundButtonStyle"
click="noButtonClicked()"
toolTip=""/>
</mx:HBox>
</mx:VBox>
</mx:VBox>
<mx:states>
<mx:State name="connectingecho">
<mx:AddChild relativeTo="cnvTitle" position="after">
<mx:HBox width="100%" height="100%" verticalAlign="middle" horizontalAlign="center">
<mx:Label styleName="micSettingsWindowSpeakIntoMicLabelStyle" text="Connecting to echo test ..." />
</mx:HBox>
</mx:AddChild>
</mx:State>
<mx:State name="endingecho">
<mx:AddChild relativeTo="cnvTitle" position="after">
<mx:HBox width="100%" height="100%" verticalAlign="middle" horizontalAlign="center">
<mx:Label styleName="micSettingsWindowSpeakIntoMicLabelStyle" text="Ending echo test ..." />
</mx:HBox>
</mx:AddChild>
</mx:State>
<mx:State name="ended">
<mx:AddChild relativeTo="cnvTitle" position="after">
<mx:HBox width="100%" height="100%" verticalAlign="middle" horizontalAlign="center">
<mx:Label styleName="micSettingsWindowSpeakIntoMicLabelStyle" text="Echo test ended." />
</mx:HBox>
</mx:AddChild>
</mx:State>
<mx:State name="connectingcall">
<mx:AddChild relativeTo="cnvTitle" position="after">
<mx:HBox width="100%" height="100%" verticalAlign="middle" horizontalAlign="center">
<mx:Label styleName="micSettingsWindowSpeakIntoMicLabelStyle" text="Connecting to conference ..." />
</mx:HBox>
</mx:AddChild>
</mx:State>
<mx:State name="started">
<mx:AddChild relativeTo="cnvTitle" position="after">
<mx:VBox width="100%">
<mx:HBox width="100%">
<mx:Text width="100%" text="{ResourceUtil.getInstance().getString('bbb.micSettings.recommendHeadset')}"
styleName="micSettingsWindowSpeakIntoMicLabelStyle" />
<mx:Image source="@Embed('assets/headset-earbuds.png')"/>
</mx:HBox>
<mx:HBox width="100%">
<mx:Text width="100%" text="{ResourceUtil.getInstance().getString('bbb.micSettings.speakIntoMic')}"
styleName="micSettingsWindowSpeakIntoMicLabelStyle" />
</mx:HBox>
<mx:HRule width="100%"/>
<mx:Spacer height="10"/>
<mx:HBox width="100%" horizontalAlign="right" horizontalGap="18">
<mx:Text width="100%" text="{ResourceUtil.getInstance().getString('bbb.micSettings.echoTestMicPrompt')}"
styleName="micSettingsWindowSpeakIntoMicLabelStyle" />
<mx:Button id="yesButton" label="{ResourceUtil.getInstance().getString('bbb.micSettings.echoTestAudioYes')}"
click="yesButtonClicked()" styleName="micSettingsWindowPlaySoundButtonStyle"
toolTip=""/>
<mx:Button id="noButton"
label="{ResourceUtil.getInstance().getString('bbb.micSettings.echoTestAudioNo')}"
styleName="micSettingsWindowPlaySoundButtonStyle"
click="noButtonClicked()"
toolTip=""/>
</mx:HBox>
</mx:VBox>
</mx:AddChild>
</mx:State>
</mx:states>
</mx:TitleWindow>