我正在使用以下视频设置jwPlayer流:http://www.schooltv.nl/beeldbank/clip/20101210_dino01

因为该文件托管在该网站上,所以我必须使用其基础结构(带有xml播放列表和自己的jwPlayer,版本5.7)将其嵌入。

除了连续重复之外,我已完成所有工作。 “重复:始终”选项不起作用。 onComplete事件也不会触发。这是代码,几乎类似于他们自己的嵌入代码:
http://dev.jasperheeffer.nl/dinovid/schooltv_new.html

onTime事件确实可以在我的PC上重复执行(在代码中已注释)。但可惜的是,它似乎并没有在需要安装此应用程序的PC上启动。为了进行调试,我将控制栏和播放列表添加到播放器。

<html>
<head>
    <title>NMB Video</title>
    <link rel="stylesheet" href="assets/nmb_video.css">
    <script type="text/javascript" src="assets/jquery.js"></script>
    <script type='text/javascript' src='http://www.schooltv.nl/beeldbank/shared/applications/jwplayer/js/jwplayer.js'></script>
    <script type="text/javascript" src="http://www.ntr.nl/static/js/loadAAPIVideo.js"></script>


<script type='text/javascript'>

$(function() {
    loadAAPIVideoUrl("20101210_dino01",function(streamid,streamurl){
        jwplayer("stvbb3054251").setup({
            link:"http://www.schooltv.nl/beeldbank/clip/20101210_dino01",
            width: 800,
            height: 500,
            image: "http://www.schooltv.nl/beeldbank/mmbase/images/3683800/20101210_dino01.jpg",
            file: streamurl,
            modes: [
                {type: "flash",
                  src: "http://www.schooltv.nl/beeldbank/shared/applications/jwplayer/swf/NTRPlayer.swf",
                  config:{
                      provider: "http://www.schooltv.nl/beeldbank/shared/applications/jwplayer/swf/adaptiveProvider.swf"
                  }
                },
                {type: "html5"
                }
            ],
            title:'Dinosaurus op de vlucht',
            author:'NTR',
            date:'17-01-2011',
            description:'Timo de T-rex wil een ei eten. Dat is niet zonder gevaar.',
            controlbar: 'top',
            'playlist.position': 'top',
            image:'http://www.schooltv.nl/beeldbank/mmbase/images/3683801/20101210_dino01.jpg',

            repeat: 'always',
            dock: false,
            autostart: true,
            fullscreen:true,

            events: {
            /*
                onTime: function(event) {
                    if (event.position > 280) {
                    alert('time!'); jwplayer().seek(0).play(true); }
                },
                */
                onComplete: function() {
                    alert('complete');
                    jwplayer().seek(0).play(true);
                }
            }
        });
    });
});

</script>

</head>
<body style="overflow: hidden;">
<!--
<div id="standby">
    <h1><span>SchoolTV: Timo de T-Rex</span><br>Raak het scherm aan om de film te bekijken.</h1>
</div>
-->
<div class="player flash schooltv_beeldbank mediaplayer">
  <div id="ivpd3054251" class="ivplayerdata" style="display:none;"></div>
  <video id="stvbb3054251" controls width="348" height="178" poster="http://www.schooltv.nl/beeldbank/mmbase/images/3683800/20101210_dino01.jpg">
  </video>
</div>
</body>
</html>

最佳答案

我不确定为什么没有在这里开火。

这是一个非常简单的示例,尽管您可以简单地复制/粘贴,但确实会触发:

<html>
<head>
<title>Test Page</title>
</head>
<body>
<script type="text/javascript" src="http://player.longtailvideo.com/jwplayer.js"></script>
<div id="player"></div>
<script type="text/javascript">
    jwplayer("player").setup({
            file: "http://www.longtailvideo.com/jw/upload/bunny.mp4",
            flashplayer: "http://player.longtailvideo.com/player.swf",
            width: 465,
            height: 300,
            events:{
            onComplete: function() {
                alert("hi!");
                }
            }
    });
</script>
</body>
</html>

07-24 16:20