YouTube intent, error 400
Asked Answered
Q

6

11

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.

Quirita answered 5/12, 2012 at 19:48 Comment(2)
accept the which one answer helps you.. all new users may be confusedHautboy
3 years later, I don't think @Quirita will ever accept an answer :(Fayfayal
F
35

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.

Fayfayal answered 14/5, 2014 at 11:46 Comment(0)
P
6

On loadvideo don't put:

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

just put

loadvideo(gQy4I5y1ldg12);
Putter answered 24/6, 2017 at 14:55 Comment(0)
N
0

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.

Nondescript answered 5/12, 2012 at 20:49 Comment(0)
H
0

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

Hautboy answered 10/6, 2016 at 11:58 Comment(0)
F
0

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+

Fenny answered 27/8, 2016 at 7:9 Comment(0)
G
0

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

Gingergingerbread answered 25/1, 2018 at 5:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.