代码之家  ›  专栏  ›  技术社区  ›  Awais_Butt

我想嵌入youtube视频并显示库/播放列表[关闭]

  •  -1
  • Awais_Butt  · 技术社区  · 7 年前

    <iframe> 但它只播放了一段视频。我怎样才能从我们的频道播放所有的维也纳人?

    <div>
    <iframe src="https://www.youtube.com/embed/Wyq6YeoM2ZA?ecver=2" width="640" height="360" frameborder="5" style="position:absolute;width:70%;height:60%;left:15%" allowfullscreen playlist></iframe>
    </div>
    
    2 回复  |  直到 7 年前
        1
  •  1
  •   Tobias Alt    7 年前

    你可以在Youtube API中观看。它在几种编程语言中都有很好的记录。以下是javascript中的一个片段:

    // Sample js code for playlists.list
    
    // See full sample for buildApiRequest() code, which is not 
    // specific to a particular youtube or youtube method.
    
    buildApiRequest('GET',
                    '/youtube/v3/playlists',
                    {'channelId': 'UC_x5XG1OV2P6uZZ5FSM9Ttw',
                     'maxResults': '25',
                     'part': 'snippet,contentDetails'});
    

    https://developers.google.com/youtube/v3/docs/playlists/list .

        2
  •  0
  •   Max Pringle    7 年前

    <iframe src="http://www.youtube.com/embed/?listType=user_uploads&list=YOURCHANNELNAME" width="480" height="400"></iframe>