我一直在玩的YouTube與youtube嵌入播放列表功能與JavaScript。嵌入youtube播放列表與側列表托盤
到目前爲止,當我嵌入播放列表,它看起來是這樣的:
http://postimage.org/image/vk6fv56yx/
藍色圓圈顯示在播放列表中的項目數和點擊時的縮略圖顯示。
當視頻開始播放是necesary點擊播放按鈕,列表顯示,像這樣:
http://postimage.org/image/ezzxpy7pn/
但我希望玩家展現像它顯示的YouTube網頁上,像這樣的:
http://postimage.org/image/4suta8kuh/
現在這是代碼即時通訊使用:
<script>
// Load the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// Replace the 'ytplayer' element with an <iframe> and
// YouTube player after the API code downloads.
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('ytplayer', {
height: '390',
width: '640',
videoId: 'n2ISkJZC6DI',
playerVars: {
listType:'playlist',
list: 'PL546E6163151751EE'
},
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
function onPlayerReady(){
alert('player ready');
}
function onPlayerStateChange(){
alert('player changed');
}
</script>
它很棒!但我想知道是否有方法更改播放列表托盤的視圖。
非常感謝您的幫助鄉親:)
我認爲這將有助於你:http://tcuttrissweb.wordpress.com/2012/02/17/2012-embed-your-youtube-channel- into-your-website /您可以看看Simone Gianni的原始代碼或Cuttriss所做的修改,這兩個修改都可以在上面的URL中引用的jsfiddle.net上找到。 – user2041185 2013-07-10 15:55:30
這是很久以前,我所做的就是竊取youtube的css的一方嘗試,並使用API來檢索播放列表...和平的蛋糕:3 – RicardoE 2013-07-11 21:58:27
我在哪裏可以找到youtube css顯示此列表? – sQuijeW 2013-08-20 16:56:36