英文:
Can we play our YouTube channel videos in our app?
问题
Google的官方YouTube视频播放器存在许多错误,所以我使用了这个第三方库。
https://github.com/PierfrancescoSoffritti/android-youtube-player
这个库帮助我在我的应用程序中使用任何YouTube视频,只需使用YouTube视频ID,但它通过视频ID(视频网址)加载特定的视频。
例如
@Override
public void onReady(@NonNull YouTubePlayer youTubePlayer) {
String videoId = "S0Q4gqBUs7c"; <------
youTubePlayer.loadVideo(videoId, 0);
}
});
是否有办法在这个YouTube播放器中加载我们YouTube频道的最新视频。
如果有人能帮我提供Java代码来完成这个,我会很感激,我只是想学习这个以便更好地开发,谢谢!
英文:
Google's official YouTube Video Player has many bugs so I used this 3rd party library.
https://github.com/PierfrancescoSoffritti/android-youtube-player
This library helped me to use any YouTube video in my app with YouTube videoID, But it loads specific video by it's Id(video URL)
For example
@Override
public void onReady(@NonNull YouTubePlayer youTubePlayer) {
String videoId = "S0Q4gqBUs7c"; <------
youTubePlayer.loadVideo(videoId, 0);
}
});
Is there any way to load the latest video of our YouTube channel in this YouTube player.
If someone can help me in java code to do this, it will be appreciated, I just want to learn this for better development, Thanks!
答案1
得分: 0
我认为最好的方法是使用YouTube Data API 获取最后一个视频的视频ID(https://developers.google.com/youtube/v3/getting-started)。
以下是相关的StackOverflow问题(https://stackoverflow.com/a/30393572/10059386)。
英文:
I think the best would be to get the last video Id with the youtube Data-API (https://developers.google.com/youtube/v3/getting-started)
Here is a related stackoverflow question (https://stackoverflow.com/a/30393572/10059386)
专注分享java语言的经验与见解,让所有开发者获益!
评论