youtube-component | A native DOM component for embedding youtube video players | Video Utils library
kandi X-RAY | youtube-component Summary
kandi X-RAY | youtube-component Summary
A native DOM component for embedding youtube video players
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- render main view
youtube-component Key Features
youtube-component Examples and Code Snippets
Community Discussions
Trending Discussions on youtube-component
QUESTION
EDIT: SOLVED
I've been stuck on this one all day and if someone have an idea it would be greatly appreciated!
So I'm using react-image-gallery and react-youtube to build a video carousel and my problem is that the YouTube-component is rendering as many times as the amount of videos I have, so I have multiple 'players' (some sort of objects that can utilize the YouTube-methods (playVideo etc.)).
What I've tried in the code below is to push every player-object into an array, so player in state is an array of these objects, which seems to work fine (there is probably a better way to do it though). I've then tried to loop through this array in the _onSlide()
-method to stop all videos when I slide to the next video in the gallery, but absoluteley nothing is happening.
Anyway, I want to make the current video stop when I slide to the next video so that only one video can play at a time.
...ANSWER
Answered 2017-May-11 at 20:32Shortly after I posted I figured it out. I changed the for-loop to an arrow function forEach and it worked!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install youtube-component
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page