diff --git a/react/features/shared-video/components/AbstractSharedVideoDialog.js b/react/features/shared-video/components/AbstractSharedVideoDialog.js index c54009bdb5d4..69fd55bb4303 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 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; }