Xamarin Droid YouTube API - Get Video Metadata - android

I'm working on a Xamarin project that uses YouTube API v3. I'm able to play videos but I want to display separately some metadata like view's counter, video name and publishing time. Is there any way to get this information?
Any help would be gratefully appreciated.

You can use YouTube API v3 itself, take a look at the Videos Docs. The resource returns a JSON blob, and you'll find the view count under statistics.viewCount.

Related

Search video with YouTube API on Android

I'm trying to make a new application that will help people hear music together.
One problem I noticed is that the people need to get the YouTube code of each song or video they want to hear.
I kind of fixed this problem by using MySQL database with names and codes of songs, then all what the user need to do is to find the YouTube video and click on share with my application, it sends the link and the name of the video to the database and then users can search there for the song they want to play. However, I want to get rid of that, too.
Is there some way to search for a video on YouTube with the API?
I found this link to open source code on Google Developers https://developers.google.com/youtube/v3/docs/search/list#examples
But it just doesn't work.
You can use this:
https://www.googleapis.com/youtube/v3/search?part=snippet&q=eminem&type=video&key=<key>
Change the parameters to get what you actually need, but you need an API key from https://console.developers.google.com/ to make this work.
https://www.googleapis.com/youtube/v3/search?key={your_key_here}&channelId={channel_id_here}&part=snippet,id&order=date&maxResults=20
you can use above url for searching videos.

Youtube Data api V3, Getting video dimension

I am working on Youtube Data API. And I am looking for a way where I cn fetch all videos from particular channelId along with its video details like height,width and duration.
Now after searching for api docs I found search api to which provides the data from channel id. But the problem is , it only gives the content part. e.g. It provides very few details.
I found other ways which is provided in gdata api and youtube api v2 which is deprecated and I do not want to use them as they are deprecated.
Anyone has any idea, or better way where I can get list of video from channel id along with video detail(height,width,duration) in a single api hit.
Right now I am using URL something like this
GET https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=<SomeChannelId>&maxResults=50&order=date&key={YOUR_API_KEY}

play youtube in VideoView

please i want way to play youtube video in videoview
I looked at a lot of solutions and pages, but I can not find an answer to this question
Please give me a definite solution to this question
Thank you
Hay behalf of VideoView its much better to use Google's YouTube Android Player API, if your need is specific to play YouTube video, Using this you can directly embed all of the functionality of YouTube in your application.
You can do it by simply following below steps_
You should target your application to at least Android 2.2. ( e.g., android:minSdkVersion="8" or API level 8)
Next you need to Registering your application to get an API key. It's free, you need your Google account to get it. You need SHA1 key of your application that you can Get SHA1 key for your application.
Download - YouTube Android Player API and Unzip the compressed folder, locate the YouTubeAndroidPlayerApi.jar, and add it to your project's /libs folder.
Add INTERNET to your manifest (<uses-permission android:name="android.permission.INTERNET"></uses-permission>)
That`s all you are completely set to get a ride on. You can find YouTube demo Sample Applications, youtube - android-player
.
I hope this will help you and all! :)
YouTube has an official YouTube Android Player API specifically designed to play YouTube videos within your applications. You may consider looking at YouTubePlayerFragment which allows you to easily embed a video player.

How I can upload video on Youtube from my android application?

I am confused in creating account on google for it? Please anyone tell me whole procedure for uploading video on youtube in easily steps . & then how to get that URl from youtube in my android application?
See this
http://code.google.com/p/ytd-android/
You may use Youtube API do upload video, check here https://developers.google.com/youtube/2.0/developers_guide_protocol_video_feeds#User_Uploaded_Videos
The sample code for the YouTube Direct Android application that Albin linked to is the canonical example right now.
As soon as v3 of the Data API is released, though, that will be the preferred way of handling uploads from a native Android application, since the Java Google APIs client library will work with both Android and v3 (the current Java GData client library works with v2, but not Android).
(To answer the next question, no, I can't share a release date for v3 of the API.)

how to access youtube raw video file and play it in android youtube api

i want to display all the videos uploaded by a user, say cnn,
in my own android app, i will have a webview, and when user clicks on this video (cnn), it will play that particular youtube video in android's native video player, once video finishes, it will return to my app (webview where user lastly clicked)
my question is, which part of the google youtube data api should i feed to the intent? using the example below?
https://developers.google.com/youtube/2.0/developers_guide_protocol_understanding_video_feeds#Understanding_Video_Entries
can someone give me a CONCRETE example, no abbreviation or whatsoever, a link i should put in the intent?
i am confused because examples i found has .mp4 extension etc, which android will understand the intent that a video is requested to play.
but in the link provided above, there is no link to the raw file, i.e. no URI ends with .mp4
please help
By going thorough the documentation about youtube api and testing the demo App i think in-order make a app using youtube-api need
1) Developer key
2)Phone installed with latest version of youtube application (i think Actually youtube-api use some supports of youtube app to play video)
3)By using this api video will stay inside your app. but it use support from youtube app to play video
Note:- if am wrong Correct me

Categories

Resources