视频无法在JWPlayer中播放

时间:2014-05-07 07:17:22

标签: javascript html video jwplayer

我在JWPlayer中使用自己的皮肤并播放YouTube视频。但视频没有显示出来。我能够在播放器上获得皮肤。这是代码

  <!DOCTYPE html>
<html>
    <head>
       <script type="text/javascript" src="http://player.longtailvideo.com/jwplayer.js"></script>
        <script type="text/javascript">jwplayer.key=mykey";</script>
    </head>
    <body>
        <div id="container">Loading the player ...</div>
        <script type="text/javascript">
            jwplayer("container").setup({
             flashplayer: "fwplayer.swf",
            file: "https://www.youtube.com/watch?v=1gniYetOxCo",
             skin: "myskin.xml",
            height: 270,
            width: 480
        });
        </script>
    </body>
</html>

2 个答案:

答案 0 :(得分:1)

JW Player目前使用Flash播放器在桌面浏览器上传送YouTube内容。您需要取消评论{1}}属性,如此小提琴中所示:http://jsfiddle.net/hZVHh/

如果找不到播放器皮肤,则可能会阻止播放器加载 - 确保您正确引用它。

答案 1 :(得分:1)

我从我的localhost执行了这段代码,它运行了

<!DOCTYPE html>
<html>
    <head>
       <script type="text/javascript" src="http://player.longtailvideo.com/jwplayer.js"></script>

    </head>
    <body>
        <div id="container">Loading the player ...</div>
        <script type="text/javascript">
            jwplayer("container").setup({
             flashplayer: "fwplayer.swf",
            file: "https://www.youtube.com/watch?v=yourVideo",
             skin: "mySkin.xml",
            height: 270,
            width: 480
        });
        </script>
    </body>
</html>