-
Notifications
You must be signed in to change notification settings - Fork 30
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
chore(Video): Conditionally Render Youtube/Vimeo Videos #3049
base: main
Are you sure you want to change the base?
Conversation
View your CI Pipeline Execution ↗ for commit f97d1f1. ☁️ Nx Cloud last updated this comment at |
📬Published Alpha Packages:@codecademy/gamut@59.3.1-alpha.f97d1f.0 |
🚀 Styleguide deploy preview ready! |
@@ -90,13 +91,43 @@ export const Video: React.FC<VideoProps> = (props) => { | |||
}, | |||
}; | |||
|
|||
const isExternallyHostedVideoUrl = (url: string): boolean => | |||
!!(url.match(/youtu(be\.com|\.be)/) || url.match(/vimeo.com/)); |
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.
for consistency, it should be vimeo\.com
But also wondering if the com
or be
is necessary? like is there any instance where a different domain is used, like .co.uk
Or is this always ok because the URL is set by a dev and they'll conform to using these domains?
Overview
Conditionally Render Youtube/Vimeo videos if captions provided or fallback to default embed
PR Checklist
Related to designs:Testing Instructions
Over here -> https://github.com/codecademy-engineering/mono/pull/9574
PR Links and Envs