I need to play video on my web-page. But I need to deny control. I put "controls=0", but player has pause action when I click on it. Can I disable "pause" action in YouTube player?
相关问题
- how to get selected text from iframe with javascri
- YouTube API refresh token revoked with 400 code “i
- How do you scroll an iframe from within using jque
- Unable to Full Screen Youtube Video Inside Custom
- Thumbnails from the Vimeo website harder than YouT
相关文章
- iframe的里内容看不到,但却点得到
- How to dynamically add wmode=transparent to Youtub
- iframe content disappears on Firefox
- Changing an IFrames InnerHtml from codebehind
- Scrolling issues with ExtJS 5 app inside IFrame
- iframe not reading cookies in Chrome
- Detect or Approximate Bluetooth Latency on Android
- Does html5 local storage store per iframe?
If you're displaying you video through HTML and have access to the CSS class used to display your video, you can do the following.
Your HTML will look something like this:
add a class name of your choice, I choose ytplayer
it will look like the following with my example
Then in your CSS file add rules for modifying your class. I used ytplayer but you may choose a different class name, be sure that it matches the one you used above.
That should do it.
" ?controls=0 " only hide the bottom control panel in the player but while clicking on the screen play/pause will work as normal
here are the control parameter values:
check this article this is really helpful https://developers.google.com/youtube/player_parameters
Use the following CSS on the DOM element:
Here is a way to block the screen so the user can't click anything.
There's no way to disable pausing entirely.
You could listen for
YT.PlayerState.PAUSED
events in an onStateChange handler and immediately call playVideo() when you detect one, but... I don't know, that sounds like it wouldn't be very user-friendly.You can try putting a div container over the video with nothing on it. In other words a blank container the same size as the video itself. What this should do is when someone tries to click on it, they will actually be clicking on the transparent container over it and won't be able to pause. This should work. You may also need to change the z-index to make sure the blank div container is truly over the video. (Test div container first with a background color and if the colored box covers the video then you can go back and remove the color and it will work the same.) Good luck.
Also, set the
disablekb
parameter to 1 so that user cannot pause even by space-bar.