如何在JWPlayer PHP上播放youtube视频的对象

时间:2017-05-12 01:50:16

标签: php jwplayer

我在youtube视频键上有这个对象:

{
  "id": 321612,
  "results": [
    {
      "id": "589219bfc3a368096a009a41",
      "iso_639_1": "en",
      "iso_3166_1": "US",
      "key": "tWapqpCEO7Y",
      "name": "Belle Motion Poster",
      "site": "YouTube",
      "size": 720,
      "type": "Clip"
    },
    {
      "id": "5743a07a9251414c0d000605",
      "iso_639_1": "en",
      "iso_3166_1": "US",
      "key": "c38r-SAnTWM",
      "name": "Official US Teaser Trailer",
      "site": "YouTube",
      "size": 1080,
      "type": "Trailer"
    },
    {
      "id": "589219d3c3a36809660098dd",
      "iso_639_1": "en",
      "iso_3166_1": "US",
      "key": "bgeSXHvPoBI",
      "name": "Lumiere Motion Poster",
      "site": "YouTube",
      "size": 720,
      "type": "Clip"
    }
}

我想要做的就是在Jwplayer上播放这个播放列表。

<div id="myElement"></div>
<script type="text/javascript">
var playerInstance = jwplayer("myElement");
playerInstance.setup({
   'image': '{{$movie->poster_path}}',
    file: '//www.youtube.com/watch?v={{reset($movievideo)->key}}',
});
</script>

如何实现这一点,以便当第一个视频结束时,播放对象列表中的下一个?

0 个答案:

没有答案