feat(iFrame): Add recording options for RTMP streaming.
Add methods for start/stop recording in addition to the commands that we already have.
This commit is contained in:
parent
da33d8a033
commit
fbfaed07b2
|
@ -223,7 +223,8 @@ function initCommands() {
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts a file recording or streaming depending on the passed on params.
|
* Starts a file recording or streaming session depending on the passed on params.
|
||||||
|
* For RTMP streams, `rtmpStreamKey` must be passed on. `rtmpBroadcastID` is optional.
|
||||||
* For youtube streams, `youtubeStreamKey` must be passed on. `youtubeBroadcastID` is optional.
|
* For youtube streams, `youtubeStreamKey` must be passed on. `youtubeBroadcastID` is optional.
|
||||||
* For dropbox recording, recording `mode` should be `file` and a dropbox oauth2 token must be provided.
|
* For dropbox recording, recording `mode` should be `file` and a dropbox oauth2 token must be provided.
|
||||||
* For file recording, recording `mode` should be `file` and optionally `shouldShare` could be passed on.
|
* For file recording, recording `mode` should be `file` and optionally `shouldShare` could be passed on.
|
||||||
|
@ -231,13 +232,23 @@ function initCommands() {
|
||||||
*
|
*
|
||||||
* @param { string } arg.mode - Recording mode, either `file` or `stream`.
|
* @param { string } arg.mode - Recording mode, either `file` or `stream`.
|
||||||
* @param { string } arg.dropboxToken - Dropbox oauth2 token.
|
* @param { string } arg.dropboxToken - Dropbox oauth2 token.
|
||||||
|
* @param { string } arg.rtmpStreamKey - The RTMP stream key.
|
||||||
|
* @param { string } arg.rtmpBroadcastID - The RTMP braodcast ID.
|
||||||
* @param { boolean } arg.shouldShare - Whether the recording should be shared with the participants or not.
|
* @param { boolean } arg.shouldShare - Whether the recording should be shared with the participants or not.
|
||||||
* Only applies to certain jitsi meet deploys.
|
* Only applies to certain jitsi meet deploys.
|
||||||
* @param { string } arg.youtubeStreamKey - The youtube stream key.
|
* @param { string } arg.youtubeStreamKey - The youtube stream key.
|
||||||
* @param { string } arg.youtubeBroadcastID - The youtube broacast ID.
|
* @param { string } arg.youtubeBroadcastID - The youtube broacast ID.
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
'start-recording': ({ mode, dropboxToken, shouldShare, youtubeStreamKey, youtubeBroadcastID }) => {
|
'start-recording': ({
|
||||||
|
mode,
|
||||||
|
dropboxToken,
|
||||||
|
shouldShare,
|
||||||
|
rtmpStreamKey,
|
||||||
|
rtmpBroadcastID,
|
||||||
|
youtubeStreamKey,
|
||||||
|
youtubeBroadcastID
|
||||||
|
}) => {
|
||||||
const state = APP.store.getState();
|
const state = APP.store.getState();
|
||||||
const conference = getCurrentConference(state);
|
const conference = getCurrentConference(state);
|
||||||
|
|
||||||
|
@ -253,8 +264,8 @@ function initCommands() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode === JitsiRecordingConstants.mode.STREAM && !youtubeStreamKey) {
|
if (mode === JitsiRecordingConstants.mode.STREAM && !(youtubeStreamKey || rtmpStreamKey)) {
|
||||||
logger.error('Failed starting recording: missing youtube stream key');
|
logger.error('Failed starting recording: missing youtube or RTMP stream key');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -286,9 +297,9 @@ function initCommands() {
|
||||||
}
|
}
|
||||||
} else if (mode === JitsiRecordingConstants.mode.STREAM) {
|
} else if (mode === JitsiRecordingConstants.mode.STREAM) {
|
||||||
recordingConfig = {
|
recordingConfig = {
|
||||||
broadcastId: youtubeBroadcastID,
|
broadcastId: youtubeBroadcastID || rtmpBroadcastID,
|
||||||
mode: JitsiRecordingConstants.mode.STREAM,
|
mode: JitsiRecordingConstants.mode.STREAM,
|
||||||
streamId: youtubeStreamKey
|
streamId: youtubeStreamKey || rtmpStreamKey
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
logger.error('Invalid recording mode provided');
|
logger.error('Invalid recording mode provided');
|
||||||
|
|
|
@ -1047,6 +1047,39 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
|
||||||
return setVideoInputDevice(this._transport, label, deviceId);
|
return setVideoInputDevice(this._transport, label, deviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts a file recording or streaming session depending on the passed on params.
|
||||||
|
* For RTMP streams, `rtmpStreamKey` must be passed on. `rtmpBroadcastID` is optional.
|
||||||
|
* For youtube streams, `youtubeStreamKey` must be passed on. `youtubeBroadcastID` is optional.
|
||||||
|
* For dropbox recording, recording `mode` should be `file` and a dropbox oauth2 token must be provided.
|
||||||
|
* For file recording, recording `mode` should be `file` and optionally `shouldShare` could be passed on.
|
||||||
|
* No other params should be passed.
|
||||||
|
*
|
||||||
|
* @param {Object} options - An object with config options to pass along.
|
||||||
|
* @param { string } options.mode - Recording mode, either `file` or `stream`.
|
||||||
|
* @param { string } options.dropboxToken - Dropbox oauth2 token.
|
||||||
|
* @param { boolean } options.shouldShare - Whether the recording should be shared with the participants or not.
|
||||||
|
* Only applies to certain jitsi meet deploys.
|
||||||
|
* @param { string } options.rtmpStreamKey - The RTMP stream key.
|
||||||
|
* @param { string } options.rtmpBroadcastID - The RTMP broacast ID.
|
||||||
|
* @param { string } options.youtubeStreamKey - The youtube stream key.
|
||||||
|
* @param { string } options.youtubeBroadcastID - The youtube broacast ID.
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
startRecording(options) {
|
||||||
|
this.executeCommand('startRecording', options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stops a recording or streaming session that is in progress.
|
||||||
|
*
|
||||||
|
* @param {string} mode - `file` or `stream`.
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
stopRecording(mode) {
|
||||||
|
this.executeCommand('startRecording', mode);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the configuration for electron for the windows that are open
|
* Returns the configuration for electron for the windows that are open
|
||||||
* from Jitsi Meet.
|
* from Jitsi Meet.
|
||||||
|
|
Loading…
Reference in New Issue