0

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

我有一个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是每个视频文件的位置。我已经测试了位置,它是正确的。当我运行该页面时,我会显示视频框,但无法播放或显示任何视频文件位置。

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

4

2 回答 2

1

试试这个:

$('#videoPlayerDiv').jPlayer({
    ready: function () {
        this.element.jPlayer("setFile","path/to/flv/video/file.flv");
    }
});

编辑:OP 决定使用 flowplayer 而不是 jPlayer。

于 2011-05-10T19:31:08.167 回答
0

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

<!DOCTYPE html>

    <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"
});
});                                      
于 2011-12-23T05:40:56.360 回答