Disable <iframe> onclick pause

I want to remove all user controls. I used: controls=0 to hide the controls and disablekb=1 to remove the keyboard shortcuts. The last one on the left is a mouse click. I did some research, I did not find the right answer.

tl; dr How to remove a mouse pause form, such as:

 <iframe id="ytplayer" type="text/html" width="640" height="390" src='http://www.youtube.com/embed/EgBWDPXF2gU?autoplay=1&disablekb=1&controls=0&origin=http://example.com' ></iframe> 

EDIT: There is a legal solution. It does not work 100%, but for most cases it will be good enough. The solution is to simply add an event listener who is looking for a "video paused event". When this event fires, just start playing the current video. This will work flawlessly, and if the user does not click as fast as about 150-180 clicks per minute, the difference in milliseconds when the video was paused before the function starts will be imperceptible.

I will mark the only answer provided as a solution simply because if anyone finds this, he must first know that any further changes are illegal.

+4
source share
3 answers

Sorry, this is not a legal action. You may be banned for this from youtube. https://developers.google.com/youtube/terms

+2
source

Try this trick for an iframe or iframe wrapper:

 #ytplayer {pointer-events: none;} 
+8
source

I found a way to disable click (if you really need to), put the div in your iframe with these CSS attributes:

 position: absolute, height: 100%, width: 100% 
-one
source

Source: https://habr.com/ru/post/1493953/


All Articles