Skip to content

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

Merged

Conversation

skolmer
Copy link
Contributor

@skolmer skolmer commented Jul 13, 2021

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

@skolmer
Copy link
Contributor Author

skolmer commented Aug 17, 2021

@saghul To support your current effort in deprecating the interface_config.js, should we move this to config.js including the already existing LIVE_STREAMING_HELP_LINK? Any preferences how this should be structured? Multiple config values or one config object that contains everything liveStreaming related?

@saghul
Copy link
Member

saghul commented Aug 18, 2021

To support your current effort in deprecating the interface_config.js, should we move this to config.js including the already existing LIVE_STREAMING_HELP_LINK?

THANK YOU! Much appreciated. Yes, let's do that.

Any preferences how this should be structured? Multiple config values or one config object that contains everything liveStreaming related?

The latter, a liveStreaming object which contains everything.

Now, that would break backwards compatibility, so you can add a small "translation" piece of code here:

function _translateLegacyConfig(oldValue: Object) {
like we do for toolbarButtons.

Thanks for doing this!

@skolmer
Copy link
Contributor Author

skolmer commented Aug 26, 2021

@saghul We have changed the PR to the new config.js format and added the migration script for LIVE_STREAMING_HELP_LINK

@saghul saghul self-requested a review September 15, 2021 16:02
@stale
Copy link

stale bot commented Jan 8, 2022

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.

@stale stale bot added the wontfix Issue won't be fixed label Jan 8, 2022
@skolmer
Copy link
Contributor Author

skolmer commented Jan 11, 2022

@saghul I see there are some conflicts and the bot marked it as wontfix. Is this PR obsolete now or are there still plans to merge it. If so please let us know and we try to fix the conflicts.

@stale stale bot removed the wontfix Issue won't be fixed label Jan 11, 2022
@saghul
Copy link
Member

saghul commented Jan 12, 2022

Sure thing, we'd love to have it. Sorry it fell through the cracks, can you please rebase it and fix the conflicts?

@segnord segnord force-pushed the nic/feat/PB-877-stream-dialog-parameter branch 2 times, most recently from eaf69ec to be1d655 Compare January 13, 2022 17:37
@skolmer
Copy link
Contributor Author

skolmer commented Jan 13, 2022

Sure thing, we'd love to have it. Sorry it fell through the cracks, can you please rebase it and fix the conflicts?

Perfect, we just fixed the merge conflict so the PR is now ready again to be merged.

@skolmer
Copy link
Contributor Author

skolmer commented Jan 27, 2022

@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 😉

@saghul
Copy link
Member

saghul commented Jan 27, 2022

Sorry for the delay. I am planning to spend time on this PR tomorrow.

Copy link
Member

@saghul saghul left a 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.

@skolmer skolmer requested a review from saghul March 10, 2022 12:16
@skolmer
Copy link
Contributor Author

skolmer commented May 23, 2022

Hi @saghul could you take another look at this PR it looks like it is now ready to be merged?

@saghul
Copy link
Member

saghul commented May 23, 2022

Thanks for the poke. I'll be afk until next week, I'll take a look when I'm back.

@skolmer
Copy link
Contributor Author

skolmer commented Jun 13, 2022

Thanks for the poke. I'll be afk until next week, I'll take a look when I'm back.

Just a friendly reminder 😊

Copy link
Member

@saghul saghul left a 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.
Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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: {
Copy link
Member

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}/;
Copy link
Member

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;
Copy link
Member

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) {
Copy link
Member

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
Copy link
Member

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';
Copy link
Member

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.

@segnord segnord force-pushed the nic/feat/PB-877-stream-dialog-parameter branch 2 times, most recently from a554758 to 5c68bb9 Compare June 28, 2022 13:47
@skolmer
Copy link
Contributor Author

skolmer commented Jun 28, 2022

Left some comments, PTAL!

Hey, sorry for the late response. We made the suggested changes. If you agree with them we should be ready to merge :)

Copy link
Member

@saghul saghul left a 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,
Copy link
Member

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.
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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);
Copy link
Member

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
Copy link
Member

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';
Copy link
Member

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.

@segnord segnord force-pushed the nic/feat/PB-877-stream-dialog-parameter branch from f981648 to e654dea Compare July 6, 2022 21:48
@segnord segnord force-pushed the nic/feat/PB-877-stream-dialog-parameter branch from e654dea to 8902a4b Compare July 6, 2022 21:52
@skolmer skolmer requested a review from saghul July 16, 2022 20:12
@skolmer
Copy link
Contributor Author

skolmer commented Jul 20, 2022

@segnord Next time please do not force push while the PR is in review. It makes it really hard to follow up on review comments.
@saghul We took care about your latest review feedback, can you take another look?

@saghul
Copy link
Member

saghul commented Jul 20, 2022

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.

@skolmer
Copy link
Contributor Author

skolmer commented Jul 20, 2022

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 :)

@saghul
Copy link
Member

saghul commented Jul 21, 2022

You can run npm lint locally to be sure, since I seem to need to approve every GH action run :-/

@skolmer
Copy link
Contributor Author

skolmer commented Jul 21, 2022

@segnord Can you take a look? There still seems to be an issue with the Config type:

Error: react/features/base/config/reducer.ts(423,14): error TS2339: Property 'liveStreaming' does not exist on type 'IConfig'.
Error: react/features/base/config/reducer.ts(423,39): error TS2339: Property 'liveStreaming' does not exist on type 'IConfig'.
Error: react/features/base/config/reducer.ts(427,18): error TS2339: Property 'liveStreaming' does not exist on type 'IConfig'.
Error: react/features/base/config/reducer.ts(428,25): error TS2339: Property 'liveStreaming' does not exist on type 'IConfig'.
Error: react/features/base/config/reducer.ts(434,18): error TS2339: Property 'liveStreaming' does not exist on type 'IConfig'.
Error: react/features/base/config/reducer.ts(437,18): error TS2339: Property 'liveStreaming' does not exist on type 'IConfig'.
Error: react/features/base/config/reducer.ts(438,25): error TS2339: Property 'liveStreaming' does not exist on type 'IConfig'.
Error: Process completed with exit code 2.

@segnord
Copy link

segnord commented Jul 21, 2022

@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.

@skolmer
Copy link
Contributor Author

skolmer commented Aug 2, 2022

@saghul The pipeline is now green, can you take another look if everything is fine now?

@saghul saghul merged commit 87f6d27 into jitsi:master Aug 2, 2022
@saghul
Copy link
Member

saghul commented Aug 2, 2022

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can add feature for Odysee
3 participants