stream/src/components/VideoEmbed/index.js

29 lines
611 B
JavaScript
Raw Normal View History

2021-05-16 23:08:25 +00:00
import { Fragment, h } from 'preact'
import { string } from 'prop-types'
2021-10-12 12:45:52 +00:00
import { Iframe } from './styles'
2021-05-16 23:08:25 +00:00
2021-10-12 12:45:52 +00:00
const VideoEmbed = ({ url, ...rest }) => {
const id = url.split('/').pop()
const src = `https://tv.undersco.re/videos/embed/${id}?title=0&warningTitle=0&peertubeLink=0`
2021-05-16 23:08:25 +00:00
return (
<Fragment>
<Iframe
width="560"
height="315"
2021-10-12 12:45:52 +00:00
src={src}
2021-05-16 23:08:25 +00:00
frameborder="0"
allowfullscreen
2021-10-12 12:45:52 +00:00
sandbox="allow-same-origin allow-scripts allow-popups"
{...rest}
2021-05-16 23:08:25 +00:00
/>
</Fragment>
)
}
2021-10-12 12:45:52 +00:00
VideoEmbed.propTypes = {
2021-05-16 23:08:25 +00:00
url: string,
}
2021-10-12 12:45:52 +00:00
export default VideoEmbed