fix typo
This commit is contained in:
parent
f48b331a69
commit
c1628b4572
2 changed files with 5 additions and 5 deletions
|
@ -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 });
|
||||||
|
|
|
@ -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}
|
||||||
|
|
Loading…
Reference in a new issue