【问题标题】:jwplayer is not loading when using external js file使用外部 js 文件时 jwplayer 未加载
【发布时间】:2017-12-28 09:41:56
【问题描述】:

我使用了 jw 播放器广告版,但我的代码似乎不起作用。我使用了外部 js 配置文件..不确定真正的问题..寻求支持。 谢谢!。

我的代码:

在外部 js 文件中: 我放了以下代码: HTML 源代码:

jwplayer("my-video").setup({
  file: file,

  aspectratio: "16:9",
  skin: {
    name: "five",
    active: "red",
    inactive: "white",
    background: "black"
  },
  width: width,
  height: height,
  primary: primary,
  advertising: advertising
});

在 pre.html 中

我输入以下代码:

<script type="text/javascript">

var file: "https://s3.amazonaws.com/aws-website-awsvideouploadvastadscustomizer-f3qi3/videos/JACKALS+Trailer+(2017)+Horror+Movie.mp4",
var width: "580",
var height: "360",
var primary: "flash",
var advertising: { 
  var client: "vast",
  var schedule: {"ad tag"}
};
</script>

【问题讨论】:

    标签: javascript jquery html arrays jwplayer7


    【解决方案1】:

    首先您需要设置 JW-Script URL (https://support.jwplayer.com/customer/portal/questions/16758746-cdn-url)。在仪表板中,您可以设置播放器的高度和宽度以及颜色。

    然后你需要设置JW播放器(假设div#my-video是播放器然后你需要设置文件)

    var playerInstance = jwplayer("my-video");
    
    playerInstance.setup({
        'file' : 'https://s3.amazonaws.com/aws-website-awsvideouploadvastadscustomizer-f3qi3/videos/JACKALS+Trailer+(2017)+Horror+Movie.mp4',
    });
    

    【讨论】:

    • 如何自动播放?上面的代码只加载url!
    猜你喜欢
    • 2016-11-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-02
    相关资源
    最近更新 更多