Youtube intent starts in browser android
Asked Answered
B

2

2

I have followed a tutorial on how to use the youtube gdata. Populating a listview with videos from youtube and a onclick. The source code is availeable from this site: http://blog.blundell-apps.com/click-item-in-a-listview-to-show-youtube-video/

On the onclick somethings seems to go wrong. It should start the url of the video, but it only goes to the webrowser and youtube.com

Can somebody take a look at it ?

Edit:

Everything is working now. It seems like using the JSON player/default instead of player/mobile launched the intent correctly.

Bateau answered 8/5, 2012 at 17:9 Comment(2)
Are you running this on a device or emulator? This might work fine on a deviceUsurer
If you are using an exact copy of the source code that you linked to and the app is not functioning as promised, this is an excellent question for Blundell since they wrote the APIs used in their own example.Semidiurnal
W
2

It seems as though the URL chosen in the example source you linked isn't a good one to use for this purpose. If you look through the source of GetYoutubeUserVideosTask, you'll notice that the value they pull out of the JSON for url is the player->default or player->mobile value from each object in the items array, which does just load a web page if you click on it.

You might try modifying the example to pull out one of the content urls from that JSON object instead, which should load the video player directly.

HTH

Windjammer answered 8/5, 2012 at 17:56 Comment(1)
Thx, now it is working. I am using the default instead of the mobile value from the JSON.Bateau
F
0

The Youtube app is only supposed to be used with special ROMs. So you can't run them in an OpenSource-ROM, like the one used in the Emulator, unfortunately.

Frame answered 8/5, 2012 at 17:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.