Videojs播放列表不起作用

时间:2016-08-29 19:20:07

标签: video.js playlist

当我尝试使用视频js的播放列表插件时遇到问题:

<!doctype html>
<html>

<head>
  <meta charset="UTF-8">
  <title>Playlist Tester Perform</title>
  <style type="text/css">
    .video-js {
      float: left;
      margin: 15px;
      width: 440px;
      height: 280px;
    }
    .vjs-playlist {
      width: 250px;
      float: left;
      margin: 15px;
    }
  </style>
</head>
<body>
  <video id="myPlayerID"
    data-account="3676484087001"
    data-player="04ac0699-ca6b-449b-a2b6-0f14b4a7893b"
    data-embed="default"
    class="video-js" controls></video>

  <ol class="vjs-playlist"></ol>

  <script src="//players.brightcove.net/3676484087001/04ac0699-ca6b-449b-a2b6-0f14b4a7893b_default/index.min.js"></script>

  <script type="text/javascript">
    videojs('myPlayerID').ready(function () {
      var myPlayer = this;
      myPlayer.playlist([{
        "sources": [{
          "src": "http://solutions.brightcove.com/bcls/assets/videos/Sea_SeaHorse.mp4", "type": "video/mp4"
        }],
        "name": "Seahorse",
        "thumbnail": "http://solutions.brightcove.com/bcls/assets/images/Sea_Seahorse_poster.png",
        "poster": "http://solutions.brightcove.com/bcls/assets/images/Sea_Seahorse_poster.png"
      }, {
        "sources": [{
          "src": "http://solutions.brightcove.com/bcls/assets/videos/Sea_Anemone.mp4", "type": "video/mp4"
        }],
        "name": "Sea Anemone",
        "thumbnail": "http://solutions.brightcove.com/bcls/assets/images/Sea_Anemone_poster.png",
        "poster": "http://solutions.brightcove.com/bcls/assets/images/Sea_Anemone_poster.png"
      }, {
        "sources": [{
          "src": "http://solutions.brightcove.com/bcls/assets/videos/Tiger.mp4", "type": "video/mp4"
        }],
        "name": "Tiger",
        "thumbnail": "http://solutions.brightcove.com/bcls/assets/images/Tiger_poster.png",
        "poster": "http://solutions.brightcove.com/bcls/assets/images/Tiger_poster.png"
      }, {
        "sources": [{
          "src": "http://solutions.brightcove.com/bcls/assets/videos/Sea_ClownFish.mp4", "type": "video/mp4"
        }],
        "name": "Clownfish",
        "thumbnail": "http://solutions.brightcove.com/bcls/assets/images/Sea_ClownFish_poster.png",
        "poster": "http://solutions.brightcove.com/bcls/assets/images/Sea_ClownFish_poster.png"
      }, {
        "sources": [{
          "src": "http://solutions.brightcove.com/bcls/assets/videos/Sea_LionFish.mp4", "type": "video/mp4"
        }],
        "name": "Lionfish",
        "thumbnail": "http://solutions.brightcove.com/bcls/assets/images/Sea_LionFish_poster.png",
        "poster": "http://solutions.brightcove.com/bcls/assets/images/Sea_LionFish_poster.png"
      }]);
    });
  </script>
</body>

</html>

当我将视频链接更改为我的本地文件夹时(&#34; src&#34;:&#34; /files/convert/videos/38472531Test.mp4",&#34;输入&#34;: &#34; video / mp4&#34;),播放列表不会前进到下一个视频。我认为这是ffmpeg转换的问题,但我不确定。

PD:问题仅在播放列表中,而不在于播放

1 个答案:

答案 0 :(得分:0)

我刚刚遇到同样的问题。我开始研究如果我将视频文件的网址设置为http://myip/path to video file而不是给它一个本地链接到文件我的开始自动播放。这是你的情况吗?

我认为这是播放列表插件中的一个错误,但在我的情况下似乎可以解决这个问题。