Playing a video on startup of app without controls?
I want to make an app that simply plays a video on startup of an application, but doesn't show all the controls, even if the screen is tapped. I would do this myself, but I have no idea how to write the codes and stuff. Could someone please write the code for me and post it here? Also, could you tell me where to paste the code in the SDK? Thanks, I hope I haven't tainted you with my newbity.
I want to make an app that simply plays a video on startup of an application, but doesn't show all the controls, even if the screen is tapped. I would do this myself, but I have no idea how to write the codes and stuff. Could someone please write the code for me and post it here? Also, could you tell me where to paste the code in the SDK? Thanks, I hope I haven't tainted you with my newbity.
Copying and pasting code is not the way to learn, or to write an application. I'd look into using the MPMoviePlayerController class.
I want to make an app that simply plays a video on startup of an application, but doesn't show all the controls, even if the screen is tapped. I would do this myself, but I have no idea how to write the codes and stuff. Could someone please write the code for me and post it here? Also, could you tell me where to paste the code in the SDK? Thanks, I hope I haven't tainted you with my newbity.
I figured out how to make our app play a full-screen video without controls, and dismiss the video when you tap the screen. It was kinda tricky.
No, I'm not going to post the code and tell you where to paste it in. It's not that simple. Your question is the equivalent of asking somebody to explain where to cut in order to perform an appendectomy.
You'd need to figure out how to adapt it to your needs. It would involve adding frameworks to your app, including headers, adding protocols, and various other things. Based on the level of questions you're asking, you would have no idea how to do those things, and would make helping you extremely painful.
You either need to learn the fundamentals enough to understand the steps involved, or hire somebody to do it for you.
If you would like to hire our company we can add these features to your app. I'm sure there are others on this forum who are also available for hire.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
You'd need to figure out how to adapt it to your needs. It would involve adding frameworks to your app, including headers, adding protocols, and various other things. Based on the level of questions you're asking, you would have no idea how to do those things, and would make helping you extremely painful.
The app I'm trying to make won't have any other features other than playing a video, and I don't want it to dismiss when tapped. Could you please just post the code here, and I'll just figure out the rest? I promise I won't cause you any pain.
The app I'm trying to make won't have any other features other than playing a video, and I don't want it to dismiss when tapped. Could you please just post the code here, and I'll just figure out the rest? I promise I won't cause you any pain.
It's about 40 lines of code. If you are not an experienced iOS developer I doubt it will be very useful to you. I'm providing the code below "as is". I'll answer questions about it and help you get it working in your program - if you hire me by the hour to do so.
Sorry if that seems harsh, but I sense that otherwise this could involve dozens of questions and answers, and I'm not signing up for that.
Code:
- (IBAction) videoAction:(id)sender
{
if (myMovie)
return ;
NSString* a_path = [[NSBundle mainBundle] pathForResource:@"kevin-kell-introduction" ofType: @"mp4"];
if (a_path==nil)
return ;
NSURL* a_url = [NSURL fileURLWithPath:a_path];
if (a_url==nil)
return ;
Class moviePlayerViewControllerClass = (NSClassFromString(@"MPMoviePlayerViewController"));
newStyleVideoPlayer = moviePlayerViewControllerClass && [MPMoviePlayerViewController instancesRespondToSelector: @selector(presentMoviePlayerViewControllerAnimated:)];
if (newStyleVideoPlayer)
{
//We're running in iOS 3.2 or later, so use the new MPMoviePlayerViewController class.
MPMoviePlayerViewController* movie_controller = [[[MPMoviePlayerViewController alloc] initWithContentURL:a_url] autorelease];
if (movie_controller) {
self.myMovie = movie_controller;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playBackFinished:) name:@"MPMoviePlayerPlaybackDidFinishNotification" object:nil];
MPMoviePlayerController* theMoviewPlayer = movie_controller.moviePlayer;
theMoviewPlayer.controlStyle = MPMovieControlStyleNone;
//theMoviewPlayer.fullscreen = TRUE;
[[UIApplication sharedApplication] setStatusBarHidden: TRUE withAnimation: UIStatusBarAnimationNone];
[self presentMoviePlayerViewControllerAnimated: (MPMoviePlayerViewController*)self.myMovie];
}
}
}
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
It's about 40 lines of code. If you are not an experienced iOS developer I doubt it will be very useful to you. I'm providing the code below "as is". I'll answer questions about it and help you get it working in your program - if you hire me by the hour to do so.
Sorry if that seems harsh, but I sense that otherwise this could involve dozens of questions and answers, and I'm not signing up for that.
Code:
- (IBAction) videoAction:(id)sender
{
if (myMovie)
return ;
NSString* a_path = [[NSBundle mainBundle] pathForResource:@"kevin-kell-introduction" ofType: @"mp4"];
if (a_path==nil)
return ;
NSURL* a_url = [NSURL fileURLWithPath:a_path];
if (a_url==nil)
return ;
Class moviePlayerViewControllerClass = (NSClassFromString(@"MPMoviePlayerViewController"));
newStyleVideoPlayer = moviePlayerViewControllerClass && [MPMoviePlayerViewController instancesRespondToSelector: @selector(presentMoviePlayerViewControllerAnimated:)];
if (newStyleVideoPlayer)
{
//We're running in iOS 3.2 or later, so use the new MPMoviePlayerViewController class.
MPMoviePlayerViewController* movie_controller = [[[MPMoviePlayerViewController alloc] initWithContentURL:a_url] autorelease];
if (movie_controller) {
self.myMovie = movie_controller;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playBackFinished:) name:@"MPMoviePlayerPlaybackDidFinishNotification" object:nil];
MPMoviePlayerController* theMoviewPlayer = movie_controller.moviePlayer;
theMoviewPlayer.controlStyle = MPMovieControlStyleNone;
//theMoviewPlayer.fullscreen = TRUE;
[[UIApplication sharedApplication] setStatusBarHidden: TRUE withAnimation: UIStatusBarAnimationNone];
[self presentMoviePlayerViewControllerAnimated: (MPMoviePlayerViewController*)self.myMovie];
}
}
}
You're too nice Duncan. I doubt he'll actually learn anything from this and now he has it in his head that he can get free code.
I have no evident future in coding, so there's no need to do any learning. Also, this is my first and last iPhone SDK project, so don't worry about me running around asking for free code. So, I suppose this is my last post on this forum. I hope you all don't miss me and my 4 posts.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.