我试图找到众多标签中的哪一个控制 mediaelement.js 音频播放器的宽度,但似乎无法解决。
我假设它是需要编辑的标签的组合?
我从 mediaelemenjs.com 下载了播放器而且它的 CSS 非常庞大。
<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>
这里是JS Fiddle用于演示。
最佳答案
您可以在 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,
例如:
$('audio,video').mediaelementplayer({audioWidth: 600});
关于javascript - mediaelement.js - 如何更改宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30750697/