frontend/src/components/VideoPlayer.js

33 lines
732 B
JavaScript
Raw Normal View History

import React from 'react';
import Grid from 'react-css-grid';
import PropTypes from 'prop-types';
2018-12-08 00:01:09 +02:00
import { getVideo } from '../utils/video';
class VideoPlayer extends React.Component {
render() {
return (
<Grid width={450}
gap={16}>
<section>
2018-12-08 00:01:09 +02:00
<h2>{ this.props.title }</h2>
<video src={ getVideo(this.props.id) } controls>
</video>
2018-12-08 00:01:09 +02:00
<h3>date { this.props.date } </h3>
</section>
<section className="text-left">
2018-12-08 00:01:09 +02:00
<p>{ this.props.description }</p>
</section>
</Grid>
)
}
}
2018-12-08 00:01:09 +02:00
VideoPlayer.propTypes = {
title: PropTypes.string,
date: PropTypes.string,
2018-12-08 00:01:09 +02:00
description: PropTypes.string
};
export default VideoPlayer;