Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/437.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript JPlayer:如何设置视频?_Javascript_Jquery_Video_Jquery Plugins_Jplayer - Fatal编程技术网

Javascript JPlayer:如何设置视频?

Javascript JPlayer:如何设置视频?,javascript,jquery,video,jquery-plugins,jplayer,Javascript,Jquery,Video,Jquery Plugins,Jplayer,我在网上找不到任何好的资源,所以我希望这里有人知道。我只需要设置jplayer来播放视频。我遵循了本页的源代码: 但是我的播放器没有出现——我只是得到了一堆乱七八糟的div和图标图像。以前有人用过这个插件吗 编辑:注意到我在控制台中遇到了这个错误:uncaughttypeerror:Object#在实际的jquery.jPlayer.min.js文件中没有方法“jPlayer” 我确保我的.js和css文件的链接设置良好。我的标题中有以下代码: $("#jquery_jplayer_1").jP

我在网上找不到任何好的资源,所以我希望这里有人知道。我只需要设置jplayer来播放视频。我遵循了本页的源代码:

但是我的播放器没有出现——我只是得到了一堆乱七八糟的div和图标图像。以前有人用过这个插件吗

编辑:注意到我在控制台中遇到了这个错误:
uncaughttypeerror:Object#在实际的
jquery.jPlayer.min.js
文件中没有方法“jPlayer”

我确保我的.js和css文件的链接设置良好。我的标题中有以下代码:

$("#jquery_jplayer_1").jPlayer({
        ready: function () {
            $(this).jPlayer("setMedia", {
                m4v: "http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v",
                ogv: "http://www.jplayer.org/video/ogv/Big_Buck_Bunny_Trailer.ogv",
                webmv: "http://www.jplayer.org/video/webm/Big_Buck_Bunny_Trailer.webm",
                poster: "http://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png"
            });
        },
        swfPath: "http://www.jplayer.org/2.1.0/js",
        supplied: "webmv, ogv, m4v",
        size: {
            width: "640px",
            height: "360px",
            cssClass: "jp-video-360p"
        }
    });
我的HTML正文中包含以下内容:

<div id="jp_container_1" class="jp-video jp-video-360p">
<div class="jp-type-single">
<div class="jp-gui">
<div class="jp-video-play">
                        <a class="jp-video-play-icon" tabindex="1" href="javascript:;">play</a>
                    </div>
<div class="jp-interface">
<div class="jp-progress">
<div class="jp-seek-bar">

                            </div>
</div>
<div class="jp-controls-holder">

<ul class="jp-controls">
<li><a class="jp-play" tabindex="1" href="javascript:;">play</a></li>
<li><a class="jp-pause" tabindex="1" href="javascript:;">pause</a></li>
<li><a class="jp-stop" tabindex="1" href="javascript:;">stop</a></li>
<li><a class="jp-mute" title="mute" tabindex="1" href="javascript:;">mute</a></li>
<li><a class="jp-unmute" title="unmute" tabindex="1" href="javascript:;">unmute</a></li>
<li><a class="jp-volume-max" title="max volume" tabindex="1" href="javascript:;">max volume</a></li>
</ul>
<div class="jp-volume-bar">

                            </div>
<ul class="jp-toggles">
<li><a class="jp-full-screen" title="full screen" tabindex="1" href="javascript:;">full screen</a></li>
<li><a class="jp-restore-screen" title="restore screen" tabindex="1" href="javascript:;">restore screen</a></li>
<li><a class="jp-repeat" title="repeat" tabindex="1" href="javascript:;">repeat</a></li>
<li><a class="jp-repeat-off" title="repeat off" tabindex="1" href="javascript:;">repeat off</a></li>
</ul>
</div>
<div class="jp-title">

<ul>
<li>Big Buck Bunny Trailer</li>
</ul>
</div>
</div>
</div>
</div>
</div>

  • 大公兔拖车

我也遇到了同样的问题,但如果我找到了本教程的源代码。它在Chrome和Firefox上运行良好。但不是在IE 7,8,9上。我已经问过另一个人了

我想这个答案对你来说可能太晚了。但是在这里


只需使用@bmorenate哇…堆更容易。。。