import React from 'react'; import { MenuBar } from './menubar'; import videojs from 'video.js'; import 'video.js/dist/video-js.css'; export class VideoPlayer extends React.Component { constructor(props){ super(props); } componentDidMount(){ this.player = videojs(this.videoNode, { controls: true, aspectRatio: '16:9', fluid: false, sources: [{ src: this.props.data }] }); } componentWillUnmount() { if (this.player) { this.player.dispose() } } render(){ return (
) } }