YouTube intent, error 400

2020-04-02 07:26发布

I found that I can start a YouTube video in stock YouTube player this way:

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:U79wVTdnMpw")); 
startActivity(i); 

But it doesn't work. The YouTube player is started, but I get an error:

There was a problem with the network [400]

I have updated the YouTube app but nothing changes.

I am using Android ICS 4.0.1.

6条回答
可以哭但决不认输i
2楼-- · 2020-04-02 07:49

I found the answer on this Google product forums which helped to solve my problem - which was exactly the problem you're experiencing :)

SOLUTION: Give ONLY the YouTube ID and not the entire YouTube URL to the loadVideo() function.

查看更多
太酷不给撩
3楼-- · 2020-04-02 07:54

Please chaeck video id is proper parse in json and it perfectly going with intent

查看更多
Juvenile、少年°
4楼-- · 2020-04-02 08:04

Youtube 400 network error: Turn off and on Clear data and cache

Settings applications manage applications clear data and cache

You will need to log in each time. Unfortunately I still can not post but can share comment on g+

查看更多
叼着烟拽天下
5楼-- · 2020-04-02 08:07

It seems that this is a common problem with the youtube app, also described here and here. The only answer I found is to log out of the youtube app and then log in again.

查看更多
祖国的老花朵
6楼-- · 2020-04-02 08:07

Click the share button below the youtube video -> It will show the link -> Use this link.

Note: Not use the url of youtube

Screenshot for sample link sharing:

enter image description here

查看更多
趁早两清
7楼-- · 2020-04-02 08:15

On loadvideo don't put:

loadvideo(https://www.youtube.com/watch?v=gQy4I5y1ldg12)

just put

loadvideo(gQy4I5y1ldg12);
查看更多
登录 后发表回答