Is it possible to create my own youtube playlist with Youtube Api

Is it possible to create my own YouTube playlist with YouTube API?

I would like to take a list of YouTube id's, and append the videos to my page.

Is it possible?

Thank you


是的,您可以使用播放列表创建播放列表 - >插入。


HTML:

<div id="player"></div>

Javascript:

      var tag = document.createElement('script');

      tag.src = "https://www.youtube.com/iframe_api";
      var firstScriptTag = document.getElementsByTagName('script')[0];
      firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);


      var player;
      function onYouTubeIframeAPIReady() {
        player = new YT.Player('player', {
          height: '390',
          width: '640',
          videoId: 'M7lc1UVf-VE',
          events: {
            'onReady': onPlayerReady
          }
        });
      }

      function onPlayerReady(event) {
        //here you load your playlist
        event.target.loadPlaylist(playlist: [youtubeIds]);
      }
链接地址: http://www.djcxy.com/p/28952.html

上一篇: Youtube api不显示少数视频的播放列表缩略图

下一篇: 是否有可能通过Youtube Api创建我自己的YouTube播放列表