【问题标题】:JWPlayer Now PlayingJWPlayer 正在播放
【发布时间】:2015-02-08 07:01:05
【问题描述】:

我正在尝试触发 JW Player 以显示当前项目(正在播放)。不幸的是,我无法让它工作。收到错误:

[Error] TypeError: undefined is not an object (evalating 'G.length')

这是我的代码:

        <head>

<style type="text/css">
body {
background-color: #000;
}
.jwrapbuttons {
    max-width: 330px;
    margin: 0 auto;
}

.jwbutton {
    font-weight: bold;
    font-size: 26px;
    padding: 10px 30px;
    border: 2px solid #ff0000;
    color: #ff0000;
    display: inline-block;
    text-decoration: none;
    margin: 50px 10px;
    background: rgba(255, 0, 0, 0.3);
}

.videobgelement {
    position: fixed !important;
    z-index: -1;
    top: 0;
    left: 0;
}
</style>
    </head>
<script src="jwplayer/jwplayer.js"></script>
<script type="text/javascript">jwplayer.key="m7vmXLZ0enrVLb+YYgi5ov3fLyu1cuUO06mN3bduBFQsvJceYFThIWkoGOmfvZPm";</script>
<div id="player"></div>

<script type="text/javascript">
  jwplayer('player').setup({
           width: "100%",
         height: "100%",
    playlist: "playlist.jw5.rss",
    plugins: {
      '../jwplayer.shuffle.js': {
        autostart: true,
        repeatplaylist: true,
        shuffle: true
      }
    }
  });

  jwplayer('player').addButton("shuffle.png", "Shuffle", function() {
    shuffle_setShuffle();
  }, "jwplayer-shuffle");

  jwplayer('player').addButton("repeat.png", "Repeat", function() {
    shuffle_setRepeatPlaylist();
  }, "jwplayer-repeat");
       var current = jwplayer().getPlaylistItem();
       console.log(current);
    </script>
</script>
</div>

我知道这有点乱,但我想知道:我哪里出错了?我应该定义什么才能让它起作用?

里卡多

【问题讨论】:

    标签: javascript jwplayer


    【解决方案1】:

    已修复:触发警报而不是随机触发。另外:旧版本的 JW Player 不支持 getPlaylistItem。它在 6.5 及更高版本中受支持。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-10-12
      • 1970-01-01
      • 2012-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多