Intent to play YouTube playlist

后端 未结 2 1038
时光取名叫无心
时光取名叫无心 2021-01-21 17:10

I would like to start YouTube playlist from my application.

For single video this is obvious

startActivity(new Intent(Intent.ACTION_VIEW, 
                      


        
相关标签:
2条回答
  • 2021-01-21 17:45

    The best way to use YouTube functionalities in your app is to use YouTube API for Android. You can find out how to use YouTube API from the documentation and the sample app.

    If you use YouTube API, to start playlist you have to do this in your Activity:

    String PLAYLIST_ID = "UCVHFbqXqoYvEWM1Ddxl0QDg";
    
    //"this" is Context
    Intent intent = YouTubeIntents.createPlayPlaylistIntent(this, PLAYLIST_ID);
    startActivity(intent);
    

    See the method's documentation here.

    0 讨论(0)
  • 2021-01-21 17:49

    Check whether you are passing same url throughout the play list (http://www.youtube.com/watch?v=videoid). check for the value of videoid whether it is same.

    0 讨论(0)
提交回复
热议问题