disable player on mobile except for nowplaying
This commit is contained in:
parent
128f94ed21
commit
0d7da09ece
|
@ -17,8 +17,6 @@ import '../css/Controls.styles.css'
|
||||||
|
|
||||||
class Controls extends Component {
|
class Controls extends Component {
|
||||||
|
|
||||||
state = { showing: true };
|
|
||||||
|
|
||||||
// Pause, skip forward / back
|
// Pause, skip forward / back
|
||||||
keyboardShortcuts = e => {
|
keyboardShortcuts = e => {
|
||||||
switch (e.which) {
|
switch (e.which) {
|
||||||
|
@ -106,14 +104,6 @@ class Controls extends Component {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
// Set media session for mobile notifications/lockscreen display
|
// Set media session for mobile notifications/lockscreen display
|
||||||
this.setMediaSession()
|
this.setMediaSession()
|
||||||
const { pathname } = this.props.location;
|
|
||||||
console.log(pathname)
|
|
||||||
console.log(screen.width)
|
|
||||||
|
|
||||||
// if (pathname !== '/nowplaying') {
|
|
||||||
// this.setState({ showing: false });
|
|
||||||
// console.log(this.state.showing)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Keyboard controls
|
// Keyboard controls
|
||||||
document.addEventListener('keyup', this.handleOnKeyUp, false)
|
document.addEventListener('keyup', this.handleOnKeyUp, false)
|
||||||
|
@ -123,6 +113,7 @@ class Controls extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
|
||||||
document.removeEventListener('keyup', this.handleOnKeyUp, false)
|
document.removeEventListener('keyup', this.handleOnKeyUp, false)
|
||||||
document.removeEventListener('keydown', this.handleOnKeyDown, false)
|
document.removeEventListener('keydown', this.handleOnKeyDown, false)
|
||||||
}
|
}
|
||||||
|
@ -147,11 +138,10 @@ class Controls extends Component {
|
||||||
playStatus,
|
playStatus,
|
||||||
volumeVisible
|
volumeVisible
|
||||||
} = this.props
|
} = this.props
|
||||||
|
const { pathname } = this.props.location;
|
||||||
console.log(track)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{visibility: this.state.showing ? 'visible' : 'hidden' }}>
|
<div style={{visibility: screen.width > 600 ? 'visible' : pathname === '/nowplaying' ? 'visible' : 'hidden' }}>
|
||||||
<div className="title">
|
<div className="title">
|
||||||
{track.title.length > 35
|
{track.title.length > 35
|
||||||
? track.title.substring(0, 35) + '...'
|
? track.title.substring(0, 35) + '...'
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.NowPlaying-info {
|
.NowPlaying-info {
|
||||||
margin-top: 40px;
|
margin-top: 20px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue