Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7870599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:39:58+00:00 2026-06-03T01:39:58+00:00

I am trying to get YouTube functioning within my iOS App. I am successfully

  • 0

I am trying to get YouTube functioning within my iOS App. I am successfully retrieving the list of videos for a particular user, but I am struggling to implement the didSelectRowAtIndexPath in order to get the selected video to embed in a separate viewController. Here is the code I am having trouble with:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
DetailViewController *detailController = [self.storyboard instantiateViewControllerWithIdentifier:@"DetailController"];

    GDataEntryBase *entry2 = [[feed entries] objectAtIndex:indexPath.row];
    videoArray = [[(GDataEntryYouTubeVideo *)entry2 mediaGroup] mediaContents];
    NSString *tempUrl = [videoArray objectAtIndex:0];
    NSLog(@"The URL is:%@",tempUrl);
    detailController.videoString = tempUrl;

    [self.navigationController pushViewController:detailController animated:YES];

}

Every time I run this, I get a breakpoint at ‘detailController.videoString = tempUrl;’

I am able to see the tempUrl string is being populated with the following via NSLog:

The URL is:GDataMediaContent 0x69c76a0: {url:https://www.youtube.com/v/s36krFdPmYQ?version=3&f=user_uploads&app=youtube_gdata type:application/x-shockwave-flash medium:video isDefault:true expression:full duration:1913}

How can I extract just the video URL from the GData API?

Thanks in advance for your responses.

I made the following changes and I am now getting a proper URL string:

GDataEntryBase *entry2 = [[feed entries] objectAtIndex:indexPath.row];
    NSArray *mediaContents = [[(GDataEntryYouTubeVideo *)entry2 mediaGroup] mediaContents];
    GDataMediaContent *flashContent = [GDataUtilities firstObjectFromArray:mediaContents withValue:@"application/x-shockwave-flash" forKeyPath:@"type"];
    NSLog(@"The URL is:%@",[flashContent URLString]);
    detailController.videoString = [flashContent URLString];

Which gives me the following from NSLog:

The URL is:https://www.youtube.com/v/s36krFdPmYQ?version=3&f=user_uploads&app=youtube_gdata

I am still however getting a breakpoint at ‘detailController.videoString = [flashContent URLString];

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:39:59+00:00Added an answer on June 3, 2026 at 1:39 am

    I was able to solve this. I added a Modal segue between the two ViewControllers and also modified my code slightly. Here is the code I ended up using after adding the segue:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        DetailViewController *detailController = [self.storyboard instantiateViewControllerWithIdentifier:@"DetailController"];
        GDataEntryBase *entry2 = [[feed entries] objectAtIndex:indexPath.row];
        NSString *title = [[entry2 title] stringValue];
        NSArray *contents = [[(GDataEntryYouTubeVideo *)entry2 mediaGroup] mediaContents];
        GDataMediaContent *flashContent = [GDataUtilities firstObjectFromArray:contents withValue:@"application/x-shockwave-flash" forKeyPath:@"type"];
        NSString *tempURL = [flashContent URLString];
    
        detailController.videoString = tempURL;
        detailController.titleString = title;
        [self.navigationController pushViewController:detailController animated:YES];
    
    }
    

    You can view the full working YouTubeDemo app code here:
    https://gist.github.com/2501684

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to launch embedded Youtube videos from a UIWebView, but get this error
I'm trying to get a list of YouTube videos in a category. This is
I'm trying to get all the videos from one user via YouTube's data API.
I'm trying to stream some youTube videos using the MPMoviePlayerController but I'm having some
I'm trying something really simple: get a list of player urls from the youtube
In my magento store I am trying to retrieve a list of youtube videos
Hy I'm trying to get all the videos from a user and put them
I am trying to play youtube videos after loading the webview. But Only Audio
I am trying to get youtube videos to be automatically embedded into a webpage.
Im trying to get the callback from this: $.getScript( 'http://gdata.youtube.com/feeds/api/videos/<?php echo $m; ?>?v=2&alt=json-in-script', function(data)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.