views:

28

answers:

2

i am trying to play a video from a Url with help of MPMovieplayer which loads it in the Quicktime player while i want the video to play in my application only(no background mode)?? how can i achieve that?? will playing the video in a UIWebview instead of MPMoviePlayer work?? Also when QuickTime Player loads only Audio plays and no video is displayed?? i am using the following code

NSString *videoFilepath = @"http://www.migital.com/Hemant/1.3gp";

NSURL *videoURL = [NSURL URLWithString:videoFilepath ];

MPMoviePlayerViewController *movie = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL];

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(playbackFinishedCallback:)
                                             name:MPMoviePlayerPlaybackDidFinishNotification
                                           object:movie];

[self presentMoviePlayerViewControllerAnimated:movie];
+2  A: 

you have to add movie.view to your view

GameBit
A: 

web = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];

NSString *urlAddress = @"HTTP://";


NSURL *url = [NSURL URLWithString:urlAddress];


NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[web loadRequest:requestObj];
GhostRider