【问题标题】:Styling and Sizing JWPlayer Audio Player based on percentage根据百分比设置 JWPlayer 音频播放器的样式和大小
【发布时间】:2016-12-13 07:07:01
【问题描述】:

我正在尝试基于 this article. 设置 JWPlayer 音频嵌入

上面说要这样设置:

<div id="myElement">Loading the player...</div>
<script type="text/javascript">
var playerInstance = jwplayer("myElement");
playerInstance.setup({
    file: "//example.com/uploads/myVideo.m4a",
    width: 640,
    height: 40
});
</script>

这很好用,只是我希望高度为 100%,而不是基于像素。

JWPlayer Configuration Reference 的“外观”部分下,它显示“视频播放器的所需宽度(以像素或百分比为单位)”。

如果您查看my codepen,您会发现 100% 的宽度完全打破了 40px 的高度。如果您改用像素宽度,它似乎可以工作。

由于这属于我的模板,因此无法使用 CSS 调整大小。

任何帮助将不胜感激!

【问题讨论】:

    标签: javascript jquery html audio jwplayer


    【解决方案1】:

    我实际上可以通过将宽度留空来解决这个问题:

    width: "",
    height: 40
    

    此处更新笔:http://codepen.io/ericjacksonwood/pen/KNexme

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-04-26
      • 1970-01-01
      • 1970-01-01
      • 2014-07-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多