Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide iPhone HTML5 video play button

Tags:

html

iphone

I want to hide the big play button that appears by default on the <video> element

Is it possible?

like image 759
ilyo Avatar asked Jan 18 '12 13:01

ilyo


People also ask

How do you hide the controls of a video in HTML?

We can hide the controls by not adding the controls attribute to the video element. Even without controls attribute on the elements the user can view the controls section by right-clicking on the video and enabling the show controls .

How do I hide a video tag?

To hide a video on a web page, use yourVariableName. style. display='none'.


2 Answers

I don't have any iOS device handy to test, but perhaps try this:

video::-webkit-media-controls {     display:none !important; } 
like image 135
Ian Devlin Avatar answered Sep 28 '22 11:09

Ian Devlin


It seems Apple has changed the shadow-dom again.

In order to hide the play button control you must use the following CSS:

/* This used to work for the parent element of button divs */ /* But it does not work with newer browsers, the below doesn't hide the play button parent div */  *::-webkit-media-controls-panel {   display: none!important;   -webkit-appearance: none; }  /* Old shadow dom for play button */  *::-webkit-media-controls-play-button {   display: none!important;   -webkit-appearance: none; }  /* New shadow dom for play button */  /* This one works! */  *::-webkit-media-controls-start-playback-button {   display: none!important;   -webkit-appearance: none; } 
like image 39
Daemeron Avatar answered Sep 28 '22 10:09

Daemeron