【问题标题】:mediaelement.js - How to change widthmediaelement.js - 如何改变宽度
【发布时间】:2015-06-10 08:11:18
【问题描述】:

我试图找出控制 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 用于演示。

【问题讨论】:

    标签: javascript audio media-player mediaelement.js mediaelement


    【解决方案1】:

    您可以在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});
    

    【讨论】:

    • 这有点帮助。音量控制没有显示在播放器边界中......我该如何解决这个问题?
    • 只修改默认样式:.mejs-controls a.mejs-horizo​​ntal-volume-slider { width: 30px; }
    猜你喜欢
    • 2013-09-18
    • 1970-01-01
    • 1970-01-01
    • 2021-04-12
    • 2020-11-18
    • 1970-01-01
    • 1970-01-01
    • 2011-12-17
    • 1970-01-01
    相关资源
    最近更新 更多