admin管理员组文章数量:1435859
I'm embedding a youtube video in the HTML with the following code
<iframe width="560" height="315"
src=";modestbranding=0" frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
I'm trying to hide/disable the context menu inside the video. to avoid copy video link.
I was going through API documentation, still couldn't find result.
How can achieve this?
fiddle link: /
I'm embedding a youtube video in the HTML with the following code
<iframe width="560" height="315"
src="https://www.youtube./embed/7MqMyoxMaW4?controls=0&modestbranding=0" frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
I'm trying to hide/disable the context menu inside the video. to avoid copy video link.
I was going through API documentation, still couldn't find result.
How can achieve this?
fiddle link: https://jsfiddle/us9rev0b/
Share Improve this question asked Dec 13, 2019 at 9:54 Pandiyan CoolPandiyan Cool 6,5938 gold badges53 silver badges90 bronze badges 3-
This is one type of patch but we can hide it by following pure JavaScript For hide watch later and share button respectively watch later
document.getElementsByClassName("ytp-watch-later-button ytp-button ytp-show-watch-later-title")[0].style.display = 'none'
share buttondocument.getElementsByClassName("ytp-button ytp-share-button ytp-share-button-visible ytp-show-share-title")[0].style.display = 'none'
– Hardik Masalawala Commented Dec 13, 2019 at 10:25 - @HardikMasalawala consider post your ment as an answer. – Mauricio Arias Olave Commented Dec 14, 2019 at 18:29
- please check my answer and accept it if it is matches your desired requirement – Hardik Masalawala Commented Dec 16, 2019 at 5:42
1 Answer
Reset to default 1This is one type of patch but we can hide it by following pure JavaScript
For hide watch later
document.getElementsByClassName("ytp-watch-later-button ytp-button ytp-show-watch-later-title")[0].style.display = 'none'
and For share button
document.getElementsByClassName("ytp-button ytp-share-button ytp-share-button-visible ytp-show-share-title")[0].style.display = 'none'
本文标签: javascriptHow to hidedisabled option to copy link of youtube videoStack Overflow
版权声明:本文标题:javascript - How to hidedisabled option to copy link of youtube video? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745673619a2669716.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论