Good day, there is such a code:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js"></script> <div id="ytplayer"></div> <script> var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player; function onYouTubeIframeAPIReady() { player = new YT.Player('ytplayer', { playerVars: { autoplay: 1, controls: 0, loop: 1, rel: 0, showinfo: 0}, videoId: '-vH2eZAM30s', events: { 'onReady': onPlayerReady, 'onStateChange': onPlayerStateChange } }); } function onPlayerReady(event) { player.mute(); $('#ytplayer').on('click', function() { player.unMute(); }); } var done = false; function onPlayerStateChange(event) { } </script> 

Initially, the video automatically starts without sound, by clicking on the player, the sound returns. But I also want to display the control panel (i.e. controls: 1). How to do it?

  • Currently, the YouTube Iframe API does not provide a method for dynamic control controls - kb0
  • Well, what about hiding and displaying? Can this be controlled? - KRIVA
  • Hiding and displaying what and when? When initializing the player, you can either show the control panel (controls) or not. During the work of YoutTube API standard tools is not provided yet - kb0

0