Tutorial details

Playing Videos | App Code for Sale | Preview

Playing Videos | iOS Tutorial

How to play video files in your apps

Overview PAGE TOP

Reference: http://www.geekylemon.com/WEBPROTECT-xcodetutorialplayvideo.htm

In this tutorial i will be showing you how to play video files in your apps

Features:

  • 1 Round Rect Button
  • 1 Video Files

Playing videos in your application can give so much more information than a standard pages of text take youtube for example users are able to share and express information in a way a written page cannot

ViewController.h PAGE TOP

#import <MediaPlayer/MediaPlayer.h>
@interface ViewController :UIViewController {
}
-(IBAction)playvideo;
@end

ViewController.m PAGE TOP

@implementation ViewController
-(IBAction)playvideo {
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]
    pathForResource:@"Video1" ofType:@"mp4"]];
MPMoviePlayerViewController *playercontroller = [[MPMoviePlayerViewController alloc] 
    initWithContentURL:url];
    [self presentMoviePlayerViewControllerAnimated:playercontroller];
    playercontroller.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
    [playercontroller.moviePlayer play];
    [playercontroller release];
    playercontroller = nil;
}
@end

Reference PAGE TOP

http://www.geekylemon.com/WEBPROTECT-xcodetutorialplayvideo.htm

0 Comments Leave a comment

Please login in order to leave a comment.

Newest first
!

Sign-in to your Chupamobile Account.

The Easiest way to Launch your next App or Game.

Join Chupamobile and get instant access to thousands of ready made App and Game Templates.

Creating an account means you’re okay with Chupamobile’s Terms of Service and Privacy Policy.