Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.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 带有.flv文件的JPlayer_Javascript_Jquery_Jplayer - Fatal编程技术网

Javascript 带有.flv文件的JPlayer

Javascript 带有.flv文件的JPlayer,javascript,jquery,jplayer,Javascript,Jquery,Jplayer,我讨厌使用这些,因为我永远找不到它们的教程 我有一个jPlayer,我正试图用它来播放.flv视频文件。我一直在寻找一个关于如何使用jPlayer的教程,但我能找到的任何东西要么完全是垃圾,要么根本不显示任何代码,只是最终产品(我知道非常有用) 下面是我如何制作我的jPlayer: //Creates the JPlayer for that video $('#videoPlayerDiv').jPlayer({ ready: function () { $(this)

我讨厌使用这些,因为我永远找不到它们的教程

我有一个
jPlayer
,我正试图用它来播放
.flv
视频文件。我一直在寻找一个关于如何使用
jPlayer
的教程,但我能找到的任何东西要么完全是垃圾,要么根本不显示任何代码,只是最终产品(我知道非常有用)

下面是我如何制作我的
jPlayer

//Creates the JPlayer for that video
$('#videoPlayerDiv').jPlayer({
    ready: function () {
        $(this).jPlayer("setMedia", {
            flv: videoLocation
        }).jPlayer("play");
    },
    supplied: "flv",
    swfPath: "jPlayer/js"
});
videoLocation
是每个视频文件的位置。我已经测试了位置,它是正确的。当我运行页面时,我会显示视频框,但我无法播放它,或显示任何视频文件位置

如果有人能找到对我有很大帮助的问题(或教程)。

试试这个:

$('#videoPlayerDiv').jPlayer({
    ready: function () {
        this.element.jPlayer("setFile","path/to/flv/video/file.flv");
    }
});
编辑:
OP决定使用flowplayer而不是jPlayer。

这里是另一个对我有用的答案:

<!DOCTYPE html>


/*在此处粘贴或引用您的JS*/
  • 克罗马侬人
需要更新 要播放媒体,您需要将浏览器更新为最新版本,或更新浏览器。 $(文档).ready(函数(){ $(“#jquery_jplayer_1”).jplayer({ 就绪:功能(事件){ $(this).jPlayer(“setMedia”{ flv:“http://www.website.com/videos/training_videos/Buying_Online_vs_Buying_From_Talent_Advisor.flv" }); }, swfPath:“http://www.jplayer.org/2.1.0/js", 提供:“flv” }); });
视频定位的内容是什么?你能举个例子吗?它是从服务器上传的。我无法给出完整的位置,但大致如下:
http://mytabs/tabs/our_tabs/our_solutions/videos/myvideos.flv
您必须为此使用jPlayer吗?我从来没有在视频中使用jPlayer,我个人使用flowplayer。我不必使用jPlayer。如果有一种更简单的方法,我更愿意尝试查看flowplayer,我用它来播放FLV文件。这样效果更好。看起来(我不完全确定)视频文件已加载到播放机中,但它仍然无法播放(我做了
this.element.jPlayer(“setFile”,“path/to/flv/video/file.flv”)。play();
think)您的播放功能与此类似吗<代码>$(“#播放”)。单击(函数(){$(“#jqueryjplayer”).jplayer(“播放”);showPauseBtn();返回false;})我没有剧本(我不知道你需要它),但我试过了,它仍然无法播放。下面是它的外观:
function playVideo(videoLocation){//为该视频创建JPlayer$('videoPlayerDiv').JPlayer({ready:function(){this.element.JPlayer(“setFile”,videoLocation.play();}}});$(“#play”)。单击(function(){$('jquery#JPlayer”).JPlayer(“play”);showPauseBtn;return false;});}
这给了我一个没有按钮的黑屏,单击它不会导致播放。您是否尝试过用mp3文件替换flv文件以查看它是否可以正常加载音频?
    <link href="http://jplayer.org/latest/skin/pink.flag/jplayer.pink.flag.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>    
    <script type="text/javascript" src="http://jplayer.org/2.1.0/js/jquery.jplayer.min.js"></script>
    <script type="text/javascript">

        /*paste or reference your JS here*/

    </script>

</head>
<body>
    <div id="jquery_jplayer_1" class="jp-jplayer"></div>

    <div id="jp_container_1" class="jp-audio">
        <div class="jp-type-single">
            <div class="jp-gui jp-interface">
                <ul class="jp-controls">

                    <!-- comment out any of the following <li>s to remove these buttons -->

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

                <!-- you can comment out any of the following <div>s too -->

                <div class="jp-progress">
                    <div class="jp-seek-bar">
                        <div class="jp-play-bar"></div>
                    </div>
                </div>
                <div class="jp-volume-bar">
                    <div class="jp-volume-bar-value"></div>
                </div>
                <div class="jp-current-time"></div>
                <div class="jp-duration"></div>                   
            </div>
            <div class="jp-title">
                <ul>
                    <li>Cro Magnon Man</li>
                </ul>
            </div>
            <div class="jp-no-solution">
                <span>Update Required</span>
                To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
            </div>
        </div>
    </div>


</body>



$(document).ready(function() {

$("#jquery_jplayer_1").jPlayer({
    ready: function(event) {
        $(this).jPlayer("setMedia", {
            flv:"http://www.website.com/videos/training_videos/Buying_Online_vs_Buying_From_Talent_Advisor.flv"
        });
    },
    swfPath: "http://www.jplayer.org/2.1.0/js",
    supplied: "flv"
});
});