Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to add the default buttons (play, pause, >>, etc.) to my iPhone video app?

Posted on 2010-09-03
5
Medium Priority
?
795 Views
Last Modified: 2013-11-25
Hi.

I used this video to make an application where an iPhone shows a video.
However, starting at 4:25, I used another code (the code of the video does not work with the current sdk).

Here's the code that i use:

- (IBAction)playMovie {
	
	NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"MOVIE001" ofType:@"mov"]];  
	MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];  
	
	// Register to receive a notification when the movie has finished playing.  
	[[NSNotificationCenter defaultCenter] addObserver:self  
											 selector:@selector(moviePlayBackDidFinish:)  
												 name:MPMoviePlayerPlaybackDidFinishNotification  
											   object:moviePlayer];  
	
	if ([moviePlayer respondsToSelector:@selector(setFullscreen:animated:)]) {  
		// Use the new 3.2 style API  
		moviePlayer.controlStyle = MPMovieControlStyleNone;  
		moviePlayer.shouldAutoplay = YES;  
		[self.view addSubview:moviePlayer.view];  
		[moviePlayer setFullscreen:YES animated:YES];  
	} else {  
		// Use the old 2.0 style API  
		moviePlayer.movieControlMode = MPMovieControlModeHidden;  
		[moviePlayer play];  
	}  
	 

}

Open in new window


The application is running ok but when I touch the video i cant see this buttons:
video buttons

What changes should I do in my code to see this buttons?

Thanks and sorry for my bad english!
0
Comment
Question by:carvalhaes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 33

Expert Comment

by:pgnatyuk
ID: 33600392
Probably you have found the answer in the article:
Play iPhone Movies in Portrait Mode with MPMoviePlayerController using Public API’s
http://iphonedevelopertips.com/video/play-movies-in-portrait-mode-with-mpmovieplayercontroller-using-public-apis.html
0
 
LVL 33

Accepted Solution

by:
pgnatyuk earned 2000 total points
ID: 33600634
moviePlayer.controlStyle = MPMovieControlStyleNone;
This line hides the controls.


0
 
LVL 33

Expert Comment

by:pgnatyuk
ID: 33600649
Can you use MPMoviePlayerViewController in your program?
0
 

Author Comment

by:carvalhaes
ID: 33600733
this link is very interesting http://iphonedevelopertips.com/video/play-movies-in-portrait-mode-with-mpmovieplayercontroller-using-public-apis.html
but when i try to build it i got an error ''there is no sdk with the name or path iphoneos3.0'

you already awser my question with "moviePlayer.controlStyle = MPMovieControlStyleNone;
This line hides the controls".

thank you very much!
0
 
LVL 33

Expert Comment

by:pgnatyuk
ID: 33600759
It's again the same - change the base SDK in the settings - right click on the project and then "Get Info", then "Build", ...
Let's switch to the view controller.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question