import React from "react"; import { Thumbnail } from "component/common"; import player from "render-media"; import fs from "fs"; // const from = require("from2"); class VideoPlayer extends React.Component { componentDidMount() { const elem = this.refs.media; const { downloadPath, filename } = this.props; const file = { name: filename, createReadStream: opts => { return fs.createReadStream(downloadPath, opts); }, }; player.append(file, elem, { autoplay: true, controls: true, }); } render() { const { downloadPath, mediaType, poster } = this.props; return (