Skip to content

Commit 38ab95a

Browse files
committed
preserve functionality for RTMP URL, use store for StreamBaseURL
1 parent 8fa36cc commit 38ab95a

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

react/features/recording/components/LiveStream/AbstractStartLiveStreamDialog.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,15 @@ export default class AbstractStartLiveStreamDialog<P extends IProps>
222222
if (!base) {
223223
return false;
224224
}
225-
if (!key) {
226-
return false;
225+
226+
let rtmpURL = base;
227+
228+
if (key) {
229+
rtmpURL = base.endsWith('/') ? base + key : `${base}/${key}`;
227230
}
228231

229-
const rtmpURL = base.endsWith('/') ? base + key : `${base}/${key}`;
230232
let selectedBroadcastID = null;
231233

232-
// to modify this too maybe?
233234
if (selectedBoundStreamID) {
234235
const selectedBroadcast = broadcasts?.find(
235236
broadcast => broadcast.boundStreamID === selectedBoundStreamID);
@@ -239,7 +240,6 @@ export default class AbstractStartLiveStreamDialog<P extends IProps>
239240

240241
sendAnalytics(
241242
createLiveStreamingDialogEvent('start', 'confirm.button'));
242-
243243
this.props._conference?.startRecording({
244244
broadcastId: selectedBroadcastID,
245245
mode: JitsiRecordingConstants.mode.STREAM,

react/features/recording/components/LiveStream/native/StartLiveStreamDialog.tsx

+17-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import HeaderNavigationButton
1111
from '../../../../mobile/navigation/components/HeaderNavigationButton';
1212
import { goBack }
1313
from '../../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
14-
import { setLiveStreamKey } from '../../../actions';
14+
import { setLiveStreamBaseURL, setLiveStreamKey } from '../../../actions';
1515
import AbstractStartLiveStreamDialog, { IProps, _mapStateToProps } from '../AbstractStartLiveStreamDialog';
1616

1717
import GoogleSigninForm from './GoogleSigninForm';
@@ -34,6 +34,7 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog<IProps> {
3434

3535
// Bind event handlers so they are only bound once per instance.
3636
this._onStartPress = this._onStartPress.bind(this);
37+
this._onStreamBaseURLChange = this._onStreamBaseURLChangeNative.bind(this);
3738
this._onStreamKeyChangeNative
3839
= this._onStreamKeyChangeNative.bind(this);
3940
this._onStreamKeyPick = this._onStreamKeyPick.bind(this);
@@ -83,7 +84,7 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog<IProps> {
8384
broadcasts = { this.state.broadcasts }
8485
onChange = { this._onStreamKeyPick } />
8586
<StreamKeyForm
86-
onStreamBaseURLChange = { this._onStreamBaseURLChange }
87+
onStreamBaseURLChange = { this._onStreamBaseURLChangeNative }
8788
onStreamKeyChange = { this._onStreamKeyChangeNative }
8889
streamBaseURLValue = { this.state.streamBaseURL || this.props._streamBaseURL || '' }
8990
streamKeyValue = { this.state.streamKey || this.props._streamKey || '' } />
@@ -108,6 +109,18 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog<IProps> {
108109
this._onStreamKeyChange(streamKey);
109110
}
110111

112+
/**
113+
* Callback to handle stream base URL changes.
114+
*
115+
* @private
116+
* @param {string} streamBaseURL - The new key value.
117+
* @returns {void}
118+
*/
119+
_onStreamBaseURLChangeNative(streamBaseURL: string) {
120+
this.props.dispatch(setLiveStreamBaseURL(streamBaseURL));
121+
this._onStreamBaseURLChange(streamBaseURL);
122+
}
123+
111124
/**
112125
* Callback to be invoked when the user selects a stream from the picker.
113126
*
@@ -145,12 +158,14 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog<IProps> {
145158
.catch(() => {
146159
this.setState({
147160
broadcasts: undefined,
161+
streamBaseURL: undefined,
148162
streamKey: undefined
149163
});
150164
});
151165
} else {
152166
this.setState({
153167
broadcasts: undefined,
168+
streamBaseURL: undefined,
154169
streamKey: undefined
155170
});
156171
}

0 commit comments

Comments
 (0)