CSS play - Vimeo videos - Hiding the control bar

17th June 2014

For all the latest browsers including IE8+ with fallback for iOS which does not support external video controls only.

The basic Vimeo player with control bar at the bottom.

CODE:
<iframe class="vimeo" src="http://player.vimeo.com/video/97930590" frameborder="0"></iframe>
CSS:
.vimeo {display:block; width:638px; height:358px; margin:0 auto;}



Increase the height of the iframe so that the player controls are moved below the video.

CODE:
<iframe class="vimeoXtra" src="http://player.vimeo.com/video/97930590" frameborder="0"></iframe>
CSS:
.vimeoXtra {display:block; width:638px; height:558px; margin:0 auto;}



Add an outer div which is the original size of the video and style this with overflow:hidden; and add a negative top margin to the iframe to move the video back into view.
The size of the top margin is half the increased size of the iframe.

CODE:
<div class="vimeoFrame"> <iframe class="vimeoXtra" src="http://player.vimeo.com/video/97930590" frameborder="0"></iframe></div>
CSS:
.vimeoFrame {width:638px; height:358px; overflow:hidden; margin:0 auto;}
.vimeoFrame .vimeoXtra {margin-top:-100px;}

.. and finally to have the controls show on tablets and smartphones add a @media query to reset the size and top margin of the iframe.

CSS:
@media only screen and (max-width: 768px) {
.vimeoFrame .vimeoXtra { width:638px; height:358px; margin-top:0;}
}

videos copyright © stu nicholls - CSS play

Information

A simple method of hiding the control bar from the Vimeo video player.

This just uses CSS and a wrapper div, and allows you to play and pause a video just by clicking it.

Because this does not work on the iPad and iPhone I have added a fallback for tablets and smartphones so that the controls are visible on these devices.



Copyright

You may use this method on your personal 'non-profit' web site without seeking my permission. A link back to CSSplay is always appreciated.

Commercial usage is also permitted without seeking approval, but I would ask that a donation is considered to support my work on CSSPlay.

If you are having problems integrating any of my demonstrations into your website then I now offer a service to fault find and correct any errors that you may have introduced. Please email me for more information.



Please Support CSS play

Please note that if your donation is for a demo/menu then you will need to email me with the url of the demo/menu after making the donation

For more CSS demonstrations I recommend that you visit the Dynamic Drive CSS Library.


Free, practical CSS menus, layouts, and examples

Soft Geometry Creative Industries

Soft Geometry Creative Industries
is a music-based design company located in Bristol UK.
I create artwork for albums, singles, posters and t-shirts.
My work is influenced by punk and post-punk poster and flyer design,
lo-fi photocopy aesthetics,
Francis Bacon and Mark Rothko.

I can provide a start to finish service with my own art and photography, put together work from images provided by yourself, and collaborate on an idea.
softgeometrycreative{at}gmail.com

Follow CSS play


Facebook   Twitter   Facebook Fan Page