Small fixes in config.xml.template

This commit is contained in:
Jonata Teixeira Pastro 2014-05-28 20:54:39 +00:00
commit d8c431d056
5 changed files with 271 additions and 185 deletions

View File

@ -74,7 +74,11 @@
focusTalking = "false"
glowColor = "0x4A931D"
glowBlurSize = "30.0"
<<<<<<< HEAD
priorityRatio = "0.67"
=======
priorityRatio="0.67"
>>>>>>> feat1212
/>
<module name="WhiteboardModule" url="http://HOST/client/WhiteboardModule.swf?v=4105"

View File

@ -33,15 +33,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import mx.events.CloseEvent;
import mx.events.ItemClickEvent;
import mx.managers.PopUpManager;
import mx.core.UIComponent;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.model.VideoProfile;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
import org.bigbluebutton.util.i18n.ResourceUtil;
static public var PADDING_HORIZONTAL:Number = 6;
static public var PADDING_VERTICAL:Number = 29;
@ -58,22 +57,13 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
public var defaultCamera:String = null;
public var camerasArray:Object;
[Bindable] private var camerasAvaiable:ArrayList = new ArrayList();
private var _camera:Camera = null;
// Timer used to enable the start publishing button, only after get any activity on the camera.
// It avoids the problem of publishing a blank video
private var _activationTimer:Timer = null;
private var _waitingForActivation:Boolean = false;
static private var _cameraAccessDenied:Boolean = false;
private var _video:Video;
private var aspectRatio:Number = 1;
public const OFF_STATE:Number = 0;
public const ON_STATE:Number = 1;
[Bindable]private var baseIndex:int;
private var selectedCam:int;
private var aspectRatio:Number = 1;
override public function move(x:Number, y:Number):void
{
return;
@ -124,15 +114,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
updateCamera();
}
private function changeDefaultCamForMac():void {
for (var i:int = 0; i < Camera.names.length; i++){
if (Camera.names[i] == "USB Video Class Video") {
/** Set as default for Macs */
_camera = Camera.getCamera("USB Video Class Video");
}
}
}
private function showVideoControls(show:Boolean):void {
if (show) {
this.visible = true;
@ -145,77 +126,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
}
private function updateCamera():void {
_camera = null;
_camera = Camera.getCamera(camerasAvaiable.getItemAt(cmbCameraSelector.selectedIndex).index);
changeDefaultCamForMac();
if (_camera == null) {
_videoHolder.showWarning('bbb.video.publish.hint.cantOpenCamera');
return;
}
_camera.addEventListener(ActivityEvent.ACTIVITY, onActivityEvent);
_camera.addEventListener(StatusEvent.STATUS, onStatusEvent);
if (_camera.muted) {
if (_cameraAccessDenied) {
//onCameraAccessDisallowed();
//return;
Security.showSettings(SecurityPanel.PRIVACY)
} else {
_videoHolder.showWarning('bbb.video.publish.hint.waitingApproval');
}
} else {
// if the camera isn't muted, that is because the user has
// previously allowed the camera capture on the flash privacy box
onCameraAccessAllowed();
}
displayVideoPreview();
}
private function displayVideoPreview():void {
selectedVideoProfile = cmbVideoProfile.selectedItem.profile as VideoProfile;
trace("Using this video profile:: " + selectedVideoProfile.toString());
setAspectRatio(selectedVideoProfile.width, selectedVideoProfile.height);
var videoOptions:VideoConfOptions = new VideoConfOptions();
_camera.setMotionLevel(5, 1000);
_camera.setKeyFrameInterval(selectedVideoProfile.keyFrameInterval);
_camera.setMode(selectedVideoProfile.width, selectedVideoProfile.height, selectedVideoProfile.modeFps);
_camera.setQuality(selectedVideoProfile.qualityBandwidth, selectedVideoProfile.qualityPicture);
if (_camera.width != selectedVideoProfile.width || _camera.height != selectedVideoProfile.height) {
LogUtil.debug("Resolution " + selectedVideoProfile.width + "x" + selectedVideoProfile.height + " is not supported, using " + _camera.width + "x" + _camera.height + " instead");
setAspectRatio(_camera.width, _camera.height);
}
if (_video != null) {
_videoHolder.remove(_video);
}
_video = new Video();
_video.attachCamera(_camera);
//aspectRatio = (_video.width / _video.height);
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.add(_video);
}
private function showResControls(show:Boolean):void {
if (show) cmbVideoProfile.visible = true;
else cmbVideoProfile.visible = false;
@ -226,17 +136,21 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
this.minHeight = Math.floor((this.minWidth - PADDING_HORIZONTAL) / aspectRatio) + PADDING_VERTICAL;
}
private function updateCamera():void{
selectedVideoProfile = cmbVideoProfile.selectedItem.profile as VideoProfile;
selectedCam = camerasAvaiable.getItemAt(cmbCameraSelector.selectedIndex).index;
setAspectRatio(selectedVideoProfile.width,selectedVideoProfile.height);
_video.updateCamera(selectedCam,selectedVideoProfile,_canvas.width, _canvas.height,true);
}
private function startPublishing():void {
updateCamera();
// Save the index of the camera. Need it to send the message.
var camIndex:int = _camera.index;
disableCamera();
var globalDispatcher:Dispatcher = new Dispatcher();
var camEvent:BBBEvent = new BBBEvent(BBBEvent.CAMERA_SETTING);
camEvent.payload.cameraIndex = camIndex;
camEvent.payload.cameraIndex = selectedCam;
camEvent.payload.videoProfile = selectedVideoProfile;
camEvent.payload.publishInClient = publishInClient;
@ -250,14 +164,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function disableCamera():void {
_camera = null;
if(_video != null){
_video.attachCamera(null);
_video.clear();
_videoHolder.remove(_video);
_video = null;
}
}
if(_video){
_video.disableCamera();
}
}
private function handleKeyDown(event:KeyboardEvent):void {
if (event.charCode == Keyboard.ESCAPE) {
@ -274,48 +184,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
PopUpManager.removePopUp(this);
}
private function onActivityEvent(e:ActivityEvent):void {
if (_waitingForActivation && e.activating) {
_activationTimer.stop();
_videoHolder.showWarning('bbb.video.publish.hint.videoPreview', false, "0xFFFF00");
// controls.btnStartPublish.enabled = true;
_waitingForActivation = false;
}
}
private function onStatusEvent(e:StatusEvent):void {
if (e.code == "Camera.Unmuted") {
onCameraAccessAllowed();
// this is just to overwrite the message of waiting for approval
_videoHolder.showWarning('bbb.video.publish.hint.openingCamera');
} else {//if (e.code == "Camera.Muted") {
onCameraAccessDisallowed();
}
}
private function onCameraAccessAllowed():void {
_cameraAccessDenied = false;
// set timer to ensure that the camera activates. If not, it might be in use by another application
_waitingForActivation = true;
if (_activationTimer != null) {
_activationTimer.stop();
}
_activationTimer = new Timer(10000, 1);
_activationTimer.addEventListener(TimerEvent.TIMER, activationTimeout);
_activationTimer.start();
}
private function onCameraAccessDisallowed():void {
_videoHolder.showWarning('bbb.video.publish.hint.cameraDenied');
_cameraAccessDenied = true;
}
private function activationTimeout(e:TimerEvent):void {
_videoHolder.showWarning('bbb.video.publish.hint.cameraIsBeingUsed');
}
private function showCameraSettings():void {
Security.showSettings(SecurityPanel.CAMERA);
}
@ -332,7 +200,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:HRule width="100%"/>
<mx:Spacer height="1"/>
<view:VideoHolder id="_videoHolder" width="100%" height="75%" />
<mx:Canvas id="_canvas" width="100%" height="75%">
<view:VideoWithWarnings id="_video"/>
</mx:Canvas>
<mx:HBox width="100%" height="10%" horizontalAlign="center" horizontalGap="13" paddingRight="5">
<mx:ComboBox id="cmbCameraSelector" styleName="cameraDisplaySettingsWindowCameraSelector" dataProvider="{camerasAvaiable}" width="150" visible="true" labelField="label" change="updateCamera()" tabIndex="{baseIndex+1}" height="30"/>
@ -354,4 +224,4 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
accessibilityName="{ResourceUtil.getInstance().getString('bbb.video.publish.closeBtn.accessName')}"/>
</mx:HBox>
</mx:VBox>
</mx:TitleWindow>
</mx:TitleWindow>

View File

@ -0,0 +1,219 @@
package org.bigbluebutton.main.views
{
import com.asfusion.mate.events.Dispatcher;
import flash.events.StatusEvent;
import flash.events.TimerEvent;
import flash.events.ActivityEvent;
import flash.media.Camera;
import flash.media.Video
import flash.net.NetStream;
import flash.system.Security;
import flash.system.SecurityPanel;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.TextFieldAutoSize;
import flash.utils.Timer;
import mx.core.UIComponent;
import mx.containers.Canvas;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.model.VideoProfile;
import org.bigbluebutton.util.i18n.ResourceUtil;
public class VideoWithWarnings extends UIComponent{
private var hideWarningTimer:Timer = null;
private var _camera:Camera = null;
private var _activationTimer:Timer = null;
private var _waitingForActivation:Boolean = false;
private var _cameraAccessDenied:Boolean = false;
private var _video:Video=null;
private var label:TextField;
private var _videoProfile:VideoProfile;
private var _filters:Array=null;
private var _showPreviewMsg:Boolean=false;
public function VideoWithWarnings(){
super();
label = new TextField();
label.setTextFormat(new TextFormat());
label.selectable = false;
label.multiline = true;
label.wordWrap = true;
label.autoSize = TextFieldAutoSize.CENTER;
addChild(label);
}
public function cameraState():Boolean { return _camera != null;}
public function getCamera():Camera { return _camera;}
public function videoFilters(f:Array):void { _filters = f;}
private function attachCamera(c:Camera):void {_video.attachCamera(c);}
private function clear():void { _video.clear();}
private function hideWarning(e:TimerEvent):void { label.visible = false; }
private function showWarning(resourceName:String, autoHide:Boolean=false, color:int=0xFF0000):void {
const text:String = ResourceUtil.getInstance().getString(resourceName);
if (hideWarningTimer != null)
hideWarningTimer.stop();
if (autoHide) {
hideWarningTimer = new Timer(3000, 1);
hideWarningTimer.addEventListener(TimerEvent.TIMER, hideWarning);
hideWarningTimer.start();
}
// bring the label to front
label.text = text;
label.textColor=color;
label.visible = true;
resizeText();
LogUtil.debug("Showing warning: " + text);
}
public function updateCamera(camIndex:int, vp:VideoProfile, containerWidth:int, containerHeight:int, showPreviewMsg:Boolean=false):void {
disableCamera();
_camera = Camera.getCamera(camIndex.toString());
if (_camera == null) {
showWarning('bbb.video.publish.hint.cantOpenCamera');
return;
}
this.width = containerWidth;
this.height = containerHeight;
_videoProfile = vp;
_showPreviewMsg = showPreviewMsg;
_camera.addEventListener(ActivityEvent.ACTIVITY, onActivityEvent);
_camera.addEventListener(StatusEvent.STATUS, onStatusEvent);
if (_camera.muted)
if (_cameraAccessDenied)
Security.showSettings(SecurityPanel.PRIVACY)
else
showWarning('bbb.video.publish.hint.waitingApproval');
else
onCameraAccessAllowed();
displayVideoPreview();
}
private function displayVideoPreview():void {
trace("Using this video profile:: " + _videoProfile.toString());
_camera.setMotionLevel(5, 1000);
_camera.setKeyFrameInterval(_videoProfile.keyFrameInterval);
_camera.setMode(_videoProfile.width, _videoProfile.height, _videoProfile.modeFps);
_camera.setQuality(_videoProfile.qualityBandwidth, _videoProfile.qualityPicture);
if (_camera.width != _videoProfile.width || _camera.height != _videoProfile.height)
LogUtil.debug("Resolution " + _videoProfile.width + "x" + _videoProfile.height + " is not supported, using " + _camera.width + "x" + _camera.height + " instead");
addVideo();
attachCamera(_camera);
}
private function resizeText():void
{
label.width = this.width;
var lblFormat:TextFormat = label.getTextFormat();
lblFormat.size=17;
label.setTextFormat(lblFormat);
label.y=(int) (this.height - label.height);
label.x=(int) (this.width - label.textWidth)/2;
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
if(_video){
if(unscaledWidth/unscaledHeight > _videoProfile.width/_videoProfile.height){
_video.width = unscaledHeight / _videoProfile.height * _videoProfile.width;
_video.height = unscaledHeight;
} else {
_video.height = unscaledWidth * _videoProfile.height / _videoProfile.width;
_video.width = unscaledWidth;
}
_video.x = (int)((this.width - _video.width)/2);
_video.y = (int)((this.height - _video.height)/2);
resizeText();
}
}
private function addVideo():void{
_video = new Video();
if(_filters)
_video.filters=_filters;
_video.smoothing = true;
addChild(_video);
setChildIndex(_video, 0);
invalidateDisplayList();
}
public function attachNetStream(ns:NetStream, vp:VideoProfile, containerWidth:int, containerHeight:int):void {
disableCamera();
this.width = containerWidth;
this.height = containerHeight;
_videoProfile = vp;
addVideo();
_video.attachNetStream(ns);
}
public function disableCamera():void {
if(_video){
clear();
attachCamera(null);
removeChild(_video)
}
_video = null;
_camera = null;
}
private function onActivityEvent(e:ActivityEvent):void {
if (_waitingForActivation && e.activating) {
_activationTimer.stop();
if(_showPreviewMsg)
showWarning('bbb.video.publish.hint.videoPreview', false, 0xFFFF00);
else
label.visible = false;
_waitingForActivation = false;
}
}
private function onStatusEvent(e:StatusEvent):void {
if (e.code == "Camera.Unmuted") {
onCameraAccessAllowed();
// this is just to overwrite the message of waiting for approval
showWarning('bbb.video.publish.hint.openingCamera');
} else {
onCameraAccessDisallowed();
}
}
private function onCameraAccessAllowed():void {
_cameraAccessDenied = false;
// set timer to ensure that the camera activates. If not, it might be in use by another application
_waitingForActivation = true;
if (_activationTimer != null) {
_activationTimer.stop();
}
_activationTimer = new Timer(10000, 1);
_activationTimer.addEventListener(TimerEvent.TIMER, activationTimeout);
_activationTimer.start();
}
private function onCameraAccessDisallowed():void {
showWarning('bbb.video.publish.hint.cameraDenied');
_cameraAccessDenied = true;
}
private function activationTimeout(e:TimerEvent):void {
showWarning('bbb.video.publish.hint.cameraIsBeingUsed');
}
}
}

View File

@ -13,6 +13,7 @@ package org.bigbluebutton.modules.videoconf.views
import org.bigbluebutton.main.model.users.BBBUser;
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
import org.bigbluebutton.modules.videoconf.views.UserGraphicHolder;
import org.bigbluebutton.common.LogUtil;
public class GraphicsWrapper extends Canvas {
@ -223,7 +224,12 @@ package org.bigbluebutton.modules.videoconf.views
var graphic:UserGraphicHolder = new UserGraphicHolder();
graphic.userId = userId;
graphic.addEventListener(FlexEvent.CREATION_COMPLETE, function(event:FlexEvent):void {
<<<<<<< HEAD
graphic.loadVideo(_options, connection, streamName);
=======
graphic.loadVideo(_options, connection, streamName);
validateDisplayList();
>>>>>>> feat1212
});
graphic.addEventListener(MouseEvent.CLICK, onVBoxClick);
super.addChild(graphic);
@ -258,6 +264,7 @@ package org.bigbluebutton.modules.videoconf.views
graphic.userId = userId;
graphic.addEventListener(FlexEvent.CREATION_COMPLETE, function(event:FlexEvent):void {
graphic.loadCamera(_options, camIndex, videoProfile);
validateDisplayList();
});
graphic.addEventListener(MouseEvent.CLICK, onVBoxClick);
@ -294,6 +301,8 @@ package org.bigbluebutton.modules.videoconf.views
if (!alreadyPublishing) {
addCameraForHelper(userId, camIndex, videoProfile);
}
}
private function removeChildHelper(child:UserGraphicHolder):void {

View File

@ -6,6 +6,7 @@ package org.bigbluebutton.modules.videoconf.views
import flash.events.Event;
import flash.events.NetStatusEvent;
import flash.filters.ConvolutionFilter;
import flash.text.TextField;
import flash.media.Camera;
import flash.media.Video;
import flash.net.NetConnection;
@ -16,45 +17,36 @@ package org.bigbluebutton.modules.videoconf.views
import org.bigbluebutton.core.model.VideoProfile;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.StoppedViewingWebcamEvent;
import org.bigbluebutton.main.views.VideoWithWarnings;
import org.bigbluebutton.modules.videoconf.events.ClosePublishWindowEvent;
import org.bigbluebutton.modules.videoconf.events.StartBroadcastEvent;
import org.bigbluebutton.modules.videoconf.events.StopBroadcastEvent;
public class UserVideo extends UserGraphic {
protected var _camera:Camera;
protected var _camIndex:int = -1;
protected var _ns:NetStream;
protected var _shuttingDown:Boolean = false;
protected var _streamName:String;
protected var _video:Video = null;
protected var _video:VideoWithWarnings=null;
protected var _videoProfile:VideoProfile;
protected var _dispatcher:Dispatcher = new Dispatcher();
public function UserVideo() {
_video = new VideoWithWarnings();
_background.addChild(_video);
}
public function publish(camIndex:int, videoProfile:VideoProfile):void {
_videoProfile = videoProfile;
_camIndex = camIndex;
_videoProfile = videoProfile;
setOriginalDimensions(_videoProfile.width, _videoProfile.height);
_camera = Camera.getCamera(camIndex.toString());
_camera.setMotionLevel(5, 1000);
_camera.setKeyFrameInterval(videoProfile.keyFrameInterval);
_camera.setMode(videoProfile.width, videoProfile.height, videoProfile.modeFps);
_camera.setQuality(videoProfile.qualityBandwidth, videoProfile.qualityPicture);
setOriginalDimensions(_camera.width, _camera.height);
_video = new Video();
_video.attachCamera(_camera);
_video.smoothing = true;
addChild(_video);
_video.updateCamera(camIndex, _videoProfile, _background.width, _background.height);
invalidateDisplayList();
startPublishing();
}
@ -93,7 +85,7 @@ package org.bigbluebutton.modules.videoconf.views
var e:StartBroadcastEvent = new StartBroadcastEvent();
e.stream = _streamName;
e.camera = _camera;
e.camera = _video.getCamera();
e.videoProfile = _videoProfile;
_dispatcher.dispatchEvent(e);
}
@ -107,18 +99,12 @@ package org.bigbluebutton.modules.videoconf.views
_ns = null;
}
if (_camera) {
stopPublishing();
_camera = null;
if (_video) {
_video.attachCamera(null);
}
if (_video.cameraState()) {
stopPublishing();
}
if (_video) {
removeChild(_video);
_video.clear();
_video = null;
_video.disableCamera();
}
}
}
@ -158,9 +144,7 @@ package org.bigbluebutton.modules.videoconf.views
}
setOriginalDimensions(_videoProfile.width, _videoProfile.height);
_video = new Video(_videoProfile.width, _videoProfile.height);
_video.smoothing = true;
_video.attachNetStream(_ns);
_video.attachNetStream(_ns, _videoProfile, _background.width, _background.height);
if (options.applyConvolutionFilter) {
var filter:ConvolutionFilter = new ConvolutionFilter();
@ -170,13 +154,13 @@ package org.bigbluebutton.modules.videoconf.views
filter.matrix = options.convolutionFilter;
filter.bias = options.filterBias;
filter.divisor = options.filterDivisor;
_video.filters = [filter];
_video.videoFilters([filter]);
}
_ns.play(streamName);
addChild(_video);
user.addViewingStream(streamName);
invalidateDisplayList();
}
private function onNetStatus(e:NetStatusEvent):void{
@ -220,4 +204,4 @@ package org.bigbluebutton.modules.videoconf.views
return _streamName;
}
}
}
}