浏览代码

Adds follow entity parameter for the recording

master
hristoterezov 9 年前
父节点
当前提交
ba5275ef2f
共有 5 个文件被更改,包括 35 次插入31 次删除
  1. 2
    2
      JitsiConference.js
  2. 3
    3
      doc/example/example.js
  3. 18
    15
      lib-jitsi-meet.js
  4. 2
    2
      modules/xmpp/ChatRoom.js
  5. 10
    9
      modules/xmpp/recording.js

+ 2
- 2
JitsiConference.js 查看文件

@@ -447,9 +447,9 @@ JitsiConference.prototype.getRecordingURL = function () {
447 447
  * Starts/stops the recording
448 448
  * @param token a token for authentication.
449 449
  */
450
-JitsiConference.prototype.toggleRecording = function (token) {
450
+JitsiConference.prototype.toggleRecording = function (token, followEntity) {
451 451
     if(this.room)
452
-        return this.room.toggleRecording(token);
452
+        return this.room.toggleRecording(token, followEntity);
453 453
     return new Promise(function(resolve, reject){
454 454
         reject(new Error("The conference is not created yet!"))});
455 455
 }

+ 3
- 3
doc/example/example.js 查看文件

@@ -42,8 +42,8 @@ function onLocalTracks(tracks)
42 42
             $("body").append("<video autoplay='1' id='localVideo" + i + "' />");
43 43
             localTracks[i].attach($("#localVideo" + i ));
44 44
         } else {
45
-            // $("body").append("<audio autoplay='1' id='localAudio" + i + "' />");
46
-            // localTracks[i].attach($("#localAudio" + i ));
45
+            $("body").append("<audio autoplay='1' muted='true' id='localAudio" + i + "' />");
46
+            localTracks[i].attach($("#localAudio" + i ));
47 47
         }
48 48
         if(isJoined)
49 49
             room.addTrack(localTracks[i]);
@@ -105,7 +105,7 @@ function onUserLeft(id) {
105 105
  * That function is called when connection is established successfully
106 106
  */
107 107
 function onConnectionSuccess(){
108
-    room = connection.initJitsiConference("conference6", confOptions);
108
+    room = connection.initJitsiConference("conference10", confOptions);
109 109
     room.on(JitsiMeetJS.events.conference.TRACK_ADDED, onRemoteTrack);
110 110
     room.on(JitsiMeetJS.events.conference.TRACK_REMOVED, function (track) {
111 111
         console.log("track removed!!!" + track);

+ 18
- 15
lib-jitsi-meet.js 查看文件

@@ -449,9 +449,9 @@ JitsiConference.prototype.getRecordingURL = function () {
449 449
  * Starts/stops the recording
450 450
  * @param token a token for authentication.
451 451
  */
452
-JitsiConference.prototype.toggleRecording = function (token) {
452
+JitsiConference.prototype.toggleRecording = function (token, followEntity) {
453 453
     if(this.room)
454
-        return this.room.toggleRecording(token);
454
+        return this.room.toggleRecording(token, followEntity);
455 455
     return new Promise(function(resolve, reject){
456 456
         reject(new Error("The conference is not created yet!"))});
457 457
 }
@@ -6503,9 +6503,9 @@ ChatRoom.prototype.getRecordingURL = function () {
6503 6503
  * Starts/stops the recording
6504 6504
  * @param token token for authentication
6505 6505
  */
6506
-ChatRoom.prototype.toggleRecording = function (token) {
6506
+ChatRoom.prototype.toggleRecording = function (token, followEntity) {
6507 6507
     if(this.recording)
6508
-        return this.recording.toggleRecording(token);
6508
+        return this.recording.toggleRecording(token, followEntity);
6509 6509
 
6510 6510
     return new Promise(function(resolve, reject){
6511 6511
         reject(new Error("The conference is not created yet!"))});
@@ -10725,8 +10725,8 @@ Recording.prototype.handleJibriPresence = function (jibri) {
10725 10725
     this.eventEmitter.emit(XMPPEvents.RECORDING_STATE_CHANGED);
10726 10726
 };
10727 10727
 
10728
-Recording.prototype.setRecording = function (state, streamId, callback,
10729
-    errCallback){
10728
+Recording.prototype.setRecording = function (state, streamId, followEntity,
10729
+    callback, errCallback){
10730 10730
     if (state == this.state){
10731 10731
         return;
10732 10732
     }
@@ -10735,13 +10735,14 @@ Recording.prototype.setRecording = function (state, streamId, callback,
10735 10735
 
10736 10736
     var iq = $iq({to: this.focusMucJid, type: 'set'})
10737 10737
         .c('jibri', {
10738
-            xmlns: 'http://jitsi.org/protocol/jibri',
10739
-            action: (state === 'on') ? 'start' : 'stop',
10740
-            streamid: streamId
10738
+            "xmlns": 'http://jitsi.org/protocol/jibri',
10739
+            "action": (state === 'on') ? 'start' : 'stop',
10740
+            "streamid": streamId,
10741
+            "follow-entity": followEntity
10741 10742
         }).up();
10742 10743
 
10743
-    logger.log('Set jibri recording: '+state, iq);
10744
-
10744
+    logger.log('Set jibri recording: '+state, iq.nodeTree);
10745
+    console.log(iq.nodeTree);
10745 10746
     this.connection.sendIQ(
10746 10747
         iq,
10747 10748
         function (result) {
@@ -10754,7 +10755,7 @@ Recording.prototype.setRecording = function (state, streamId, callback,
10754 10755
         });
10755 10756
 };
10756 10757
 
10757
-Recording.prototype.toggleRecording = function (token) {
10758
+Recording.prototype.toggleRecording = function (token, followEntity) {
10758 10759
     var self = this;
10759 10760
     return new Promise(function(resolve, reject) {
10760 10761
         if (!token) {
@@ -10772,7 +10773,7 @@ Recording.prototype.toggleRecording = function (token) {
10772 10773
         var newState = (oldState === 'off' || !oldState) ? 'on' : 'off';
10773 10774
 
10774 10775
         self.setRecording(newState,
10775
-            token,
10776
+            token, followEntity,
10776 10777
             function (state, url) {
10777 10778
                 logger.log("New recording state: ", state);
10778 10779
                 if (state && state !== oldState) {
@@ -11424,9 +11425,11 @@ module.exports = function() {
11424 11425
                             logger.info('Dial result ', result);
11425 11426
 
11426 11427
                             var resource = $(result).find('ref').attr('uri');
11427
-                            self.call_resource = resource.substr('xmpp:'.length);
11428
+                            self.call_resource =
11429
+                                resource.substr('xmpp:'.length);
11428 11430
                             logger.info(
11429
-                                "Received call resource: " + self.call_resource);
11431
+                                "Received call resource: " +
11432
+                                self.call_resource);
11430 11433
                             resolve();
11431 11434
                         },
11432 11435
                         function (error) {

+ 2
- 2
modules/xmpp/ChatRoom.js 查看文件

@@ -702,9 +702,9 @@ ChatRoom.prototype.getRecordingURL = function () {
702 702
  * Starts/stops the recording
703 703
  * @param token token for authentication
704 704
  */
705
-ChatRoom.prototype.toggleRecording = function (token) {
705
+ChatRoom.prototype.toggleRecording = function (token, followEntity) {
706 706
     if(this.recording)
707
-        return this.recording.toggleRecording(token);
707
+        return this.recording.toggleRecording(token, followEntity);
708 708
 
709 709
     return new Promise(function(resolve, reject){
710 710
         reject(new Error("The conference is not created yet!"))});

+ 10
- 9
modules/xmpp/recording.js 查看文件

@@ -26,8 +26,8 @@ Recording.prototype.handleJibriPresence = function (jibri) {
26 26
     this.eventEmitter.emit(XMPPEvents.RECORDING_STATE_CHANGED);
27 27
 };
28 28
 
29
-Recording.prototype.setRecording = function (state, streamId, callback,
30
-    errCallback){
29
+Recording.prototype.setRecording = function (state, streamId, followEntity,
30
+    callback, errCallback){
31 31
     if (state == this.state){
32 32
         return;
33 33
     }
@@ -36,13 +36,14 @@ Recording.prototype.setRecording = function (state, streamId, callback,
36 36
 
37 37
     var iq = $iq({to: this.focusMucJid, type: 'set'})
38 38
         .c('jibri', {
39
-            xmlns: 'http://jitsi.org/protocol/jibri',
40
-            action: (state === 'on') ? 'start' : 'stop',
41
-            streamid: streamId
39
+            "xmlns": 'http://jitsi.org/protocol/jibri',
40
+            "action": (state === 'on') ? 'start' : 'stop',
41
+            "streamid": streamId,
42
+            "follow-entity": followEntity
42 43
         }).up();
43 44
 
44
-    logger.log('Set jibri recording: '+state, iq);
45
-
45
+    logger.log('Set jibri recording: '+state, iq.nodeTree);
46
+    console.log(iq.nodeTree);
46 47
     this.connection.sendIQ(
47 48
         iq,
48 49
         function (result) {
@@ -55,7 +56,7 @@ Recording.prototype.setRecording = function (state, streamId, callback,
55 56
         });
56 57
 };
57 58
 
58
-Recording.prototype.toggleRecording = function (token) {
59
+Recording.prototype.toggleRecording = function (token, followEntity) {
59 60
     var self = this;
60 61
     return new Promise(function(resolve, reject) {
61 62
         if (!token) {
@@ -73,7 +74,7 @@ Recording.prototype.toggleRecording = function (token) {
73 74
         var newState = (oldState === 'off' || !oldState) ? 'on' : 'off';
74 75
 
75 76
         self.setRecording(newState,
76
-            token,
77
+            token, followEntity,
77 78
             function (state, url) {
78 79
                 logger.log("New recording state: ", state);
79 80
                 if (state && state !== oldState) {

正在加载...
取消
保存