-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Additional configuration to customize streaming dialog #9539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional configuration to customize streaming dialog #9539
Conversation
@saghul To support your current effort in deprecating the |
THANK YOU! Much appreciated. Yes, let's do that.
The latter, a Now, that would break backwards compatibility, so you can add a small "translation" piece of code here:
toolbarButtons .
Thanks for doing this! |
@saghul We have changed the PR to the new config.js format and added the migration script for |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@saghul I see there are some conflicts and the bot marked it as |
Sure thing, we'd love to have it. Sorry it fell through the cracks, can you please rebase it and fix the conflicts? |
eaf69ec
to
be1d655
Compare
Perfect, we just fixed the merge conflict so the PR is now ready again to be merged. |
@saghul Can you give us a note when the right time is to get this merged? We can than fix merge conflicts on short notice. Otherwise we will do it over and over again 😉 |
Sorry for the delay. I am planning to spend time on this PR tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, PTAL.
react/features/recording/components/LiveStream/AbstractStreamKeyForm.js
Outdated
Show resolved
Hide resolved
react/features/recording/components/LiveStream/AbstractStreamKeyForm.js
Outdated
Show resolved
Hide resolved
Hi @saghul could you take another look at this PR it looks like it is now ready to be merged? |
Thanks for the poke. I'll be afk until next week, I'll take a look when I'm back. |
Just a friendly reminder 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, PTAL!
config.js
Outdated
@@ -676,6 +676,18 @@ var config = { | |||
// 'microphone', 'camera', 'select-background', 'invite', 'settings' | |||
// hiddenPremeetingButtons: [], | |||
|
|||
// Customize the Live Streaming dialog. Can be modified for a non-Youtube provider. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please move these close to where the recording options are?
config.js
Outdated
@@ -676,6 +676,18 @@ var config = { | |||
// 'microphone', 'camera', 'select-background', 'invite', 'settings' | |||
// hiddenPremeetingButtons: [], | |||
|
|||
// Customize the Live Streaming dialog. Can be modified for a non-Youtube provider. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Customize the Live Streaming dialog. Can be modified for a non-Youtube provider. | |
// Customize the Live Streaming dialog. Can be modified for a non-YouTube provider. |
config.js
Outdated
@@ -676,6 +676,18 @@ var config = { | |||
// 'microphone', 'camera', 'select-background', 'invite', 'settings' | |||
// hiddenPremeetingButtons: [], | |||
|
|||
// Customize the Live Streaming dialog. Can be modified for a non-Youtube provider. | |||
// liveStreaming: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this to the whitelist please.
*/ | ||
export function _getLiveStreaming(state: Object) { | ||
const { helpLink, termsLink, dataPrivacyLink, validatorRegExpString } = getLiveStreaming(state) || {}; | ||
const fourGroupsDashSeparated = /^(?:[a-zA-Z0-9]{4}(?:-(?!$)|$)){4}/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this a const at the top level?
|| LIVE_STREAMING_HELP_LINK; | ||
const { helpURL, termsURL, dataPrivacyURL, streamLinkRegexp } = this.props._liveStreaming; | ||
|
||
this.helpURL = helpURL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a good idea since the props can chance. Just read it from props wherever you need it.
* @returns {LiveStreamingProps} | ||
* @private | ||
*/ | ||
export function _getLiveStreaming(state: Object) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make function called getLiveStreaming
in functions.any.js actually do this and give you the nice pre-filled object.
@@ -13,3 +13,10 @@ export const YOUTUBE_LIVE_DASHBOARD_URL = 'https://www.youtube.com/live_dashboar | |||
* The URL for YouTube terms and conditions. | |||
*/ | |||
export const YOUTUBE_TERMS_URL = 'https://www.youtube.com/t/terms'; | |||
|
|||
/** | |||
* The live streaming help link to display. On web it comes from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment no longer applies.
* The live streaming help link to display. On web it comes from | ||
* interfaceConfig, but we don't have that on mobile. | ||
*/ | ||
export const LIVE_STREAMING_HELP_LINK = 'https://jitsi.org/live'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a DEFAULT_ or JITSI_ in front please.
a554758
to
5c68bb9
Compare
Hey, sorry for the late response. We made the suggested changes. If you agree with them we should be ready to merge :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments, almost there!
config.js
Outdated
@@ -295,6 +295,18 @@ var config = { | |||
// Whether to enable live streaming or not. | |||
// liveStreamingEnabled: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this one into the new liveStreaming
section and name it enabled
.
@@ -295,6 +295,18 @@ var config = { | |||
// Whether to enable live streaming or not. | |||
// liveStreamingEnabled: false, | |||
|
|||
// Customize the Live Streaming dialog. Can be modified for a non-YouTube provider. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this block of options right after localRecording, so all recording options are together.
@@ -397,6 +397,15 @@ function _translateLegacyConfig(oldValue: Object) { | |||
}; | |||
} | |||
|
|||
// Migrate interfaceConfig.LIVE_STREAMING_HELP_LINK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you move the enabled option, please add migration code here.
@@ -397,6 +397,15 @@ function _translateLegacyConfig(oldValue: Object) { | |||
}; | |||
} | |||
|
|||
// Migrate interfaceConfig.LIVE_STREAMING_HELP_LINK | |||
if (oldValue.liveStreaming === undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally speaking, it's good to always add the empty object here, before we add backwards compatible options.
/** | ||
* The live streaming dialog properties. | ||
*/ | ||
_liveStreaming: LiveStreamingProps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We put these at the top, generally.
@@ -150,9 +157,22 @@ export default class AbstractStreamKeyForm<P: Props> | |||
*/ | |||
_validateStreamKey(streamKey = '') { | |||
const trimmedKey = streamKey.trim(); | |||
const fourGroupsDashSeparated = /^(?:[a-zA-Z0-9]{4}(?:-(?!$)|$)){4}/; | |||
const match = fourGroupsDashSeparated.exec(trimmedKey); | |||
const match = this.props._liveStreaming?.streamLinkRegexp.exec(trimmedKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like streamLinkRegexp could be undefined?
@@ -0,0 +1,29 @@ | |||
// @flow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop the flow anotation please, we are migrating to TS.
@@ -1,3 +1,4 @@ | |||
// @flow | |||
|
|||
export * from './_'; | |||
export * from './functions'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't export anything from a feature's index.js, just use the full path to /functions when importing from another feature.
…ialog; deprecated LIVE_STREAMING_HELP_LINK
f981648
to
e654dea
Compare
e654dea
to
8902a4b
Compare
webpack chokes on something so I cannot test it. Can you please make sure the linter is tamed? Apologies in advance because this is in part our fault due to the transition to TypeScript. |
No worries, it should work now :) |
You can run |
@segnord Can you take a look? There still seems to be an issue with the Config type:
|
@skolmer Sorry, I didn't notice that the linter in the main branch now scans typescript files, I've merged the master branch into this MR and the npm lint runs fine locally. |
@saghul The pipeline is now green, can you take another look if everything is fine now? |
Cheers! |
The current streaming feature already allows us to stream to other streaming providers than youtube by submitting a rtmp-url instead of a youtube stream key. This is great but there is currently no way to change the UI to include details about the streaming service we want to use.
We extended the dialog with config parameters that allow us to change the default terms and condition link, the privacy policy link and also the regex that is used to validate the input.
The help link was already part of the interface config so we added the new params accordingly.
This PR will fix #9524