如何启动 Youtube 应用程序来打开频道?
我想从我的应用程序访问 youtube 以打开频道。我已经寻找了一个解决方案,但我刚刚找到了如何打开/流式传输视频:
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:VIDEO_ID"));
startActivity(i);
但是直接打开频道怎么样?
非常感谢。
I want to access from my application to youtube to open a channel. I've searched for a solution but i just found how to open/stream a video :
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:VIDEO_ID"));
startActivity(i);
But what about opening directly a channel?
Thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您使用 YouTube 频道的网址,例如:http://www.youtube.com/user/JustinBieberVEVO
应该为您提供打开 YouTube 到给定频道的选项。
希望这有帮助!
if you use the url of a youtube channel such as: http://www.youtube.com/user/JustinBieberVEVO
this should give you the option to open youtube to the given channel.
hope this helps!
我知道这个答案已经晚了,但我还是想分享这个。这对我有用:
vnd.youtube://user/channel/channel_id
这会直接在 YouTube 应用中打开频道。无需询问用户。
更新
没有包含任何代码,因为我正在使用React Native,也许人们正在寻找本机代码。无论如何,你走吧:
但是,我认为在本机代码中应该是这样的:
我对本机代码不太熟悉,所以它可能是错误的,但应该像指南一样工作。
I know this answer is late and such but i wanted to share this anyway. This worked for me:
vnd.youtube://user/channel/channel_id
This opens the channel directly in the youtube app. Without asking the user.
Update
Didn't include any code because i was using React Native, and maybe people is looking for native code. Anyway here you go:
But, i think in native code it should be something like this:
I'm not too familiarized with native code so it may be wrong, but should work like a guide.
对于自定义 URL
vnd.youtube://c/channel_permalink
For custon URL
vnd.youtube://c/channel_permalink