Youtube embedded playlist diplays playall button instead of the first video

I have an embedded Youtube Playlist which used to work fine for the past 9 months or so. It displays the first video of the playlist and we put a new video to the front of the list every few days whenever we have a new video to show.

Over the past few days Youtube has stopped displaying the first video of the playlist and instead it is displaying a 'Play all' button. Why has this suddenly started to happen?

We didn't change any of the embedded youtube parameters.

UPDATE

Just to clarify. Instead of the embed image of the first video I am getting just a black screen with the Play All button and the Play symbol on top of it. We tried changing videos and putting new ones in all in vain. Clicking on Play All then starts the video embedded in the player.


It does look like there is something not quite right happening when embedding a playlist with the <iframe> embed option. In addition to the issues you mention, it looks like when you finally do start playing the list, it is starting at index 1 (ie the 2nd video) rather than index 0. Might be worth seeing if a ticket has been logged referencing this behavior.

I can confirm that using the iframe API will achieve the desired results: something like this:

<!DOCTYPE html>
<html>
  <body>
    <div id="player"></div>
    <script>
      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: '',
          events: {
            'onReady': onPlayerReady 
          }
        });
      }
      function onPlayerReady(event) {
        player.cuePlaylist({'listType':'playlist','list':'PLE2714DC8F2BA092D'});
      }
    </script>
  </body>
</html>

The poster for the first video in the playlist loads, and once you start playing it, then the playlist toolbar becomes available along the bottom for navigating to other videos in the list.

链接地址: http://www.djcxy.com/p/47454.html

上一篇: iOS Youtube嵌入式视频播放列表

下一篇: Youtube嵌入式播放列表插入播放按钮而不是第一个视频