- start add cam check

This commit is contained in:
Richard Alam 2013-04-16 21:17:00 +00:00
parent 7ca3a26c54
commit dc69530bf0
7 changed files with 253 additions and 18 deletions

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)]);