Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(share-video) fix links not being trimmed (#9740)

Avram Tudor9914a5d14a9e
diff --git a/react/features/shared-video/components/AbstractSharedVideoDialog.js b/react/features/shared-video/components/AbstractSharedVideoDialog.js
index c54009bdb5..69fd55bb43 100644
--- a/react/features/shared-video/components/AbstractSharedVideoDialog.js
+++ b/react/features/shared-video/components/AbstractSharedVideoDialog.js
@@ -56,14 +56,20 @@ export default class AbstractSharedVideoDialog<S: *> extends Component < Props,
* @returns {boolean}
*/
_onSetVideoLink(link: string) {
- if (!link || !link.trim()) {
+ if (!link) {
return false;
}
- const youtubeId = getYoutubeId(link);
+ const trimmedLink = link.trim();
+
+ if (!trimmedLink) {
+ return false;
+ }
+
+ const youtubeId = getYoutubeId(trimmedLink);
const { onPostSubmit } = this.props;
- onPostSubmit(youtubeId || link);
+ onPostSubmit(youtubeId || trimmedLink);
return true;
}