mediaelement.js - How to change width

3.3k views Asked by At

I have tried to find which of the plethora of tags controls the width of the mediaelement.js audio player but can't seem to work it out.

I'm assuming it's a combination of the tags that need to be edited?

I downloaded the player from the mediaelemenjs.com and the CSS for it is huge.

<div class="fluid player">
   <audio id="player2" src="http://www.newlifedeewhy.com/media/school/2014/20140526-School-EpiLimiƱana.mp3" type="audio/mp3" controls></audio>
   <script>$('audio,video').mediaelementplayer();</script>
</div>

Here is JS Fiddle for demonstration.

1

There are 1 answers

2
CodingMonkey On BEST ANSWER

you can find the option at the API list

// if the <video width> is not specified, this is the default
defaultVideoWidth: 480,
// if the <video height> is not specified, this is the default
defaultVideoHeight: 270,
// if set, overrides <video width>
videoWidth: -1,
// if set, overrides <video height>
videoHeight: -1,
// width of audio player
audioWidth: 400,
// height of audio player
audioHeight: 30,

eg:

$('audio,video').mediaelementplayer({audioWidth: 600});