问题描述:

I want to remove all controls from the user. I used: controls=0 to hide the controls and disablekb=1 to remove the keyboard shortcuts. The last left is the mouse click. I did some research, I didn't find the needed answer.

tl;dr How do I remove the mouse pause form an such as this:

<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 doesn't work on 100%, but it will be good enough for most cases. The solution is to simply add an event listener which is looking for the "video is paused event" When this event is triggered, simply start playing the current video. That will work flawlessly and unless the user clicks as fast as around 150-180 clicks per minute the difference for the millisecond when the video was paused before the function ran will be unnoticeable.

I will mark the only submitted answer as the solution simply because if anyone finds this he should, at first, know that any further modifications are illegal.

网友答案:

Sorry to say but that is not a legal action. You could be banned for that from youtube. https://developers.google.com/youtube/terms

网友答案:

Try this trick for iframe or iframe wrapper:

#ytplayer {pointer-events: none;}
网友答案:

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

position: absolute, 
height: 100%,
width: 100%
相关阅读:
Top