"Responsive YouTube Player"
Bootstrap 3.1.0 Snippet by mrmccormack

<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!-- Reference: http://avexdesigns.com/responsive-youtube-embed/ --> <div class="container"> <div class="row"> <h3>Mr. M.'s Responsive YouTube Player</h3> <p> <strong><mark>Update!</mark> See how Bootstrap 3.2 makes this easy</strong> <a href="http://bootsnipp.com/mrmccormack/snippets/d2DzN">Mr. M.'s YouTube/Vimeo Responsive Embeds - Bootstrap 3.2</a> </p> <p> <a href="http://bootsnipp.com/iframe/6bDM" target="_blank">View Full Screen</a> </p> <hr> </div><!--.row --> </div><!--./container --> <div class="container"> <div class="row"> <div class="col-md-4"> <h4>Lorem Ipsum</h4> <p> Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p><img src="http://farm7.staticflickr.com/6043/6311448642_841c424a65.jpg" class="img-responsive center-block" alt="tv"> <p> <small>Image: <a href="http://www.flickr.com/photos/photography_and_design/6311448642/sizes/l/" target="_blank">Jonas' Design</a><br> <a href="http://tinyurl.com/tbvalid8" target="_blank">HTML 5 Valid</a></small> </p> </div><!--.col --> <div class="col-md-8"> <div class="vid"> <iframe width="560" height="315" src="//www.youtube.com/embed/ac7KhViaVqc" allowfullscreen=""></iframe> </div><!--./vid --> </div><!--.col --> </div><!--./row --> </div><!--./container -->
/* Reference: http://avexdesigns.com/responsive-youtube-embed/ */ .vid { position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden; } .vid iframe, .vid object, .vid embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

Related: See More


Questions / Comments:

nice ! , also work with class"imgresize"

JossVans () - 3 years ago - Reply 0


perbSup!!!

Kishore G () - 4 years ago - Reply 0


This is great, thank you very much!

Jared () - 4 years ago - Reply 0


wow, I didn't know this. I've been using fitvids.js since the days of old. Thanks!

Rich () - 5 years ago - Reply 0


This video not funk, all blank

estudiante () - 5 years ago - Reply 0


my video didn't work with iframe

Alex PaireRa () - 5 years ago - Reply 0


Does this work with Vimeo videos too?

Brian () - 5 years ago - Reply 0


Yes, this should work with any content.

mrmccormack () - 5 years ago - Reply 0


nice!

richiebee () - 5 years ago - Reply 0