I am using the YouTube Player API.
I want to make my own custom playlist directly in my code (not to use playlist ID from youtube)
Here is my playlist code which doesn't work
player.loadPlaylist({
list:['mGalEx6ufUw', 'TaCUBtzKAnA', '4v8SPz4VfsU'],
listType: 'playlist',
index:0,
startSeconds:0,
suggestedQuality:'medium'
});
As the documentation says I can pass playlist ID or array with video IDs to parameter list, but it's not working.
If I write playlist ID instead of the array with video IDs it works.
I solved this.
I think the API documentation seems to be wrong.
playlist ID and video IDs in loadPlaylist function should be used in a different way.
function loadPlaylist_playlist_id() {
player.loadPlaylist({
'list': 'UUPW9TMt0le6orPKdDwLR93w',
'listType': 'playlist',
'index': 0,
'startSeconds': 0,
'suggestedQuality': 'small'
});
}
function loadPlaylist_video_ids() {
player.loadPlaylist({
'playlist': ['9HPiBJBCOq8', 'Mp4D0oHEnjc', '8y1D8KGtHfQ', 'jEEF_50sBrI'],
'listType': 'playlist',
'index': 0,
'startSeconds': 0,
'suggestedQuality': 'small'
});
}
http://1004lucifer.blogspot.kr/2015/04/youtube-loadplaylist-function-issues-of.html
I've found the answer for this problem with the help of Jeffrey Posnick in Google Groups.
You can make this working with the argument syntax instead of object syntax. More info here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With