doumi1944 2013-06-16 12:22
浏览 21
已采纳

将播放列表加载到播放器并播放/提示

Ok .... This is what I am using for the standard links. Works fine as it should.

<a href= "javascript:loadNewVideo('MaQmyhkGNm0')"><img src="http://i2.ytimg.com/vi/MaQmyhkGNm0/3.jpg" width="120" height="90" /></a>

Now what I need is to have a similar setup to load a playlist into the player.
What you get is this as a link ...

PLsj-IEVUnJEyA7Qsiz4Vxxxxxxxxxxxxx

But from the api info I have seen, says that you need to give a string like this

VideoID_1,VideoID_2,VideoID_3,VideoID_4,VideoID_5

So if you cant submit the playlist, how do you get the string of video id's?

P.S. I use PHP in the back. But not the ZendFramework.

  • 写回答

2条回答 默认 最新

  • douyi3676 2013-06-17 19:59
    关注

    You can pass in either an array of video ids or a string containing a playlist id when using the playlist list type.

    The relevant API call is

    player.loadPlaylist({
      listType: 'playlist',
      list: 'PLAYLIST_ID'
    });
    

    where player is a YT.Player instance and PLAYLIST_ID is whatever you want to load.

    Here's a working example: http://jsfiddle.net/jeffposnick/yhWsG/17/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算