Merge pull request #536 from lbryio/player-fullscreen-overlay-fix

fix transparent player background covering touchable items
This commit is contained in:
Akinwale Ariwodola 2019-05-01 16:36:58 +01:00 committed by GitHub
commit 73d91f7268
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -451,8 +451,8 @@ class FilePage extends React.PureComponent {
const playerStyle = [filePageStyle.player, const playerStyle = [filePageStyle.player,
this.state.isLandscape ? filePageStyle.containedPlayerLandscape : this.state.isLandscape ? filePageStyle.containedPlayerLandscape :
(this.state.fullscreenMode ? filePageStyle.fullscreenPlayer : filePageStyle.containedPlayer)]; (this.state.fullscreenMode ? filePageStyle.fullscreenPlayer : filePageStyle.containedPlayer)];
const playerBgStyle = [filePageStyle.playerBackground, this.state.fullscreenMode ? const playerBgStyle = [filePageStyle.playerBackground, filePageStyle.containedPlayerBackground];
filePageStyle.fullscreenPlayerBackground : filePageStyle.containedPlayerBackground]; const fsPlayerBgStyle = [filePageStyle.playerBackground, filePageStyle.fullscreenPlayerBackground];
// at least 2MB (or the full download) before media can be loaded // at least 2MB (or the full download) before media can be loaded
const canLoadMedia = fileInfo && const canLoadMedia = fileInfo &&
(fileInfo.written_bytes >= 2097152 || fileInfo.written_bytes == fileInfo.total_bytes); // 2MB = 1024*1024*2 (fileInfo.written_bytes >= 2097152 || fileInfo.written_bytes == fileInfo.total_bytes); // 2MB = 1024*1024*2
@ -535,6 +535,7 @@ class FilePage extends React.PureComponent {
this.setState({ playerBgHeight: evt.nativeEvent.layout.height }); this.setState({ playerBgHeight: evt.nativeEvent.layout.height });
} }
}} />} }} />}
{(canLoadMedia && fileInfo && isPlayable && this.state.fullscreenMode) && <View style={fsPlayerBgStyle} />}
{(canLoadMedia && fileInfo && isPlayable) && {(canLoadMedia && fileInfo && isPlayable) &&
<MediaPlayer <MediaPlayer
fileInfo={fileInfo} fileInfo={fileInfo}