Forked from jramsahai/dynamically_resize_player_using_css.html
Created
July 30, 2014 01:50
-
-
Save joshorvis/b328800755cfd1c4ae6b to your computer and use it in GitHub Desktop.
This file contains 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
<html> | |
<head> | |
<style type="text/css"> | |
.video_container { | |
position: relative; | |
/* Set max values to player size */ | |
max-width: 640px; | |
max-height: 360px; | |
display:block; | |
} | |
.vidyard_player > span { | |
width: 100% !important; | |
height: 100% !important; | |
max-width: 640px; | |
max-height: 360px; | |
} | |
</style> | |
<script src="http://code.jquery.com/jquery-1.10.2.js"></script> | |
<script type="text/javascript"> | |
$(window).on('load resize',function(){ | |
$(".video_container").each (function (index) { | |
// Maintain 16:9 aspect ratio | |
$(this).height($(this).width()*(9/16)); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<div class="video_container"> | |
<!-- Vidyard inline Javascript embed here --> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment