1 | <script src="https://apis.google.com/js/client.js?onload=function"></script> |
1 2 3 4 5 6 | function YouTubePlaylist(id, entries) { this.id = id; this.entries = entries; this.currently_playing = 0; this.randomizer = false; } |
1 2 3 4 | var requestOptions = { playlistId: playlist_id, part:'contentDetails,snippet' }; |
1 | request.execute(function(response) {}); |
1 2 3 4 5 6 7 8 9 10 11 | var entries = []; $.each( response.items, function( key, val ) { var entry = {}; entry.video_id = val.snippet.resourceId.videoId; entry.image_src = val.snippet.thumbnails.medium.url; entry.title = val.snippet.title; entry.note = val.contentDetails.note; entries.push(entry); }); |
1 | window[playlist_id] = new YouTubePlaylist(playlistId, entries); |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |