Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Always show controls on YouTube embedded iframe

Is it possible to always show the controls (disable autohide) on an embedded YouTube video?

I've tried adding autohide=0 to the source url but the controls and progress bar still hide after a second or two. I'm confused because the IFrame Player API states...

0 – Regardless of the player's dimensions, the video progress bar and player controls are visible throughout the video.


Is there something I'm missing or has the functionality been removed?

See: https://jsfiddle.net/hmpj3fn6/

like image 853
spencer.sm Avatar asked Jun 20 '16 04:06

spencer.sm


People also ask

How do you show controls on YouTube?

Press Ctrl+M to hide or show the YouTube video player controls. When you pause a YouTube video, the player controls don't disappear.

How do I control YouTube iframe?

You can use an existing YouTube iframe's ID... var player; function onYouTubeIframeAPIReady() { player = new YT. Player('player', { events: { 'onStateChange': onPlayerStateChange } }); } function onPlayerStateChange() { //... } ...and the constructor will use your existing iframe instead of replacing it with a new one.

Does Rel 0 still work?

YouTube changed the rel=0 parameter as of September 2018 so that it no longer fully disables related videos. However, you can work around this using the YouTube Player API to show custom HTML instead of related videos.


1 Answers

After a little more digging...

This parameter has been deprecated for HTML5 players, which display or hide the video progress bar and player controls automatically (autohide=1).

https://developers.google.com/youtube/player_parameters#autohide

like image 124
spencer.sm Avatar answered Oct 17 '22 10:10

spencer.sm