• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to see a video from YouTube on Iphone
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to see a video from YouTube on Iphone


  • Subject: How to see a video from YouTube on Iphone
  • From: Guillermo Moral <email@hidden>
  • Date: Fri, 27 May 2011 10:58:52 -0300

Which is the best way to show a video from YouTube on iphone like you see
when you implement MoviePlayerCotroller?

Does anyone have an example?


Thanking you in advance


An Example using MoviePlayerController

- (IBAction)playVideo:(id)sender {

    [playButton setImage:playButtonImage forState:UIControlStateNormal];

    NSString *filepath   =   [[NSBundle mainBundle]
pathForResource:@"myVideo" ofType:@"mov"];
    NSURL    *fileURL    =   [NSURL fileURLWithPath:filepath];
    MPMoviePlayerController *moviePlayerController =
[[MPMoviePlayerController alloc] initWithContentURL:fileURL];

    [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlaybackComplete:)
			name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayerController];


    [moviePlayerController.view setFrame:CGRectMake(31, 130, 477, 360)];

    [self.view addSubview:moviePlayerController.view];

    [moviePlayerController play];


}


- (void)moviePlaybackComplete:(NSNotification *)notification {

    MPMoviePlayerController *moviePlayerController = [notification object];

    [[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
			 object:moviePlayerController];

    [moviePlayerController stop];
    [moviePlayerController.view removeFromSuperview];

    [moviePlayerController autorelease];

}



Willy Moral
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to see a video from YouTube on Iphone
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Seeding random() randomly
  • Next by Date: Re: Seeding random() randomly
  • Previous by thread: Re: Adding HTML data to the general pasteboard
  • Next by thread: Re: How to see a video from YouTube on Iphone
  • Index(es):
    • Date
    • Thread