Merge pull request #480 from lbryio/playable-content

fix Play icon being displayed for non-playable content
This commit is contained in:
Akinwale Ariwodola 2019-03-15 11:58:28 +01:00 committed by GitHub
commit 81dca20b17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 24 deletions

View file

@ -511,14 +511,16 @@ class FilePage extends React.PureComponent {
onStartDownloadFailed={this.startDownloadFailed} />} onStartDownloadFailed={this.startDownloadFailed} />}
{!fileInfo && <FilePrice uri={uri} style={filePageStyle.filePriceContainer} textStyle={filePageStyle.filePriceText} />} {!fileInfo && <FilePrice uri={uri} style={filePageStyle.filePriceContainer} textStyle={filePageStyle.filePriceText} />}
</View> </View>
{canLoadMedia && fileInfo && <View style={playerBgStyle} {(canLoadMedia && fileInfo && isPlayable) &&
<View style={playerBgStyle}
ref={(ref) => { this.playerBackground = ref; }} ref={(ref) => { this.playerBackground = ref; }}
onLayout={(evt) => { onLayout={(evt) => {
if (!this.state.playerBgHeight) { if (!this.state.playerBgHeight) {
this.setState({ playerBgHeight: evt.nativeEvent.layout.height }); this.setState({ playerBgHeight: evt.nativeEvent.layout.height });
} }
}} />} }} />}
{canLoadMedia && fileInfo && <MediaPlayer {(canLoadMedia && fileInfo && isPlayable) &&
<MediaPlayer
fileInfo={fileInfo} fileInfo={fileInfo}
assignPlayer={(ref) => { this.player = ref; }} assignPlayer={(ref) => { this.player = ref; }}
uri={uri} uri={uri}

View file

@ -139,6 +139,7 @@ const filePageStyle = StyleSheet.create({
}, },
containedPlayerBackground: { containedPlayerBackground: {
width: '100%', width: '100%',
marginTop: 60,
height: containedMediaHeight, height: containedMediaHeight,
}, },
fullscreenPlayerBackground: { fullscreenPlayerBackground: {