JoJo Lin
JoJo Lin

Reputation: 81

How to get video link after uploading video to Youtube with Youtube API v3?

I am able to upload videos with the way described in Introduction#Uploading_Files, but how do I get a link to that uploaded video so that I can send that link to user to view ?
I found an article says you can use

[[[video mediaGroup] mediaContents] objectAtIndex:0] URLString]

to get the link in GData, but not found any article says how to do it with Youtube API v3.
Does anyone have good suggestion ?

Upvotes: 2

Views: 639

Answers (1)

JoJo Lin
JoJo Lin

Reputation: 81

It seems there is no property to get a link of uploaded video. But there is a video id returned, I compose video URL by myself:

GTLServiceTicket *ticket = [service executeQuery:query
                               completionHandler:^(GTLServiceTicket *ticket, id object, NSError *error) {
    GTLYouTubeVideo *video = (GTLYouTubeVideo *)object;
    NSString *videoURL = [NSString stringWithFormat:@"http://www.youtube.com/watch?v=%@", video.identifier];
}];

Upvotes: 3

Related Questions