hide media until it's ready to play

This commit is contained in:
btzr-io 2018-05-03 21:11:19 -06:00
parent caa5c580c3
commit f38a5b8a15

View file

@ -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;
}} }}