Hide webplayer when no song is in playlist
This commit is contained in:
parent
4e12da3a22
commit
b7f2f32e1d
@ -89,12 +89,20 @@ class WebPlayerCSSIntl extends Component {
|
||||
<div className="col-xs-12">
|
||||
<img src={art} width="200" height="200" alt={formatMessage(webplayerMessages["app.common.art"])} ref="art" styleName="art" />
|
||||
<div ref="artText">
|
||||
<h2>{songTitle}</h2>
|
||||
<h3>
|
||||
<span className="text-capitalize">
|
||||
<FormattedMessage {...webplayerMessages["app.webplayer.by"]} />
|
||||
</span> { artistName }
|
||||
</h3>
|
||||
{
|
||||
(artistName && songTitle)
|
||||
? (
|
||||
<div>
|
||||
<h2>{songTitle}</h2>
|
||||
<h3>
|
||||
<span className="text-capitalize">
|
||||
<FormattedMessage {...webplayerMessages["app.webplayer.by"]} />
|
||||
</span> { artistName }
|
||||
</h3>
|
||||
</div>
|
||||
)
|
||||
: null
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -65,11 +65,6 @@ class WebPlayer extends Component {
|
||||
if (!this.howl) {
|
||||
// Build a new Howler object with current song to play
|
||||
const url = props.currentSong.get("url");
|
||||
if (!url) {
|
||||
// TODO: Error handling
|
||||
console.error("URL not found.");
|
||||
return;
|
||||
}
|
||||
this.howl = new Howl({
|
||||
src: [url],
|
||||
html5: true, // Use HTML5 by default to allow streaming
|
||||
@ -114,7 +109,9 @@ class WebPlayer extends Component {
|
||||
onMute: this.props.actions.toggleMute,
|
||||
};
|
||||
return (
|
||||
<WebPlayerComponent {...webplayerProps} />
|
||||
(this.props.playlist.size > 0)
|
||||
? <WebPlayerComponent {...webplayerProps} />
|
||||
: <div></div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user