This commit is contained in:
btzr-io 2018-07-27 20:26:04 -06:00
parent f48b331a69
commit c1628b4572
2 changed files with 5 additions and 5 deletions

View file

@ -158,10 +158,10 @@ class VideoPlayer extends React.PureComponent {
}
file() {
const { downloadPath, filename } = this.props;
const { downloadPath, fileName } = this.props;
return {
name: filename,
name: fileName,
createReadStream: opts => fs.createReadStream(downloadPath, opts),
};
}
@ -188,7 +188,7 @@ class VideoPlayer extends React.PureComponent {
renderFile() {
// This is what render-media does with unplayable files
const { filename: fileName, downloadPath, contentType, mediaType } = this.props;
const { fileName, downloadPath, contentType, mediaType } = this.props;
toBlobURL(fs.createReadStream(downloadPath), contentType, (err, url) => {
if (err) {
@ -202,7 +202,7 @@ class VideoPlayer extends React.PureComponent {
contentType,
downloadPath,
filePath: url,
fileType: path.extname(filename).substring(1),
fileType: path.extname(fileName).substring(1),
};
// Update state
this.setState({ fileSource });

View file

@ -163,7 +163,7 @@ class FileViewer extends React.PureComponent<Props> {
</div>
) : (
<Player
filename={fileInfo.file_name}
fileName={fileInfo.file_name}
poster={poster}
downloadPath={fileInfo.download_path}
mediaType={mediaType}