mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-04-16 11:25:36 +00:00
24 lines
667 B
JavaScript
24 lines
667 B
JavaScript
import React from "react";
|
|
import PropTypes from "prop-types";
|
|
|
|
// This code was authored by bravemaster619 https://dev.to/bravemaster619/simplest-way-to-embed-a-youtube-video-in-your-react-app-3bk2
|
|
|
|
const YoutubeEmbed = ({ id }) => (
|
|
<div className="video-responsive">
|
|
<iframe
|
|
width="853"
|
|
height="480"
|
|
src={`https://www.youtube.com/embed/${id}`}
|
|
frameBorder="0"
|
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
|
allowFullScreen
|
|
title="Embedded youtube"
|
|
/>
|
|
</div>
|
|
);
|
|
|
|
YoutubeEmbed.propTypes = {
|
|
embedId: PropTypes.string.isRequired
|
|
};
|
|
|
|
export default YoutubeEmbed; |