Search code examples
htmliframeyoutubeembed

Disable play/pause button of a YouTube video


I want to hide/disable the pause/play button of a YouTube video. I don't have access to the CSS file. I tried the answer mentioned at this link of stackOverflow. But it is not working. Can anyone help?

Here is what I tried,

<div style = "
 background: #FFFF00;
">

<iframe 
    src="https://www.youtube.com/embed/cElhIDdGz7M?start=0&amp;end=120&amp;autoplay=1&amp;controls=0&amp;disablekb=1&amp;rel=0" 
    allow="accelerometer; 
    autoplay; 
    encrypted-media; 
    gyroscope; 
    picture-in-picture" 
    allowfullscreen="" 
    width="560" 
    height="315" 
    frameborder="0"
></iframe>

</div>

Solution

  • I disabled it here: https://codepen.io/polinq/pen/mdyWmMm

    iframe{
     pointer-events: none; /* Disable any user interaction at all */
    }
    

    Is that what you are looking for?