We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to async query video on componentDidMount and then display the player based on the loaded video.
componentDidMount
Problem: Everything work , video can be play. But the player always autoplay the video.
Sample codes
class VideoPage extends Component { constructor(props) { super(props); this.state = { video: {}, }; } componentDidMount() { this.getVideo(this.state.videoId); } getVideo(){ // query db then this.setState(video); } return(){ const {video} = this.state; return( <YouTube video={video.videoId} width={640} height={390} /> ) } }
The text was updated successfully, but these errors were encountered:
looks like we should use cueVideoById instead of loadVideoById here, if autoplay is false:
react-youtube/src/index.js
Lines 150 to 154 in 2c357c5
Sorry, something went wrong.
5a2f70a
No branches or pull requests
I am trying to async query video on
componentDidMount
and then display the player based on the loaded video.Problem: Everything work , video can be play. But the player always autoplay the video.
Sample codes
The text was updated successfully, but these errors were encountered: