From 38ab95a201a9a19df306fe69db9022977b81f2c1 Mon Sep 17 00:00:00 2001 From: Robert Oanta Date: Mon, 15 May 2023 14:58:48 +0300 Subject: [PATCH] preserve functionality for RTMP URL, use store for StreamBaseURL --- .../AbstractStartLiveStreamDialog.ts | 10 +++++----- .../native/StartLiveStreamDialog.tsx | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/react/features/recording/components/LiveStream/AbstractStartLiveStreamDialog.ts b/react/features/recording/components/LiveStream/AbstractStartLiveStreamDialog.ts index 5e2bef1f9e70..ac3051934079 100644 --- a/react/features/recording/components/LiveStream/AbstractStartLiveStreamDialog.ts +++ b/react/features/recording/components/LiveStream/AbstractStartLiveStreamDialog.ts @@ -222,14 +222,15 @@ export default class AbstractStartLiveStreamDialog

if (!base) { return false; } - if (!key) { - return false; + + let rtmpURL = base; + + if (key) { + rtmpURL = base.endsWith('/') ? base + key : `${base}/${key}`; } - const rtmpURL = base.endsWith('/') ? base + key : `${base}/${key}`; let selectedBroadcastID = null; - // to modify this too maybe? if (selectedBoundStreamID) { const selectedBroadcast = broadcasts?.find( broadcast => broadcast.boundStreamID === selectedBoundStreamID); @@ -239,7 +240,6 @@ export default class AbstractStartLiveStreamDialog

sendAnalytics( createLiveStreamingDialogEvent('start', 'confirm.button')); - this.props._conference?.startRecording({ broadcastId: selectedBroadcastID, mode: JitsiRecordingConstants.mode.STREAM, diff --git a/react/features/recording/components/LiveStream/native/StartLiveStreamDialog.tsx b/react/features/recording/components/LiveStream/native/StartLiveStreamDialog.tsx index 4891cc3f1a85..ae463b1ad5a5 100644 --- a/react/features/recording/components/LiveStream/native/StartLiveStreamDialog.tsx +++ b/react/features/recording/components/LiveStream/native/StartLiveStreamDialog.tsx @@ -11,7 +11,7 @@ import HeaderNavigationButton from '../../../../mobile/navigation/components/HeaderNavigationButton'; import { goBack } from '../../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef'; -import { setLiveStreamKey } from '../../../actions'; +import { setLiveStreamBaseURL, setLiveStreamKey } from '../../../actions'; import AbstractStartLiveStreamDialog, { IProps, _mapStateToProps } from '../AbstractStartLiveStreamDialog'; import GoogleSigninForm from './GoogleSigninForm'; @@ -34,6 +34,7 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog { // Bind event handlers so they are only bound once per instance. this._onStartPress = this._onStartPress.bind(this); + this._onStreamBaseURLChange = this._onStreamBaseURLChangeNative.bind(this); this._onStreamKeyChangeNative = this._onStreamKeyChangeNative.bind(this); this._onStreamKeyPick = this._onStreamKeyPick.bind(this); @@ -83,7 +84,7 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog { broadcasts = { this.state.broadcasts } onChange = { this._onStreamKeyPick } /> @@ -108,6 +109,18 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog { this._onStreamKeyChange(streamKey); } + /** + * Callback to handle stream base URL changes. + * + * @private + * @param {string} streamBaseURL - The new key value. + * @returns {void} + */ + _onStreamBaseURLChangeNative(streamBaseURL: string) { + this.props.dispatch(setLiveStreamBaseURL(streamBaseURL)); + this._onStreamBaseURLChange(streamBaseURL); + } + /** * Callback to be invoked when the user selects a stream from the picker. * @@ -145,12 +158,14 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog { .catch(() => { this.setState({ broadcasts: undefined, + streamBaseURL: undefined, streamKey: undefined }); }); } else { this.setState({ broadcasts: undefined, + streamBaseURL: undefined, streamKey: undefined }); }