the picture is snapped from Path App, u can see, In the table view,there is a video clip, when I touched on the play button, the video plays without changing to full screen.
it seems the video is Embedded in the table view?
How to do this? could u give a example? thanks
Taken from one of my projects, just adjust this to fit your needs:
NSURL *movieUrl = [NSURL fileURLWithPath:moviePath];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:movieUrl];
player.view.frame = CGRectMake(0, 0, 690, 370);
// Here is where you set the control Style like fullscreen or embedded
player.controlStyle = MPMovieControlStyleDefault;
//player.controlStyle = MPMovieControlStyleEmbedded;
//player.controlStyle = MPMovieControlStyleDefault;
//player.controlStyle = MPMovieControlStyleFullscreen;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieFinished) name:MPMoviePlayerPlaybackDidFinishNotification object:player];
UIView *movieBox = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 600, 400)];
[movieBox setBackgroundColor:[UIColor blackColor]];
[movieBox addSubview:player.view];
[self.view addSubview:movieBox];
player.scalingMode = MPMovieScalingModeAspectFit;
player.contentURL = movieUrl;
[player play];
Use HTML5
in UIWebView
for video playing as intial is poster image and on click video starts as per your requirement.
Refer this link to play video in webView.
Hope its helpful!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With