|
|
@@ -6,7 +6,7 @@ var activecall = null;
|
|
6
|
6
|
var RTC = null;
|
|
7
|
7
|
var nickname = null;
|
|
8
|
8
|
var sharedKey = '';
|
|
9
|
|
-var recordingToken ='';
|
|
|
9
|
+var focusJid = null;
|
|
10
|
10
|
var roomUrl = null;
|
|
11
|
11
|
var roomName = null;
|
|
12
|
12
|
var ssrc2jid = {};
|
|
|
@@ -676,6 +676,16 @@ $(document).bind('joined.muc', function (event, jid, info) {
|
|
676
|
676
|
document.createTextNode(Strophe.getResourceFromJid(jid) + ' (me)')
|
|
677
|
677
|
);
|
|
678
|
678
|
|
|
|
679
|
+ if (connection.emuc.isModerator())
|
|
|
680
|
+ {
|
|
|
681
|
+ Toolbar.showSipCallButton(true);
|
|
|
682
|
+ Toolbar.showRecordingButton(true);
|
|
|
683
|
+ }
|
|
|
684
|
+ else
|
|
|
685
|
+ {
|
|
|
686
|
+ Toolbar.showSipCallButton(false);
|
|
|
687
|
+ Toolbar.showRecordingButton(false);
|
|
|
688
|
+ }
|
|
679
|
689
|
/* if (Object.keys(connection.emuc.members).length < 1) {
|
|
680
|
690
|
focus = new ColibriFocus(connection, config.hosts.bridge);
|
|
681
|
691
|
if (nickname !== null) {
|
|
|
@@ -737,7 +747,8 @@ $(document).bind('entered.muc', function (event, jid, info, pres) {
|
|
737
|
747
|
|
|
738
|
748
|
if (Strophe.getResourceFromJid(jid).indexOf('focus') != -1)
|
|
739
|
749
|
{
|
|
740
|
|
- console.info("Ignore focus");
|
|
|
750
|
+ focusJid = jid;
|
|
|
751
|
+ console.info("Ignore focus " + jid);
|
|
741
|
752
|
return;
|
|
742
|
753
|
}
|
|
743
|
754
|
|
|
|
@@ -1036,51 +1047,7 @@ function isAudioMuted()
|
|
1036
|
1047
|
|
|
1037
|
1048
|
// Starts or stops the recording for the conference.
|
|
1038
|
1049
|
function toggleRecording() {
|
|
1039
|
|
- if (focus === null || focus.confid === null) {
|
|
1040
|
|
- console.log('non-focus, or conference not yet organized: not enabling recording');
|
|
1041
|
|
- return;
|
|
1042
|
|
- }
|
|
1043
|
|
-
|
|
1044
|
|
- if (!recordingToken)
|
|
1045
|
|
- {
|
|
1046
|
|
- messageHandler.openTwoButtonDialog(null,
|
|
1047
|
|
- '<h2>Enter recording token</h2>' +
|
|
1048
|
|
- '<input id="recordingToken" type="text" placeholder="token" autofocus>',
|
|
1049
|
|
- false,
|
|
1050
|
|
- "Save",
|
|
1051
|
|
- function (e, v, m, f) {
|
|
1052
|
|
- if (v) {
|
|
1053
|
|
- var token = document.getElementById('recordingToken');
|
|
1054
|
|
-
|
|
1055
|
|
- if (token.value) {
|
|
1056
|
|
- setRecordingToken(Util.escapeHtml(token.value));
|
|
1057
|
|
- toggleRecording();
|
|
1058
|
|
- }
|
|
1059
|
|
- }
|
|
1060
|
|
- },
|
|
1061
|
|
- function (event) {
|
|
1062
|
|
- document.getElementById('recordingToken').focus();
|
|
1063
|
|
- }
|
|
1064
|
|
- );
|
|
1065
|
|
-
|
|
1066
|
|
- return;
|
|
1067
|
|
- }
|
|
1068
|
|
-
|
|
1069
|
|
- var oldState = focus.recordingEnabled;
|
|
1070
|
|
- Toolbar.toggleRecordingButtonState();
|
|
1071
|
|
- focus.setRecording(!oldState,
|
|
1072
|
|
- recordingToken,
|
|
1073
|
|
- function (state) {
|
|
1074
|
|
- console.log("New recording state: ", state);
|
|
1075
|
|
- if (state == oldState) //failed to change, reset the token because it might have been wrong
|
|
1076
|
|
- {
|
|
1077
|
|
- Toolbar.toggleRecordingButtonState();
|
|
1078
|
|
- setRecordingToken(null);
|
|
1079
|
|
- }
|
|
1080
|
|
- }
|
|
1081
|
|
- );
|
|
1082
|
|
-
|
|
1083
|
|
-
|
|
|
1050
|
+ Recording.toggleRecording();
|
|
1084
|
1051
|
}
|
|
1085
|
1052
|
|
|
1086
|
1053
|
/**
|
|
|
@@ -1472,10 +1439,6 @@ function setSharedKey(sKey) {
|
|
1472
|
1439
|
sharedKey = sKey;
|
|
1473
|
1440
|
}
|
|
1474
|
1441
|
|
|
1475
|
|
-function setRecordingToken(token) {
|
|
1476
|
|
- recordingToken = token;
|
|
1477
|
|
-}
|
|
1478
|
|
-
|
|
1479
|
1442
|
/**
|
|
1480
|
1443
|
* Updates the room invite url.
|
|
1481
|
1444
|
*/
|