-
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
feat(Video + Markdown): update react player + put videos in markdown #2941
Merged
Merged
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
1f6671b
videos +markdown
dreamwasp 9434e58
video in markdown, test in docs
dreamwasp 91cc194
Merge branch 'main' into cass-gm-890
dreamwasp 2735ba1
build to test markdown
dreamwasp ef28c27
Merge branch 'cass-gm-890' of ssh://github.com/Codecademy/gamut into …
dreamwasp f51cd9e
fight jest
dreamwasp 0144135
markdown tests passing
dreamwasp e82ce92
vimeo markdown
dreamwasp 7847e31
Merge branch 'main' into cass-gm-890
dreamwasp e6a8865
mrakdown test errors
dreamwasp 2cac30b
Merge branch 'cass-gm-890' of ssh://github.com/Codecademy/gamut into …
dreamwasp 685447e
Merge branch 'main' into cass-gm-890
dreamwasp 0128d3e
start video markdown
dreamwasp b4412b4
add video component
dreamwasp dd5af30
vide markdown working
dreamwasp 7acc29f
tests passing, examples added
dreamwasp 1532c01
markdown tests passing!!
dreamwasp 6a179d4
Merge branch 'main' into cass-gm-890
dreamwasp 01e8132
try to fix props issue + autoplay
dreamwasp 76db61d
phrase less awkwardly
dreamwasp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
packages/gamut/src/Markdown/libs/overrides/Iframe/styles.module.scss
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
packages/gamut/src/Markdown/libs/overrides/Video/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* eslint-disable jsx-a11y/iframe-has-title */ | ||
import { DetailedHTMLProps, VideoHTMLAttributes } from 'react'; | ||
|
||
import { Video } from '../../../../Video'; | ||
// eslint-disable-next-line gamut/no-css-standalone | ||
|
||
export type MarkdownVideoProps = DetailedHTMLProps< | ||
VideoHTMLAttributes<HTMLVideoElement>, | ||
HTMLVideoElement | ||
>; | ||
|
||
export const MarkdownVideo: React.FC<MarkdownVideoProps> = (props) => { | ||
if (props?.src) { | ||
// Sanitize the props to pass to the Video component | ||
const videoProps = { | ||
autoplay: props?.autoPlay, | ||
controls: props?.controls, | ||
height: Number(props?.height), | ||
loop: props?.loop, | ||
muted: props?.muted, | ||
videoTitle: props?.title, | ||
videoUrl: props?.src, | ||
width: Number(props?.width), | ||
}; | ||
|
||
return <Video {...videoProps} />; | ||
} | ||
// eslint-disable-next-line jsx-a11y/media-has-caption | ||
return <video {...props} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -347,4 +347,18 @@ Use the `printf()` function. | |
|
||
### Iframes | ||
|
||
<iframe src="https://player.vimeo.com/video/145702525?byline=0&portrait=0&badge=0" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> | ||
Vimeo and Youtube video iframes will be rendered by our Video component, otherwise they'll render as stated. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: what does render as stated mean? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i meant just renders the original code, i'll rephrase |
||
|
||
<iframe src="https://player.vimeo.com/video/188237476?badge=0&autopause=0&player_id=0&app_id=58479" frameborder="0" allow="autoplay; fullscreen; picture-in-picture; clipboard-write" style="position:absolute;top:0;left:0;width:100%;height:100%;" title="Studio Ghibli in Real Life"></iframe> | ||
|
||
<br/> | ||
|
||
<iframe width="1094" height="842" src="https://www.youtube.com/embed/zhDwjnYZiCo" title="Ghibli Coffee Shop ☕️ Music to put you in a better mood 🌿 lofi hip hop - lofi songs | study / relax" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> | ||
|
||
|
||
### Video | ||
|
||
`video`s with an `src` will be rendered by our Video component, otherwise they'll render as stated. | ||
|
||
<video src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm" title="video" /> | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Viemo lol