video-resize.js 605 B

12345678910111213
  1. //var container = document.getElementById('player-container')
  2. $( ".video-frame" ).each(function( index, container ){
  3. $( this ).children(".video-player"). width($( this ).width());
  4. $( this ).children(".video-player"). height($( this ).height());
  5. });
  6. window.addEventListener("resize", function(event) {
  7. console.log(`resizing video: ${$( this ).width()}x${$( this ).height()}px`);
  8. $( ".video-frame" ).each(function( index, container ){
  9. $( this ).children(".video-player"). width($( this ).width());
  10. $( this ).children(".video-player"). height($( this ).height());
  11. });
  12. })