hide media until it's ready to play
This commit is contained in:
parent
caa5c580c3
commit
f38a5b8a15
1 changed files with 2 additions and 0 deletions
|
@ -165,6 +165,7 @@ class VideoPlayer extends React.PureComponent {
|
||||||
const { hasMetadata, unplayable } = this.state;
|
const { hasMetadata, unplayable } = this.state;
|
||||||
const noMetadataMessage = 'Waiting for metadata.';
|
const noMetadataMessage = 'Waiting for metadata.';
|
||||||
const unplayableMessage = "Sorry, looks like we can't play this file.";
|
const unplayableMessage = "Sorry, looks like we can't play this file.";
|
||||||
|
const hideMedia = this.playableType() && !hasMetadata && !unplayable;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
|
@ -177,6 +178,7 @@ class VideoPlayer extends React.PureComponent {
|
||||||
{unplayable && <LoadingScreen status={unplayableMessage} spinner={false} />}
|
{unplayable && <LoadingScreen status={unplayableMessage} spinner={false} />}
|
||||||
<div
|
<div
|
||||||
className={'content__view--container'}
|
className={'content__view--container'}
|
||||||
|
style={{ opacity: hideMedia ? 0 : 1 }}
|
||||||
ref={container => {
|
ref={container => {
|
||||||
this.media = container;
|
this.media = container;
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue