Updates use of recording states, add some information texts and notifications.

This commit is contained in:
damencho 2015-08-05 22:18:45 -05:00
parent 2ea6be9b2c
commit 4092d67853
8 changed files with 19894 additions and 19732 deletions

View File

@ -446,6 +446,11 @@
background-position: center;
}
.videoMessageFilter {
-webkit-filter: grayscale(.5) opacity(0.8);
filter: grayscale(.5) opacity(0.8);
}
.videoProblemFilter {
-webkit-filter: blur(10px) grayscale(.5) opacity(0.8);
filter: blur(10px) grayscale(.5) opacity(0.8);

View File

@ -22,7 +22,7 @@
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
<script src="interface_config.js?v=5"></script>
<script src="libs/app.bundle.js?v=119"></script>
<script src="libs/app.bundle.js?v=120"></script>
<script src="analytics.js?v=1"></script><!-- google analytics plugin -->
<link rel="stylesheet" href="css/font.css?v=7"/>
<link rel="stylesheet" href="css/toastr.css?v=1">

View File

@ -240,5 +240,11 @@
"FETCH_SESSION_ID": "Obtaining session-id...",
"GOT_SESSION_ID": "Obtaining session-id... Done",
"GET_SESSION_ID_ERROR": "Get session-id error: "
},
"recording":
{
"toaster": "Currently recording!",
"pending": "Your recording will start as soon as another participant joins",
"on": "Recording has been started"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,7 @@ var AuthenticationEvents
var roomUrl = null;
var sharedKey = '';
var UI = null;
var recordingToaster = null;
var buttonHandlers = {
"toolbar_button_mute": function () {
@ -147,7 +148,7 @@ function toggleRecording() {
function () { },
':input:first'
);
}, Toolbar.setRecordingButtonState, Toolbar.setRecordingButtonState);
}, Toolbar.setRecordingButtonState);
}
/**
@ -548,14 +549,44 @@ var Toolbar = (function (my) {
};
// Sets the state of the recording button
my.setRecordingButtonState = function (isRecording) {
my.setRecordingButtonState = function (recordingState) {
var selector = $('#recordButton');
if (isRecording) {
if (recordingState === 'on') {
selector.removeClass("icon-recEnable");
selector.addClass("icon-recEnable active");
} else {
$("#largeVideo").toggleClass("videoMessageFilter", true);
var recordOnKey = "recording.on";
$('#videoConnectionMessage').attr("data-i18n", recordOnKey);
$('#videoConnectionMessage').text(APP.translation.translateString(recordOnKey));
setTimeout(function(){
$("#largeVideo").toggleClass("videoMessageFilter", false);
$('#videoConnectionMessage').css({display: "none"});
}, 1500);
recordingToaster = messageHandler.notify(null, "recording.toaster", null,
null, null, {timeOut: 0, closeButton: null});
} else if (recordingState === 'off') {
selector.removeClass("icon-recEnable active");
selector.addClass("icon-recEnable");
$("#largeVideo").toggleClass("videoMessageFilter", false);
$('#videoConnectionMessage').css({display: "none"});
if (recordingToaster)
messageHandler.remove(recordingToaster);
} else if (recordingState === 'pending') {
selector.removeClass("icon-recEnable active");
selector.addClass("icon-recEnable");
$("#largeVideo").toggleClass("videoMessageFilter", true);
var recordPendingKey = "recording.pending";
$('#videoConnectionMessage').attr("data-i18n", recordPendingKey);
$('#videoConnectionMessage').text(APP.translation.translateString(recordPendingKey));
$('#videoConnectionMessage').css({display: "block"});
}
};

View File

@ -182,7 +182,7 @@ var messageHandler = (function(my) {
"'>" + APP.translation.translateString(displayNameKey);
}
displayNameSpan += "</span>";
toastr.info(
return toastr.info(
displayNameSpan + '<br>' +
'<span class=' + cls + ' data-i18n="' + messageKey + '"' +
(messageArguments?
@ -193,6 +193,14 @@ var messageHandler = (function(my) {
'</span>', null, options);
};
/**
* Removes the toaster.
* @param toasterElement
*/
my.remove = function(toasterElement) {
toasterElement.remove();
};
return my;
}(messageHandler || {}));

View File

@ -19,6 +19,12 @@ var useJirecon = (typeof config.hosts.jirecon != "undefined");
*/
var jireconRid = null;
/**
* The callback to update the recording button. Currently used from colibri
* after receiving a pending status.
*/
var recordingStateChangeCallback = null;
function setRecordingToken(token) {
recordingToken = token;
}
@ -30,9 +36,9 @@ function setRecordingJirecon(state, token, callback, connection) {
var iq = $iq({to: config.hosts.jirecon, type: 'set'})
.c('recording', {xmlns: 'http://jitsi.org/protocol/jirecon',
action: state ? 'start' : 'stop',
action: (state === 'on') ? 'start' : 'stop',
mucjid: connection.emuc.roomjid});
if (!state){
if (state === 'off'){
iq.attrs({rid: jireconRid});
}
@ -44,10 +50,10 @@ function setRecordingJirecon(state, token, callback, connection) {
// TODO wait for an IQ with the real status, since this is
// provisional?
jireconRid = $(result).find('recording').attr('rid');
console.log('Recording ' + (state ? 'started' : 'stopped') +
console.log('Recording ' + ((state === 'on') ? 'started' : 'stopped') +
'(jirecon)' + result);
recordingEnabled = state;
if (!state){
if (state === 'off'){
jireconRid = null;
}
@ -73,10 +79,19 @@ function setRecordingColibri(state, token, callback, connection) {
function (result) {
console.log('Set recording "', state, '". Result:', result);
var recordingElem = $(result).find('>conference>recording');
var newState = ('true' === recordingElem.attr('state'));
var newState = recordingElem.attr('state');
recordingEnabled = newState;
callback(newState);
if (newState === 'pending' && recordingStateChangeCallback == null) {
recordingStateChangeCallback = callback;
connection.addHandler(function(iq){
var state = $(iq).find('recording').attr('state');
if (state)
recordingStateChangeCallback(state);
}, 'http://jitsi.org/protocol/colibri', 'iq', null, null, null);
}
},
function (error) {
console.warn(error);
@ -94,8 +109,7 @@ function setRecording(state, token, callback, connection) {
}
var Recording = {
toggleRecording: function (tokenEmptyCallback,
startingCallback, startedCallback, connection) {
toggleRecording: function (tokenEmptyCallback, recordingStateChangeCallback, connection) {
if (!Moderator.isModerator()) {
console.log(
'non-focus, or conference not yet organized:' +
@ -108,16 +122,16 @@ var Recording = {
if (!recordingToken && !useJirecon) {
tokenEmptyCallback(function (value) {
setRecordingToken(value);
self.toggleRecording(tokenEmptyCallback,
startingCallback, startedCallback, connection);
self.toggleRecording(tokenEmptyCallback, recordingStateChangeCallback, connection);
});
return;
}
var oldState = recordingEnabled;
startingCallback(!oldState);
setRecording(!oldState,
var newState = (oldState === 'off' || !oldState) ? 'on' : 'off';
setRecording(newState,
recordingToken,
function (state) {
console.log("New recording state: ", state);
@ -143,7 +157,7 @@ var Recording = {
// have been wrong
setRecordingToken(null);
}
startedCallback(state);
recordingStateChangeCallback(state);
},
connection

View File

@ -434,9 +434,9 @@ var XMPP = {
return true;
},
toggleRecording: function (tokenEmptyCallback,
startingCallback, startedCallback) {
recordingStateChangeCallback) {
Recording.toggleRecording(tokenEmptyCallback,
startingCallback, startedCallback, connection);
recordingStateChangeCallback, connection);
},
addToPresence: function (name, value, dontSend) {
switch (name) {