jquery - How can I hide controls in a youtube video when a user checked a input? -
i create "movie mode" users can watch video without controls or video title. idea this:
<iframe src="//youtube.com/embed/8qgnzcaa9pk" allowfullscreen="" style="overflow-x: hidden; overflow-y: hidden;" height="569" frameborder="0"></iframe> <input type="checkbox" id="hide-controlls"> hide controlls, in movie! <script src="//code.jquery.com/jquery-1.11.1.js"></script> <script> $('#hide-controlls').click(function () { $(".html5-video-controls").toggle(this.checked); }); </script>
but looks dosen't work, , don't know why, becouse code seems correct, check box dosen't anything. wrong?
from https://developers.google.com/youtube/player_parameters
- controls=0 – player controls not display in player. iframe embeds, flash player loads immediately.
- controls=1 (default) – player controls display in player. iframe embeds, controls display , flash player loads immediately.
- controls=2 – player controls display in player. iframe embeds, controls display , flash player loads after user initiates video playback.
Comments
Post a Comment