Is it possible to only remove the "watch later" and "share" buttons from youtube iframe embed player
Solution 1
This parameter is deprecated and will be ignored after September 25, 2018.
Solution 2
As an example, this is what you're trying to do:
document.getElementsByTagName('iframe')[0].contentWindow.getElementsByClassName('ytp-watch-later-button')[0].style.display = 'none';
But, short answer, there is no simple way to do this, because YouTube is on a different domain:
'Not possible from client side . A javascript error will be raised "Error: Permission denied to access property "document"" since the Iframe is not part of your domaine...' https://stackoverflow.com/a/30545122/2488877
Though, you might find an answer suitable to your needs if you're tech-savvy in the answers to the question above.
Solution 3
I don't think it is possible with the iframe method. My reasons for thinking that is:
- It is not an option listed on their parameters page
- I found this thread where a member of their team said it was not possible at the time (2012), and they had no plans to add the ability.
You could probably achieve something similar by turning showinfo off, and using the other methods to grab the video title.
Solution 4
Add this line after link
https://www.youtube.com/embed/c5cHjtspa7M?mode=opaque&rel=0&autohide=1&showinfo=0&wmode=transparent
It will disable the share and watch later option
Solution 5
showinfo
Note: This parameter is deprecated and will be ignored after September 25, 2018.
Supported values are 0 and 1.
Setting the parameter's value to 0 causes the player to not display information like the video title and uploader before the video starts playing.
If the player is loading a playlist, and you explicitly set the parameter value to 1, then, upon loading, the player will also display thumbnail images for the videos in the playlist.
Rohit Kumar
Updated on July 21, 2022Comments
-
Rohit Kumar almost 2 years
How can I remove the watch later and share buttons from youtube iframe embed player. Using the following embed code for embedding video clips.
<iframe width="854" height="480" src="https://www.youtube.com/embed/cPVgwz5aN1o" frameborder="0" allowfullscreen></iframe>
Using showinfo=0 removes the full Header which also contains the Video Title.
Is it possible to only remove "Watch Later" and "Share" buttons from the header?