This commit is contained in:
Markos Calderon 2013-04-16 18:38:36 -05:00
commit 7100c53543
9 changed files with 397 additions and 126 deletions

View File

@ -297,7 +297,7 @@ public String getJoinURLwithDynamicConfigXML(String username, String meetingID,
}
String setConfigXML_parameters = "meetingID=" + urlEncode(meetingID) +
"&checksum=" + checksum(urlEncode(meetingID) + encodeURIComponent(xml_param) + salt) +"&configXML=" + urlEncode(encodeURIComponent(xml_param));
"&checksum=" + checksum(meetingID + encodeURIComponent(xml_param) + salt) +"&configXML=" + urlEncode(encodeURIComponent(xml_param));
url = "";
try {
@ -890,4 +890,24 @@ public String getBigBlueButtonIP()
}
}
public static Element getElementWithAttribute(Node root, String attrName, String attrValue)
{
NodeList nl = root.getChildNodes();
for (int i = 0; i < nl.getLength(); i++) {
Node n = nl.item(i);
if (n instanceof Element) {
Element el = (Element) n;
if (el.getAttribute(attrName).equals(attrValue)) {
return el;
}else{
el = getElementWithAttribute(n, attrName, attrValue); //search recursively
if(el != null){
return el;
}
}
}
}
return null;
}
%>

View File

@ -73,62 +73,70 @@ Author: Jesus Federico <jesus@123it.ca>
<fieldset>
<legend>Meeting Information</legend>
<ul>
<li>
<label for="confname">Meeting Name:</label>
<input id="confname" autofocus required name="confname" type="text" />
</li>
<li><h3>Demo meeting</h3></li>
<li>
<label for="username1">Your Name:</label>
<input id="username1" required name="username1" type="text" />
</li>
</ul>
</fieldset>
<fieldset>
<legend>Predefined layouts</legend>
<label for="label_Layout">Select layout:</label>
<select name="Layout">
<option value="Default" selected="selected">Default</option>
<option value="VideoChat">Video Chat</option>
<option value="Users">Users</option>
<option value="Meeting">Meeting</option>
<option value="Webinar">Webinar</option>
<option value="LectureAssistant">Lecture assistant</option>
<option value="Lecture">Lecture</option>
<option value="S2SPresentation">S2SPresentation</option>
<option value="S2SVideoChat">S2SVideoChat</option>
<option value="Notes">Notes</option>
<option value="Broadcast">Broadcast</option>
</select><br><br>
</fieldset>
<fieldset>
<legend>Modules to be included</legend>
<ul>
<li><input type="checkbox" name="ChatModule"
value="ChatModule">ChatModule<br></li>
<li><input type="checkbox" name="ViewersModule"
value="ViewersModule" disabled="disabled">ViewersModule<br></li>
<li><input type="checkbox" name="ListenersModule"
value="ListenersModule" disabled="disabled">ListenersModule<br></li>
<li><input type="hidden" name="UsersModule" value="UsersModule" />
<input type="checkbox" name="UsersModule"
value="UsersModule" checked="checked" disabled="disabled">UsersModule<br></li>
<li><input type="checkbox" name="DeskShareModule"
value="DeskShareModule">DeskShareModule<br></li>
<li><input type="hidden" name="PhoneModule" value="PhoneModule" />
<input type="checkbox" name="PhoneModule"
value="PhoneModule" checked="checked" disabled="disabled">PhoneModule<br></li>
<li><input type="checkbox" name="VideoconfModule"
value="VideoconfModule">VideoconfModule<br></li>
<li><input type="checkbox" name="WhiteboardModule"
value="WhiteboardModule">WhiteboardModule<br></li>
<li><input type="checkbox" name="PresentModule"
value="PresentModule">PresentModule<br></li>
<li><input type="checkbox" name="VideodockModule"
value="VideodockModule">VideodockModule<br></li>
<li><input type="hidden" name="LayoutModule" value="LayoutModule" />
<input type="checkbox" name="LayoutModule"
value="LayoutModule" checked="checked" disabled="disabled">LayoutModule<br></li>
</ul>
<legend>Options</legend>
<label for="skin">Skin:</label>
<select id="skin" name="Skin">
<option value="BBBDefault">Default</option>
<option value="BBBBlack">Black</option>
</select><br><br>
<label for="layout" >Layout:</label>
<select id="layout" name="Layout">
<option value="Default" selected="selected">Default</option>
<option value="VideoChat">Video Chat</option>
<option value="Meeting">Meeting</option>
<option value="LectureAssistant">Lecture assistant</option>
<!--
<option value="Users">Users</option>
<option value="Webinar">Webinar</option>
<option value="Lecture">Lecture</option>
<option value="S2SPresentation">S2SPresentation</option>
<option value="S2SVideoChat">S2SVideoChat</option>
<option value="Notes">Notes</option>
<option value="Broadcast">Broadcast</option>
-->
</select><br><br>
<label for="videomodule">Auto start webcam:</label>
<select id="videomodule" name="VideoModule">
<option value="false">No</option>
<option value="true">Yes</option>
<option value="disable">Disable</option>
</select><br><br>
<label for="autostartaudio">Auto start audio:</label>
<select id="autostartaudio" name="PhoneModule">
<option value="true">Yes</option>
<option value="false">No</option>
<option value="disable">Disable</option>
</select><br><br>
<label for="languagebutton">Show language button:</label>
<select id="languagebutton" name="LanguageButton">
<option value="true">Yes</option>
<option value="false">No</option>
</select><br><br>
<label for="helpbutton">Show help button:</label>
<select id="helpbutton" name="HelpButton">
<option value="true">Yes</option>
<option value="false">No</option>
</select><br><br>
<label for="helplurl">Help URL:</label>
<input type="text" id="helpurl" name="HelpUrl" value="http://<%= getBigBlueButtonIP() %>/help.html"/>
</fieldset>
<input type="submit" value="Create" >
@ -137,67 +145,75 @@ Author: Jesus Federico <jesus@123it.ca>
<%
} else if (request.getParameter("action").equals("create")) {
String confname = request.getParameter("confname");
String confname = "Demo Meeting";
String username = request.getParameter("username1");
String configXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<config>\n" +
" <localeversion suppressWarning=\"false\">0.8</localeversion>\n" +
" <version>C-4143-2013-04-02</version>\n" +
" <help url=\"http://%BBBIP%/help.html\"/>\n" +
" <porttest host=\"%BBBIP%\" application=\"video/portTest\" timeout=\"10000\"/>\n" +
" <bwMon server=\"HOST\" application=\"video/bwTest\"/>\n" +
" <application uri=\"rtmp://%BBBIP%/bigbluebutton\" host=\"http://%BBBIP%/bigbluebutton/api/enter\" />\n" +
" <language userSelectionEnabled=\"true\" />\n" +
" <skinning enabled=\"true\" url=\"http://%BBBIP%/client/branding/css/BBBDefault.css.swf\" />\n" +
" <shortcutKeys showButton=\"true\" />\n" +
" <layout showLogButton=\"false\" showVideoLayout=\"false\" showResetLayout=\"true\" defaultLayout=\"%DEFAULTLAYOUT%\" showToolbar=\"true\" showFooter=\"true\" showHelpButton=\"true\" showLogoutWindow=\"true\"/>\n" +
" <modules>\n" +
"%CHATMODULE%" + "%VIEWERSMODULE%" + "%LISTENERSMODULE%" + "%USERSMODULE%" + "%DESKSHAREMODULE%" + "%PHONEMODULE%" + "%VIDEOCONFMODULE%" + "%WHITEBOARDMODULE%" + "%PRESENTMODULE%" + "%VIDEODOCKMODULE%" + "%LAYOUTMODULE%\n" +
" </modules>\n" +
"</config>\n";
String chatModule = " <module name=\"ChatModule\" url=\"http://%BBBIP%/client/ChatModule.swf?v=4143\" uri=\"rtmp://%BBBIP%/bigbluebutton\" dependsOn=\"UsersModule\" translationOn=\"false\" translationEnabled=\"false\" privateEnabled=\"true\" position=\"top-right\" baseTabIndex=\"701\" />\n";
String viewersModule = " <module name=\"ViewersModule\" url=\"http://%BBBIP%/client/ViewersModule.swf?v=4143\" uri=\"rtmp://%BBBIP%/bigbluebutton\" host=\"http://%BBBIP%/bigbluebutton/api/enter\" allowKickUser=\"false\" baseTabIndex=\"201\" />\n";
String listenersModule = " <module name=\"ListenersModule\" url=\"http://%BBBIP%/client/ListenersModule.swf?v=4143\" uri=\"rtmp://%BBBIP%/bigbluebutton\" recordingHost=\"http://%BBBIP%\" position=\"bottom-left\" baseTabIndex=\"301\" />\n";
String usersModule = " <module name=\"UsersModule\" url=\"http://%BBBIP%/client/UsersModule.swf?v=4143\" uri=\"rtmp://%BBBIP%/bigbluebutton\" />\n";
String deskShareModule = " <module name=\"DeskShareModule\" url=\"http://%BBBIP%/client/DeskShareModule.swf?v=4105\" uri=\"rtmp://%BBBIP%/deskShare\" showButton=\"true\" autoStart=\"false\" baseTabIndex=\"101\" />\n";
String phoneModule = " <module name=\"PhoneModule\" url=\"http://%BBBIP%/client/PhoneModule.swf?v=4143\" uri=\"rtmp://%BBBIP%/sip\" autoJoin=\"true\" skipCheck=\"false\" showButton=\"true\" enabledEchoCancel=\"true\" dependsOn=\"UsersModule\" />\n";
String videoconfModule = " <module name=\"VideoconfModule\" url=\"http://%BBBIP%/client/VideoconfModule.swf?v=4143\" uri=\"rtmp://%BBBIP%/video\" dependson = \"UsersModule\" videoQuality = \"100\" presenterShareOnly = \"false\" controlsForPresenter = \"false\" resolutions = \"320x240,640x480,1280x720\" autoStart = \"false\" showButton = \"true\" showCloseButton = \"true\" publishWindowVisible = \"true\" viewerWindowMaxed = \"false\" viewerWindowLocation = \"top\" camKeyFrameInterval = \"30\" camModeFps = \"10\" camQualityBandwidth = \"0\" camQualityPicture = \"90\" smoothVideo=\"false\" applyConvolutionFilter=\"false\" convolutionFilter=\"-1, 0, -1, 0, 6, 0, -1, 0, -1\" filterBias=\"0\" filterDivisor=\"4\" enableH264 = \"true\" h264Level = \"2.1\" h264Profile = \"main\" displayAvatar = \"false\" focusTalking = \"false\" />\n";
String whiteboardModule = " <module name=\"WhiteboardModule\" url=\"http://%BBBIP%/client/WhiteboardModule.swf?v=4105\" uri=\"rtmp://%BBBIP%/bigbluebutton\" dependsOn=\"PresentModule\" baseTabIndex=\"601\" />\n";
String presentModule = " <module name=\"PresentModule\" url=\"http://%BBBIP%/client/PresentModule.swf?v=4143\" uri=\"rtmp://%BBBIP%/bigbluebutton\" host=\"http://%BBBIP%\" showPresentWindow=\"true\" showWindowControls=\"true\" dependsOn=\"UsersModule\" baseTabIndex=\"501\" maxFileSize=\"30\" />\n";
String videodockModule = " <module name=\"VideodockModule\" url=\"http://%BBBIP%/client/VideodockModule.swf?v=4143\" uri=\"rtmp://%BBBIP%/bigbluebutton\" dependsOn=\"VideoconfModule, UsersModule\" autoDock=\"true\" showControls=\"true\" maximizeWindow=\"false\" position=\"bottom-right\" width=\"172\" height=\"179\" layout=\"smart\" oneAlwaysBigger=\"false\" baseTabIndex=\"401\" />\n";
String layoutModule = " <module name=\"LayoutModule\" url=\"http://%BBBIP%/client/LayoutModule.swf?v=4143\" uri=\"rtmp://%BBBIP%/bigbluebutton\" layoutConfig=\"http://%BBBIP%/client/conf/layout.xml\" enableEdit=\"true\" />\n";
String param_ChatModule = request.getParameter("ChatModule");
String param_ViewersModule = request.getParameter("ViewersModule");
String param_ListenersModule = request.getParameter("ListenersModule");
String param_UsersModule = request.getParameter("UsersModule");
String param_DeskShareModule = request.getParameter("DeskShareModule");
String param_PhoneModule = request.getParameter("PhoneModule");
String param_VideoconfModule = request.getParameter("VideoconfModule");
String param_WhiteboardModule = request.getParameter("WhiteboardModule");
String param_PresentModule = request.getParameter("PresentModule");
String param_VideodockModule = request.getParameter("VideodockModule");
String param_LayoutModule = request.getParameter("LayoutModule");
String param_Layout = request.getParameter("Layout");
configXML = ( request.getParameter("Layout") != null )? configXML.replace("%DEFAULTLAYOUT%", param_Layout): configXML.replace("%DEFAULTLAYOUT%", "Default");
Document doc = null;
try {
doc = parseXml( getURL( "http://"+ getBigBlueButtonIP() + "/client/conf/config.xml" ));
} catch (Exception e) {
e.printStackTrace();
}
// Get request parameters to edit config.xml
String param_Skin = request.getParameter("Skin");
String param_Layout = request.getParameter("Layout");
String param_VideoModule = request.getParameter("VideoModule");
String param_PhoneModule = request.getParameter("PhoneModule");
String param_LanguageButton = request.getParameter("LanguageButton");
String param_HelpButton = request.getParameter("HelpButton");
String param_HelpUrl = request.getParameter("HelpUrl");
Node firstChild = doc.getFirstChild();
//Set skin
Element skinElement = (Element) doc.getElementsByTagName("skinning").item(0);
skinElement.setAttribute("url", "http://" + getBigBlueButtonIP() + "/client/branding/css/" + param_Skin + ".css.swf" );
//Set layout
Element layoutElement = (Element) doc.getElementsByTagName("layout").item(0);
layoutElement.setAttribute("defaultLayout", param_Layout );
//Set auto start webcam
Element webcamElement = getElementWithAttribute(firstChild, "name", "VideoconfModule");
if(param_VideoModule.equals("disable")){
webcamElement.getParentNode().removeChild(webcamElement);
Element videodockModule = getElementWithAttribute(firstChild, "name", "VideodockModule");
videodockModule.getParentNode().removeChild(videodockModule);
}else{
webcamElement.setAttribute("autoStart", param_VideoModule);
}
//Set auto join audio or disable it
Element audioElement = getElementWithAttribute(firstChild, "name", "PhoneModule");
if (param_PhoneModule.equals("disable")){
audioElement.getParentNode().removeChild(audioElement);
}else{
audioElement.setAttribute("autoJoin", param_PhoneModule);
}
//Set language button
Element languageElement = (Element) doc.getElementsByTagName("language").item(0);
languageElement.setAttribute("userSelectionEnabled", param_LanguageButton);
//Set help button. It is in the layout element
layoutElement.setAttribute("showHelpButton", param_HelpButton );
//Set help url
Element helpElement = (Element) doc.getElementsByTagName("help").item(0);
String helpUrl = helpElement.getAttribute("url");
//Create new config.xml
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
StringWriter writer = new StringWriter();
transformer.transform(new DOMSource(doc), new StreamResult(writer));
String configXML = writer.getBuffer().toString().replaceAll("\n|\r", "");
configXML = ( request.getParameter("ChatModule") != null )? configXML.replace("%CHATMODULE%", chatModule): configXML.replace("%CHATMODULE%", "");
configXML = ( request.getParameter("ViewersModule") != null )? configXML.replace("%VIEWERSMODULE%", viewersModule): configXML.replace("%VIEWERSMODULE%", "");
configXML = ( request.getParameter("ListenersModule") != null )? configXML.replace("%LISTENERSMODULE%", listenersModule): configXML.replace("%LISTENERSMODULE%", "");
configXML = ( request.getParameter("UsersModule") != null )? configXML.replace("%USERSMODULE%", usersModule): configXML.replace("%USERSMODULE%", "");
configXML = ( request.getParameter("DeskShareModule") != null )? configXML.replace("%DESKSHAREMODULE%", deskShareModule): configXML.replace("%DESKSHAREMODULE%", "");
configXML = ( request.getParameter("PhoneModule") != null )? configXML.replace("%PHONEMODULE%", phoneModule): configXML.replace("%PHONEMODULE%", "");
configXML = ( request.getParameter("VideoconfModule") != null )? configXML.replace("%VIDEOCONFMODULE%", videoconfModule): configXML.replace("%VIDEOCONFMODULE%", "");
configXML = ( request.getParameter("WhiteboardModule") != null )? configXML.replace("%WHITEBOARDMODULE%", whiteboardModule): configXML.replace("%WHITEBOARDMODULE%", "");
configXML = ( request.getParameter("PresentModule") != null )? configXML.replace("%PRESENTMODULE%", presentModule): configXML.replace("%PRESENTMODULE%", "");
configXML = ( request.getParameter("VideodockModule") != null )? configXML.replace("%VIDEODOCKMODULE%", videodockModule): configXML.replace("%VIDEODOCKMODULE%", "");
configXML = ( request.getParameter("LayoutModule") != null )? configXML.replace("%LAYOUTMODULE%", layoutModule): configXML.replace("%LAYOUTMODULE%", "");
configXML = configXML.replace("%BBBIP%", getBigBlueButtonIP());
//
// This is the URL for to join the meeting as moderator
//

View File

@ -29,6 +29,7 @@
<property name="DESKSHARE_SA" value="DeskshareStandalone" />
<property name="CAM_PREVIEW_SA" value="WebcamPreviewStandalone" />
<property name="MICROPHONE_CHECK" value="MicrophoneCheck" />
<property name="CAMERA_CHECK" value="CameraCheck" />
<property name="CAM_VIEW_SA" value="WebcamViewStandalone" />
<property name="PHONE" value="PhoneModule" />
<property name="NOTES" value="NotesModule" />
@ -233,7 +234,12 @@
<echo message="Compiling Microphone Check Application." />
<build-module-no-link src="${SRC_DIR}" target="${MICROPHONE_CHECK}" />
</target>
<target name="build-cam-check" description="Compile Camera Check Application">
<echo message="Compiling Camera Check Application." />
<build-module-no-link src="${SRC_DIR}" target="${CAMERA_CHECK}" />
</target>
<target name="build-deskshare" description="Compile Deskshare Module">
<build-module src="${SRC_DIR}" target="${DESKSHARE}" />
<echo message="Copying deskshare applet for Deskshare Module" />
@ -496,7 +502,7 @@
build-webcam-preview-standalone, build-webcam-view-standalone, compile-bbb"
description="Build BBB client skipping compiling of locales"/>
<target name="clean-build-all" depends="clean, init-ant-contrib, generate-html-wrapper, compile-deskshare-standalone, build-polling, build-mic-check,
build-webcam-preview-standalone, build-webcam-view-standalone, compile-bbb, branding, branding-black"
build-cam-check, build-webcam-preview-standalone, build-webcam-view-standalone, compile-bbb, branding, branding-black"
description="Build BBB client including locales"/>
<target name="modules" depends="init-ant-contrib, generate-html-wrapper, compile-deskshare-standalone,
build-webcam-preview-standalone, build-webcam-view-standalone, compile-bbb"

View File

@ -33,6 +33,9 @@
<button type="button" onclick="bbbGetJREs()">Get JREs</button>
<button type="button" onclick="testJava()">test Java</button>
<button type="button" onclick="bbbCheckShowMicSettings()">show mic settings</button>
<button type="button" onclick="bbbCheckStartTestMic()">Start Mic</button>
<button type="button" onclick="bbbCheckStopTestMic()">Stop Mic</button>
<button type="button" onclick="bbbCheckShowCamSettings()">show cam settings</button>
</div>
<div id="webcamview" style="background-color:#FFD700;height:215px;width:138px;float:left;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540002" width="215" height="138" id="MicrophoneCheck" name="MicrophoneCheck" align="middle">

View File

@ -43,6 +43,13 @@
BBBCheck.runApplet = function(attributes, parameters, minimumVersion) {
deployJava.runApplet(attributes, parameters, minimumVersion);
}
BBBCheck.showCamSettings = function() {
var swfObj = getSwfObj();
if (swfObj) {
swfObj.showCamSettings();
}
}
BBBCheck.showMicSettings = function() {
var swfObj = getSwfObj();
@ -50,6 +57,20 @@
swfObj.showMicSettings();
}
}
BBBCheck.startTestMicrophone = function() {
var swfObj = getSwfObj();
if (swfObj) {
swfObj.startTestMicrophone();
}
}
BBBCheck.stopTestMicrophone = function() {
var swfObj = getSwfObj();
if (swfObj) {
swfObj.stopTestMicrophone();
}
}
BBBCheck.microphoneCheckAppReady = function() {
console.log("microphone check app ready.");

View File

@ -28,4 +28,16 @@ var bbbGetJREs = function() {
var bbbCheckShowMicSettings = function() {
BBBCheck.showMicSettings();
}
}
var bbbCheckStartTestMic = function() {
BBBCheck.startTestMicrophone();
}
var bbbCheckStopTestMic = function() {
BBBCheck.stopTestMicrophone();
}
var bbbCheckShowCamSettings = function() {
BBBCheck.showCamSettings();
}

View File

@ -0,0 +1,176 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
This program is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 3.0 of the License, or (at your option) any later
version.
BigBlueButton 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="onCreationComplete()"
pageTitle="WebcamPreview" width="600" height="400" layout="absolute">
<mx:Script>
<![CDATA[
import mx.core.UIComponent;
import mx.utils.URLUtil;
[Bindable] private var defaultWidth:Number = 320;
[Bindable] private var defaultHeight:Number = 240;
private var _video:Video;
private var _videoHolder:UIComponent;
private var camIndex:int = 0;
private var camWidth:Number = 320;
private var camHeight:Number = 240;
private var _camera:Camera = null;
private var quality:Number = 0;
private var PADDING_HORIZONTAL:Number = 6;
private var PADDING_VERTICAL:Number = 29;
private var _minWidth:int = 160 + PADDING_HORIZONTAL;
private var _minHeight:int = 120 + PADDING_VERTICAL;
private var aspectRatio:Number = 1;
private function onCreationComplete():void{
_videoHolder = new UIComponent();
_videoHolder.width = camWidth;
_videoHolder.height = camHeight;
this.addChild(_videoHolder);
this.minWidth = _minWidth;
this.minHeight = _minHeight;
trace('WebcamPreviewSA::onCreationComplete');
Security.allowDomain(determineHTMLURL());
trace("WebcamPreviewSA:: Security.allowDomain(" + determineHTMLURL() + ");");
initExternalInterface();
callWebcamPreviewStandaloneReady();
}
private function determineHTMLURL():String {
var serverName:String = "*";
if(ExternalInterface.available) {
try {
var htmlURL:String = String(ExternalInterface.call("window.location.href.toString"));
serverName = URLUtil.getServerName(htmlURL);
trace("WebcamPreviewSA::determineHTMLURL HTML URL [" + htmlURL + "]");
} catch(s:Error) {
trace("WebcamPreviewSA::determineHTMLURL Cannot determine HTML URL");
}
}
return serverName;
}
private function initExternalInterface():void {
trace('WebcamPreviewSA::initExternalInterface');
if (ExternalInterface.available) {
ExternalInterface.addCallback("startPreviewCamera", handleStartPreviewCameraRequest);
ExternalInterface.addCallback("stopPreviewCamera", handleStopPreviewCamera);
}
}
private function callWebcamPreviewStandaloneReady():void {
if (ExternalInterface.available) {
ExternalInterface.call("webcamPreviewStandaloneAppReady");
}
}
private function handleStartPreviewCameraRequest(camIndex:String, camWidth:int, camHeight:int,
camKeyFrameInterval:int, camModeFps:Number,
camQualityBandwidth:int, camQualityPicture:int):void {
displayCamera(camIndex, camWidth, camHeight, camKeyFrameInterval, camModeFps, camQualityBandwidth, camQualityPicture);
}
private function handleStopPreviewCamera():void {
stopCamera();
}
public function displayCamera(camIndex:String, camWidth:int, camHeight:int, camKeyFrameInterval:int,
camModeFps:Number, camQualityBandwidth:int,
camQualityPicture:int):void {
trace('WebcamPreviewSA::displayCamera');
stopCamera();
if (Camera.names.length == 0) {
trace('WebcamPreviewSA::bbb.video.publish.hint.noCamera');
return;
}
_camera = Camera.getCamera(camIndex);
if (_camera == null) {
trace('WebcamPreviewSA::bbb.video.publish.hint.cantOpenCamera');
return;
}
setResolution(camWidth, camHeight);
_camera.setMotionLevel(5, 1000);
_camera.setKeyFrameInterval(camKeyFrameInterval);
_camera.setMode(camWidth, camHeight, camModeFps);
_camera.setQuality(camQualityBandwidth, camQualityPicture);
if (_camera.width != camWidth || _camera.height != camHeight) {
trace("WebcamPreviewSA::Resolution " + camWidth + "x" + camHeight + " is not supported, using " + _camera.width + "x" + _camera.height + " instead");
setResolution(_camera.width, _camera.height);
}
_video = new Video;
_video.attachCamera(_camera);
if (aspectRatio > _videoHolder.width / _videoHolder.height) {
_video.width = _videoHolder.width;
_video.height = _videoHolder.width / aspectRatio;
_video.x = 0;
_video.y = (_videoHolder.height - _video.height) / 2;
} else {
_video.width = _videoHolder.height * aspectRatio;
_video.height = _videoHolder.height;
_video.x = (_videoHolder.width - _video.width) / 2;
_video.y = 0;
}
_videoHolder.addChild(_video);
}
private function stopCamera():void {
_camera = null;
if (_video != null) {
_videoHolder.removeChild(_video);
_video.attachCamera(null);
_video.clear();
_video = null;
}
}
private function setResolution(width:int, height:int):void {
camWidth = width;
camHeight = height;
setAspectRatio(camWidth, camHeight);
}
private function setAspectRatio(width:int, height:int):void {
aspectRatio = (width/height);
this.minHeight = Math.floor((this.minWidth - PADDING_HORIZONTAL) / aspectRatio) + PADDING_VERTICAL;
}
]]>
</mx:Script>
</mx:Application>

View File

@ -7,7 +7,11 @@
private function appInit():void {
if (ExternalInterface.available) {
ExternalInterface.addCallback("showMicSettings", handleShowMicSettingsRequest);
ExternalInterface.addCallback("testMicrophone", handleShowMicSettingsRequest);
ExternalInterface.addCallback("startTestMicrophone", handleStartTestMicrophoneRequest);
ExternalInterface.addCallback("stopTestMicrophone", handleStopTestMicrophoneRequest);
ExternalInterface.addCallback("showCamSettings", handleShowCamSettingsRequest);
}
// Tell out JS counterpart that we are ready.
@ -28,8 +32,7 @@
Security.showSettings(SecurityPanel.PRIVACY);
} else {
// user has allowed access to the mic
mic.setLoopBack(false);
mic.setUseEchoSuppression(true);
handleStartTestMicrophoneRequest();
}
} else {
ExternalInterface.call("BBBCheck.noAvailableMicrophoneError");
@ -43,23 +46,37 @@
break;
case "Microphone.Unmuted":
ExternalInterface.call("BBBCheck.microphoneAccessAllowed");
handleStartTestMicrophoneRequest();
break;
case "Camera.Unmuted":
ExternalInterface.call("BBBCheck.camAccessDenied");
// handleStartTestCameraRequest();
break;
case "Camera.Muted":
ExternalInterface.call("BBBCheck.camAccessAllowed");
// handleStartTestMicrophoneRequest();
break;
}
}
private function handleTestMicrophoneRequest(loopback:Boolean=false):void {
if (loopback) {
private function handleStartTestMicrophoneRequest():void {
if (mic != null) {
mic.setLoopBack(true);
mic.setUseEchoSuppression(true);
}
Security.showSettings(SecurityPanel.MICROPHONE);
} else {
mic.setLoopBack(false);
}
Security.showSettings(SecurityPanel.MICROPHONE);
}
}
private function handleStopTestMicrophoneRequest():void {
if (mic != null) {
mic.setLoopBack(false);
}
}
private function handleShowCamSettingsRequest():void {
Security.showSettings(SecurityPanel.CAMERA);
}
]]>
</mx:Script>
</mx:Application>

View File

@ -118,9 +118,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
muteUnmuteBtn.visible = switchPresenter.visible = ejectUserBtn.visible = false;
}
if(UsersUtil.isMe(sharerUserID)){
ejectUserBtn.visible = false;
}
if(UsersUtil.isMe(sharerUserID)){
ejectUserBtn.visible = false;
}
muteUnmuteBtn.toolTip = ResourceUtil.getInstance().getString('bbb.video.controls.muteButton.toolTip', [UsersUtil.getUserName(sharerUserID)]);
switchPresenter.toolTip = ResourceUtil.getInstance().getString('bbb.video.controls.switchPresenter.toolTip', [UsersUtil.getUserName(sharerUserID)]);