Friday, 25 January 2019

How to disable watch and share button on youtube videos using CSS/ Reactjs

I want to disable watch and share buttons on youtube video using CSS / Reactjs. I am embedding youtube video in our application using ReactPlayer and tried to disable watch and share buttons by fetching the iframe and change the css classes pertaining to the buttons, I am able to fetch the iframe pertaining to the video. However, could not get reference to the elements in the #document which is part of the iframe to manipulate them.

I have gone through couple of posts and got to know that it is due to CORS.

Early we could achieve this by setting the config parameter showinfo=0 and rel=0. But now there are deprecated

Could someone help me on this.



from How to disable watch and share button on youtube videos using CSS/ Reactjs

No comments:

Post a Comment