javascript - How to hidedisabled option to copy link of youtube video? - Stack Overflow
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'
最新文章
- 微软Surface平板电脑 是矛盾的存在吗?
- 电脑展趋势分析 移动终端大热DIY被弱化
- Intel毫不客气:ARM+Win8软硬件都不行
- 奇虎诉腾讯索赔1.5亿创天价 双方股价昨齐上涨
- 分析:Windows 8平板电脑称雄市场需三大因素
- How to upload wordpress from local to Godaddy wordpress hosting? - Stack Overflow
- Why does this typecheck in Lean? - Stack Overflow
- java - Omit super class fields in spring doc open api docs - Stack Overflow
- java.lang.NoClassDefFoundError: Could not initialize class org.apache.spark.SparkThrowableHelper$ - Stack Overflow
- python - How to add a linear gradient to a QTableWidget? - Stack Overflow
- amazon ses - Is it possible to send a RawMessage using Apache Camel AWS SES? - Stack Overflow
- html - Javascript cannot map object with repetative values - Stack Overflow
- smartcontracts - FailedCall() with OpenZeppelin meta transactions (ERC2771Forwarder and ERC2771Context) - Stack Overflow
- combinatorics - MiniZinc - Optimizing Script for Scheduling Problem - Stack Overflow
- php - 406 error when sendingreceiving JSON data - Stack Overflow
- ios - Persist overlay view in the detail side of NavigationSplitView - Stack Overflow
- excel - Are there any advantages to use `Application.Match` on a VBA array instead of looping over it when you only care if an e