Skip to content

Instantly share code, notes, and snippets.

@jameshibbard
Created August 10, 2012 09:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jameshibbard/3312803 to your computer and use it in GitHub Desktop.
Save jameshibbard/3312803 to your computer and use it in GitHub Desktop.
CSS code to make the WordPress VideoJS plugin responsive
.videoWrapper {
position: relative;
padding-bottom: 55%; /* video dimensions - height/width */
padding-top: 0px;
height: 0;
z-index: 1000;
}
video {
position: absolute !important;
top: 0;
left: 0;
width: 100% !important;
height: 100% !important;
z-index: 1;
}
video.video-js {
z-index: 1000;
}
.video-js .vjs-controls {
z-index: 1002;
}
.video-js .vjs-big-play-button {
z-index: 1002;
}
.videoWrapper .video-js {
position: absolute;
top: 0;
left: 0;
width: 100% !important;
height: 100% !important;
z-index: 1;
background: #000000;
}
.videoWrapper object,.videoWrapper embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100% !important;
z-index: 1;
}
.vjs-spinner {
display: none !important;
}
.video-js img.vjs-poster {
height: 100% !important;
width: 100% !important;
z-index: 1;
max-width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment