Created
July 31, 2014 22:08
-
-
Save designbuildtest/23be068d0c3cc5d467c0 to your computer and use it in GitHub Desktop.
Responsive video's
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function mytheme_wrap_oembed_with_div( $html ) { | |
| return '<div class="oembed-container">' . $html . '</div>'; | |
| } | |
| add_filter( 'embed_oembed_html', 'mytheme_wrap_oembed_with_div', 10, 3); | |
| add_filter( 'video_embed_html', 'mytheme_wrap_oembed_with_div' ); | |
| ?> | |
| .oembed-container { | |
| display: block; | |
| max-width: 100%; | |
| margin-bottom: 0.75em; | |
| } | |
| .oembed-container embed, | |
| .oembed-container iframe, | |
| .oembed-container object, | |
| .oembed-container video { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| } | |
| .oembed-container { | |
| position: relative; | |
| padding-bottom: 56.25%; | |
| height: 0; | |
| overflow: hidden; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment