How Could I completely hide HTML5 video controls?
<video width="300" height="200" controls="false" autoplay="autoplay"> <source src="video/supercoolvideo.mp4" type="video/mp4" /> </video>
false didn't work -- how is this done?
Cheers.
Press Ctrl+M to hide or show the YouTube video player controls. When you pause a YouTube video, the player controls don't disappear. That makes it really hard to take a clean screenshot of the video. The controls also block your view, which can get really annoying.
Put this in your functions. php theme file: add_filter( 'wp_video_shortcode', function( $output ) { $output = str_replace( 'controls="controls"', '', $output ); return $output; } ); Which replaces the controls="controls" attribute in the string with a blank space to omit the feature.
Like this:
<video width="300" height="200" autoplay="autoplay"> <source src="video/supercoolvideo.mp4" type="video/mp4" /> </video>
controls
is a boolean attribute:
Note: The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With