How can i pass VIDEO_ID along with PLAYLIST_ID in cuePlaylist(…)

只愿长相守 提交于 2019-12-23 04:54:44

问题


I am using cuePlaylist() so getting previous and next buttons as default functionality of Youtube player

I am also allowing user to tap on any of the list item (listview contains youtube playlist videos)

But when I am passing VIDEO_ID along with PLAYLIST_ID in that case I am getting There was a problem with the network[400]

 // PLAYLIST_ID : PLP7qPet500dfglA7FFTxBmB_snxCaMHDJ
 // strVideoID : 7OEprLI1rIM

 String sn = strVideoID+PLAYLIST_ID; 
 youTubePlayer.cuePlaylist(sn);

And using loadVideo(...) I am able to play that particular video but not getting PREV and NEXT buttons.

 youTubePlayer.loadVideo(strVideoID);

回答1:


You should always check the documentation first, https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubePlayer

I think following method can fit to your needs

loadPlaylist (String playlistId, int startIndex, int timeMillis)

Ref: https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubePlayer#loadPlaylist%28java.lang.String,%20int,%20int%29



来源:https://stackoverflow.com/questions/34260715/how-can-i-pass-video-id-along-with-playlist-id-in-cueplaylist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!