Retrieving Youtube video metadata - gdata iphone objective C

213 views
Skip to first unread message

Frankee

unread,
Apr 24, 2011, 2:03:04 AM4/24/11
to Google Data APIs Objective-C Client Library Discussion
I know the answer is right under my nose but i've spent the better
half of this weekend looking for it and I can not find the information
in the google / youtube provided documentation.

I am currently developing an application that grabs a list of videos
associated with a youtube user. Once it gets the list of videos, I am
trying to incorporate a UIWebView to launch the video inside the
application without leaving it.

I am basically using option two from this website...

http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html

Now I have everything working fine (thanks to the examples provided by
google / youtube) except I am retrieving the HTML link for the video
and putting into the HTML load string, which doesn't work.

I have manually gone and entered the metadata into my program and it
works fine.

So the only thing stopping me is I am not retrieving the video
metadata properly from the entry...

I am currently doing this from the UITableView...

GDataEntryBase *entry = [[feed entries] objectAtIndex:indexPath.row];
NSString *videoLink = [[entry HTMLLink] href];

Can someone please point me in the right direction to grab the
metadata.
It would be very much appreciated!

Thank you.

Greg Robbins

unread,
Apr 24, 2011, 3:09:42 AM4/24/11
to gdata-objec...@googlegroups.com
The mediaContent element for the swf URL has the yt:format attribute with the value 5, according to


so given a video entry (GDataEntryYouTubeVideo), the URL is available as

  GDataYouTubeMediaGroup *mediaGroup = [videoEntry mediaGroup];
  GDataMediaContent *mediaContent = [mediaGroup mediaContentWithFormatNumber:5];
  NSString *urlString = [mediaContent URLString];
  if (urlString) {
    NSURL *url = [NSURL URLWithString:urlString];
  }

Frankee

unread,
Apr 24, 2011, 11:30:44 AM4/24/11
to Google Data APIs Objective-C Client Library Discussion
Thank you sir!

You are a gentleman and a scholar!

Got everything working now!

Yea, i was not looking anywhere near the media group stuff...

On Apr 24, 3:09 am, Greg Robbins <grobb...@google.com> wrote:
> The mediaContent element for the swf URL has the yt:format attribute with
> the value 5, according to
>
> http://code.google.com/apis/youtube/2.0/reference.html#youtube_data_a...
Reply all
Reply to author
Forward
0 new messages