使用jwplayer + HTML5播放视频后再次显示海报图像

时间:2012-05-07 19:34:14

标签: html5 html5-video jwplayer

如何使用jwplayer在视频结束后再次显示海报图片?这是一段代码:

<video
    src="video/Motion.mp4"
    height="860"
    id="video"
    width="620"
    poster="img/poster.png"
    onclick="play();">
    </video>

    <script type="text/javascript">
    jwplayer("video").setup({
    flashplayer: "jwplayer/player.swf",
    controlbar: "none",
    });

    jwplayer().getPlugin("display").hide();
    </script>

1 个答案:

答案 0 :(得分:0)

您是否尝试过利用onComplete事件?

http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12540/javascript-api-reference#Events

<script type="text/javascript">
  jwplayer("video").setup({
  flashplayer: "jwplayer/player.swf",
  controlbar: "none",
  events: {
    onComplete: function() {
      alert('video has finished..do something here..');
    }
  });
</script>