close button on the publish window now closes both remote and local windows
This commit is contained in:
Felipe Cecagno 2016-01-29 17:29:39 -02:00
parent c58767e74e
commit 7804e734e4
2 changed files with 10 additions and 10 deletions

View File

@ -107,7 +107,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
public function loadCamera(options:VideoConfOptions, camIndex:int, videoProfile:VideoProfile):void {
video.user = _user;
video.options = options;
video.publish(camIndex, videoProfile);
_streamName = UserVideo.newStreamName(_user.userID, videoProfile);
video.publish(camIndex, videoProfile, _streamName);
videoVisibility = true;
setUserProperties();

View File

@ -38,7 +38,7 @@ package org.bigbluebutton.modules.videoconf.views
_background.addChild(_video);
}
public function publish(camIndex:int, videoProfile:VideoProfile):void {
public function publish(camIndex:int, videoProfile:VideoProfile, streamName:String):void {
if (_shuttingDown) {
LOGGER.warn("Method publish called while shutting down the video window, ignoring...");
return;
@ -46,6 +46,7 @@ package org.bigbluebutton.modules.videoconf.views
_camIndex = camIndex;
_videoProfile = videoProfile;
_streamName = streamName;
setOriginalDimensions(_videoProfile.width, _videoProfile.height);
_video.updateCamera(camIndex, _videoProfile, _background.width, _background.height);
@ -54,27 +55,26 @@ package org.bigbluebutton.modules.videoconf.views
startPublishing();
}
private function newStreamName():String {
public static function newStreamName(userId:String, profile:VideoProfile):String {
/**
* Add timestamp to create a unique stream name. This way we can record
* stream without overwriting previously recorded streams.
*/
var d:Date = new Date();
var curTime:Number = d.getTime();
var uid:String = user.userID;
return _videoProfile.id + "-" + uid + "-" + curTime;
return profile.id + "-" + userId + "-" + curTime;
}
protected function getVideoProfile(stream:String):VideoProfile {
public static function getVideoProfile(stream:String):VideoProfile {
LOGGER.debug("Parsing stream name [{0}]", [stream]);
var pattern:RegExp = new RegExp("([A-Za-z0-9]+)-([A-Za-z0-9_]+)-\\d+", "");
if (pattern.test(stream)) {
LOGGER.debug("The stream name is well formatted");
LOGGER.debug("Video profile resolution is [{0}]", [pattern.exec(stream)[1]]);
LOGGER.debug("Userid [{0}]", [pattern.exec(stream)[2]]);
LOGGER.debug("Userid [{0}]", [pattern.exec(stream)[2]]);
return BBB.getVideoProfileById(pattern.exec(stream)[1]);
} else {
LOGGER.debug("Bad stream name format");
LOGGER.debug("Bad stream name format");
var profile:VideoProfile = BBB.defaultVideoProfile;
if (profile == null) {
profile = BBB.fallbackVideoProfile;
@ -84,7 +84,6 @@ package org.bigbluebutton.modules.videoconf.views
}
private function startPublishing():void {
_streamName = newStreamName();
_shuttingDown = false;
var e:StartBroadcastEvent = new StartBroadcastEvent();
@ -145,7 +144,7 @@ package org.bigbluebutton.modules.videoconf.views
_ns.receiveVideo(true);
_ns.receiveAudio(false);
_videoProfile = getVideoProfile(streamName);
_videoProfile = UserVideo.getVideoProfile(streamName);
LOGGER.debug("Remote video profile: {0}", [_videoProfile.toString()]);
if (_videoProfile == null) {
throw("Invalid video profile");