react-youtube icon indicating copy to clipboard operation
react-youtube copied to clipboard

How do you use the onEnd method?

Open RobinLans opened this issue 4 years ago • 0 comments

I have been doing something like this and nothing happens

function YouTubePlayer(props) {
        function endTheVideo(e) {
            console.log(e.target);
        }
        return (
            <div>
                <YouTube
                    opts={opts}
                    onReady={startVideo}
                    ref={videoPlayer}
                    onEnd={(e) => {
                          endTheVideo(e);
                    }}
                />
            </div>
        );
}
export default YouTubePlayer;

I'm probably doing it very wrong, does someone know?

RobinLans avatar Sep 13 '21 14:09 RobinLans