Android的YouTube应用程序播放视频意向应用程序、意向、视频、Android

2023-09-11 10:57:17 作者:恨自己没用

我创建了一个应用程序,你可以下载YouTube视频的机器人。现在,我希望它这样,如果你在YouTube的本机应用程序中播放视频,你可以下载它。要做到这一点,我需要知道的意图是,YouTube的本机应用程序推出,以发挥YouTube应用。 我能做到这一点easially,如果我对我的模拟器在YouTube方案,所以我的第一个问题是: 1.我可以下载YouTube应用为我的模拟器,或... 2.什么是所使用的意图,当用户选择要播放的视频

I have created a app where you can download YouTube videos for android. Now, I want it so that if you play a video in the YouTube native app you can download it too. To do this, I need to know the Intent that the YouTube native app puts out in order to play the YouTube app. I could do this easially if I had the YouTube program on my emulator, so my 1st question is: 1. Can I download the YouTube app for my emulator, or... 2. What is the intent used when the user selects a video for playback.

推荐答案

这将工作的设备上,但不是每个 Lemmy的答案。

This will work on a device but not the emulator per Lemmy's answer.

startActivity(新意图(Intent.ACTION_VIEW,Uri.parse(http://www.youtube.com/watch?v=cxLG2wtE7TM)));