javascript jwplayer 不工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10066105/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 08:35:09  来源:igfitidea点击:

jwplayer not working

javascriptjqueryjwplayer

提问by Amnesiac11

I've downloaded the files and followed the steps provided but the player simply isn't working.

我已经下载了文件并按照提供的步骤操作,但播放器根本无法工作。

    <code>
    <html>
    <head>
    <script type="text/javascript" src="/jwplayer.js"></script>
    <script type="text/javascript" src="/jquery.js"></script>

    </head>

    <body>
    <div id="container">Loading the player ...</div>
    <script type="text/javascript">
    jwplayer("container").setup({
    flashplayer: "/player.swf",
    file: "/video.mp4",
    height: 270,
    width: 480
    });
    </script>
    </body>
    </html>
    </code>

All it shows is "Loading the Player." As you can see I've linked the JWplayer and jquery scripts. What am I missing? Any help would be greatly appreciated. I use web expressions... when I try to follow the jwplayer link "jwplayer(container)," i says that a link could not be found.

它显示的只是“加载播放器”。如您所见,我已链接 JWplayer 和 jquery 脚本。我错过了什么?任何帮助将不胜感激。我使用网络表达式...当我尝试关注 jwplayer 链接“jwplayer(container)”时,我说找不到链接。

回答by 4x3LDev

Try this code. With relative address, it works for me! I hope this will help you.

试试这个代码。使用相对地址,它对我有用!我希望这能帮到您。

<!DOCTYPE html>
<html>
    <head>
        <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jplayer/2.9.2/jplayer/jquery.jplayer.min.js"></script>
        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js/jquery.js"></script>
    </head>
    <body>
        <div id="container">Loading the player ...</div>
        <script type="text/javascript">
            jwplayer("container").setup({
            flashplayer: "//cdnjs.cloudflare.com/ajax/libs/jplayer/2.9.2/jplayer/jquery.jplayer.swf",
            file: "http://content.bitsontherun.com/videos/lWMJeVvV-364767.mp4",
            height: 270,
            width: 480
        });
        </script>
    </body>
</html>

回答by peter22

Just get rid of the /in your code so that it reads as follows:

只需删除/代码中的 ,使其如下所示:

flashplayer: "player.swf"