Programatically setting playing to true or false does nothing
See original GitHub issueI want to use the player with custom controls so I’ve set controls
to false and set playing
equal to a state variable. Changing the variable does nothing, neither does just setting playing
to true. Even if initialized with playing
set to true there is no audio.
import React from 'react'
import { connect } from 'react-redux'
import ReactPlayer from 'react-player'
class Player extends React.Component {
componentWillReceiveProps(nextProps) {
console.log(nextProps)
// logs as expected
}
render() {
const { audioPlayer } = this.props
return (
<ReactPlayer
url='https://s3.amazonaws.com/*************/30rocktheme.mp3'
playing={audioPlayer.isPlaying}
/>
)
}
}
export default connect(store => ({
audioPlayer: store.audioPlayer,
}))(Player)
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Programatically setting playing to true or false does nothing
I want to use the player with custom controls so I've set controls to false and set playing equal to a state variable....
Read more >React-player play videos automatically when loaded without ...
Depends on browser which you are using but video must be muted if you want to autoplay without users interaction.
Read more >Autoplay guide for media and Web Audio APIs
Automatically starting the playback of audio (or videos with audio tracks) immediately upon page load can be an unwelcome surprise to users.
Read more >Scripting API: GameObject.SetActive - Unity - Manual
Activates/Deactivates the GameObject, depending on the given true or false value. A GameObject may be inactive because a parent is not active. In...
Read more >Interact programmatically with the Navigation component
The Navigation component provides ways to programmatically create and interact with certain navigation elements.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Why is this closed?? I’m experiencing this on Chrome / Linux. In the below component, the clicking the button has no effect.
Explained in my previous comment:
It’s much harder for me to help if I can’t easily recreate the issue myself.