react-player

React - play media after items are loaded with array.map()

余生颓废 提交于 2021-01-29 13:40:00
问题 I'm using react-player to render youtube videos with map() , like so: class Jukebox extends Component { constructor (props) { super(props); this.state = { youtube_urls:[], clients:[], }; }; componentDidMount() { if (this.props.isAuthenticated) { this.getItems(); } }; getItems(event) { const {userId} = this.props const options = { url: `${process.env.REACT_APP_WEB_SERVICE_URL}/jukebox/${userId}`, method: 'get', headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': true,

Youtube link in ReactPlayer - HTTP Error 429

懵懂的女人 提交于 2021-01-28 07:50:31
问题 Today, all of a sudden, I encountered the following error in our React application: HTTP Error 429. We implement Youtube links in the ReactPlayer and it appears this error means there are too many requests from our app to Youtube. I tried working around the problem by using the iframe link for embedding Youtube videos, such as https://www.youtube.com/embed/tckGI4C7k10. This works well, with no error, but unfortunately, I am not able to access the current time or seekTo() on the player, since