Question

I am working in an android app which shows videos from a YouTube Channel.

I have the channel id and all other stuffs. But I need the video id to show the video in YouTube Player.

***eg. player.cueVideo("nCgQDjiotG0");***

When I go through the developer site again and again, I got this one -https://www.googleapis.com/youtube/v3/videos?part=id&chart=mostPopular&key={YOUR_API_KEY}

It is working perfectly returning the correct Video id to play. But I can't done it with my Channel id (There is no option for passing channel ID as parameter).

The only one url which accept the channel ID and returns snippet is this one -

https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCxUtHtpGzd0bA5rYRY7h4VQ&q=PIVideoLibrary&type=channel&key={YOUR_API_KEY}

But the id it returning is not compatible with the above method. When I run it in the device it shows "Invalid Request" Here is screen shot which is the response of the above search request.The Screen shot

So this is my question.

How can we get video id of a video from a YouTube channel to show that vedio in a youtube player integrated in the android app using YouTube api v3

Thank You.

Was it helpful?

Solution

Ya I found it.

Go to youtube developer, https://developers.google.com/youtube/v3/docs/activities/list . You can find a "TRY IT" field at middle of the page, fill the fields, you have to enter "contentDetails in the 'part' field to obtain video id. Then enter your channel id in the respective field. Execute the query, you can find the video id in the XML result. enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top