Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting HTML5 video to scale for responsive designs using mediaelement.js

I'm currently using the mediaelement.js plugin for Wordpress and it seems to work great.

In my attempts to create my first ever responsive CSS design/theme using the @media attribute, I have noticed that the mediaelement.js powered video does not scale, or does not respond to the size of the screen.

Even though I set the CSS, it appears that mediaelement.js actively puts its own inline CSS stylesheets.

With this in mind, is it possible to use mediaelement.js and get the video to scale as per responsiveness.

Thanks

like image 945
zardon Avatar asked Mar 03 '26 02:03

zardon


1 Answers

I'm using mediaelementjs too. It is seems to be scaling perfectly for me within responsive designs.

I followed some tips from John Dyer, the MEjs developer at github.

There he points out that you need to include inline style in your video tag

<video style="width:100%;height:100%;">

He does make a few other pointers, so I would suggest checking out the github page at https://github.com/johndyer/mediaelement

like image 66
Chris Bryant Avatar answered Mar 05 '26 19:03

Chris Bryant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!