Browse Source

feat(recording): add appData option. (#800)

tags/v0.0.2
Hristo Terezov 7 years ago
parent
commit
095a4485f2
2 changed files with 13 additions and 4 deletions
  1. 10
    4
      modules/recording/JibriSession.js
  2. 3
    0
      modules/recording/RecordingManager.js

+ 10
- 4
modules/recording/JibriSession.js View File

@@ -101,7 +101,9 @@ export default class JibriSession {
101 101
      *
102 102
      * @param {Object} options - Additional arguments for starting the
103 103
      * recording.
104
-     * @param {string} [optional] options.broadcastId - The broadcast ID of an
104
+     * @param {string} [options.appData] - Data specific to the app/service that
105
+     * the result file will be uploaded.
106
+     * @param {string} [options.broadcastId] - The broadcast ID of an
105 107
      * associated YouTube stream, used for knowing the URL from which the stream
106 108
      * can be viewed.
107 109
      * @param {string} options.focusMucJid - The JID of the focus participant
@@ -111,11 +113,12 @@ export default class JibriSession {
111 113
      * streaming service provider.
112 114
      * @returns Promise
113 115
      */
114
-    start({ broadcastId, focusMucJid, streamId }) {
116
+    start({ appData, broadcastId, focusMucJid, streamId }) {
115 117
         return new Promise((resolve, reject) => {
116 118
             this._connection.sendIQ(
117 119
                 this._createIQ({
118 120
                     action: 'start',
121
+                    appData,
119 122
                     focusMucJid,
120 123
                     broadcastId,
121 124
                     streamId
@@ -165,7 +168,9 @@ export default class JibriSession {
165 168
      *
166 169
      * @param {string} status - The new status to which the recording session
167 170
      * should transition.
168
-     * @param {string} [optional] options.broadcastId - The broadcast ID of an
171
+     * @param {string} [options.appData] - Data specific to the app/service that
172
+     * the result file will be uploaded.
173
+     * @param {string} [options.broadcastId] - The broadcast ID of an
169 174
      * associated YouTube stream, used for knowing the URL from which the stream
170 175
      * can be viewed.
171 176
      * @param {string} options.focusMucJid - The JID of the focus participant
@@ -175,7 +180,7 @@ export default class JibriSession {
175 180
      * streaming service provider.
176 181
      * @returns Object - The XMPP IQ message.
177 182
      */
178
-    _createIQ({ action, broadcastId, focusMucJid, streamId }) {
183
+    _createIQ({ action, appData, broadcastId, focusMucJid, streamId }) {
179 184
         return $iq({
180 185
             to: focusMucJid,
181 186
             type: 'set'
@@ -183,6 +188,7 @@ export default class JibriSession {
183 188
         .c('jibri', {
184 189
             'xmlns': 'http://jitsi.org/protocol/jibri',
185 190
             'action': action,
191
+            'app_data': appData,
186 192
             'recording_mode': this._mode,
187 193
             'streamid': streamId,
188 194
             'you_tube_broadcast_id': broadcastId

+ 3
- 0
modules/recording/RecordingManager.js View File

@@ -67,6 +67,8 @@ class RecordingManager {
67 67
      * Start a recording session.
68 68
      *
69 69
      * @param {Object} options - Configuration for the recording.
70
+     * @param {string} [options.appData] - Data specific to the app/service that
71
+     * the result file will be uploaded.
70 72
      * @param {string} [optional] options.broadcastId - The channel on which a
71 73
      * live stream will occur.
72 74
      * @param {string} options.mode - The mode in which recording should be
@@ -84,6 +86,7 @@ class RecordingManager {
84 86
         });
85 87
 
86 88
         return session.start({
89
+            appData: options.appData,
87 90
             broadcastId: options.broadcastId,
88 91
             focusMucJid: this._chatRoom.focusMucJid,
89 92
             streamId: options.streamId

Loading…
Cancel
Save