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

View file

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