Youtube Video component first version
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
import React from 'react'; | |
import './Video.scss'; | |
const BASE_EMBED_URL = 'https://www.youtube.com/embed/'; | |
export function Video(props) { | |
if (!props.id) { | |
return null; | |
} | |
const embedUrl = `${BASE_EMBED_URL}${props.id}`; | |
return ( | |
<iframe width={'560'} height={'315'} src={embedUrl} frameBorder='0' | |
allow='autoplay; encrypted-media' allowFullScreen /> | |
); | |
} |
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
import React from 'react'; | |
import './Watch.scss'; | |
import {Video} from '../../components/Video/Video'; | |
export class Watch extends React.Component { | |
render() { | |
return ( | |
<div style={{maxWidth: '80%'}}> | |
<Video id='-7fuHEEmEjs'/> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment