diff --git a/src/views/Publication/Services/RTMP.js b/src/views/Publication/Services/RTMP.js index c4675fa..baae23f 100644 --- a/src/views/Publication/Services/RTMP.js +++ b/src/views/Publication/Services/RTMP.js @@ -82,11 +82,21 @@ function Service(props) { const settings = init(props.settings); const handleChange = (what) => (event) => { - const value = event.target.value; + let value = event.target.value; if (what in settings.options) { settings.options[what] = value; } else { + if (what === 'address') { + const matches = value.match(/(rtmp.):\/\//); + if (matches !== null) { + if (props.skills.protocols.includes(matches[1])) { + settings['protocol'] = matches[0]; + value = value.replace(matches[0], ''); + } + } + } + settings[what] = value; } @@ -131,6 +141,15 @@ function Service(props) { Address} value={settings.address} onChange={handleChange('address')} /> + + Stream Key} + value={settings.options.rtmp_playpath} + onChange={handleChange('rtmp_playpath')} + /> + }>