iPhone MPMoviePlayerController : Hiding the status bar [duplicate] - iphone

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Hide the status while playing movie using MPMoviePlayerController
It seems that if you play a movie full screen the status bar is turned back on. You can hide it on movie load but as soon as you click the controls to come up it reappears. There seems to be no movie controls appear events.
Update:
This is only an issue if you tab the screen for the movie controls to come up. Its something to do with the movie control.

Otherwise you could:
Use this when you want it to show:
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO]];
Use this when you want to hide it:
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]];

Related

Navigation bar is not shown properly when get back from Movie Player in iphone SDK

In my app, I load a HTML Page in Web View which contains a video. Till this the navigation bar is shown properly.
But when i play video with by default Movie Player in iphone & try to see it in Both Landscape/Portrait mode with Full Screen. When get Back from Movie Player, the Navigation Bar is go to upside & status Bar is Cover some view.
I am not taken mediaPlayer framework or any other class in my project.
How can i solved This issue??
Just paste this below line in to the viewWillAppear: on that view controller class where this issue occurs.
Objective C
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
Swift
UIApplication.shared.setStatusBarHidden(false, with:UIStatusBarAnimation.none)
In your Movie player class replace
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
with
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
Means if you hide your status bar when came back from player then the height of the view will increased by 20 pixels.
So your view will go upside

Status Bar keeps showing up when dismissing MPMoviePlayerViewController

I'm making an app where I need to play a movie from my camera roll. I'm using MPMoviePlayerViewController to do is, and displaying it with:
[self presentMoviePlayerViewControllerAnimated:theMovie];
I want it to run in fullscreen mode:
[theMovie.moviePlayer setControlStyle:MPMovieControlStyleFullscreen];
This is where the issue comes up. I don't want the Options to be displayed upon launch, so I decided to set the control style to MPMovieControlStyleNone initially. But I still want the options to be available, so after searching around I found this option:
[[NSNotificationCenter defaultCenter] addObserver:self selector:#selector(enterFullScreenMode)
name:MPMoviePlayerLoadStateDidChangeNotification object:nil];
And in this method I change the control state to MPMovieControlStyleFullscreen. This causes the status bar to be displayed in my app AFTER I dismiss the movie and return to my parent view controller. My application doesn't use the status bar at all. I've tried this:
[[UIApplication sharedApplication] setStatusBarHidden:YES];
And it didn't work. I should point out this issue only shows up if I start with control state None and then switch to Fullscreen while the movie is playing, but I need to do this because I don't want the options to show up upon launch. I'm open to any ideas. Please help me eliminate the status bar once and for all.
Thanks guys :)

IPhone: How to start a call and then get back to my app? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
iOS 4.2 - Return to app after phone call
I want to give user a chance to call somebody directly from my app. That's why I use this code:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel:0801920"]];
I't works just fine, but the problem is that I want that after call is finished or if user press cancel it cames right back in my app. Now it just stays in calls of the phone. What I need is to use some kind of delegate.
I was googling and I came up with something like these:
pinkAppDelegate *appDelegate= (pinkAppDelegate *)[[UIApplication sharedApplication] delegate];
But I'm not sure how to use it.
You can not do this. The open URL call will open a different application. The current running application is the receiving application of the openURL method. That application is now the foreground application and it wont be able to re-launch your application.

Unable to add overlay to MPMoviePlayerController in SDK 4.1

This is a follow-on from: Overlay on top of Streaming MPMoviePlayerController
I've seen the various threads about checking for a new Window and then using that to apply my custom views to my fullscreen video however in SDK 4.1 this doesnt appear to be the case.
I have tried a timer and listening for UIWindowDidBecomeKeyNotification but in neither case does [[UIApplication sharedApplication] windows] ever contain more than 1 item.
I have tried adding my view to the players view property which works fine when displayed in place, but not when fullscreen, even if I add it in moviePlayBackDidEnterFullScreen event
I found a solution to this problem a few weeks ago:
It seems this method does not work on the iPad (I havent checked iPhone SDK 4>) so in order to get round it you can do the following.
After adding your video and setting to fullscreen you can add your controls directly to the UIWindow (e.g. [[[[UIApplication sharedApplication] windows] objectAtIndex:0] addSubView:myView]), they will then appear on top of your video video.
The only problem I have found with this is that they don't obey the orientation rules of the view and I have manually had to program the rotation code in the willRotateToInterfaceOrientation method of the view.

Hide status bar while playing video for iphone

I am trying to hide status bar for iphone application development.But when i am playing video at that that status bar come and after that when i come back to previous screen status bar showing . If i am not playing any video than whole application the status bar hiding.
Can you please help me to hide status bar on video screen ,even i tried for "[[UIApplication sharedApplication] setStatusBarHidden:YES];" before playing video .but this is not working.
"
Thanks,
KamalBhr
[[UIApplication sharedApplication] setStatusBarHidden:YES];//iOS3
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade]; //iOS4
is basically the way to go, but the important part is where respectively when to call it.
that depends a bit if you're developing for iOS4 or iPhone OS 3.0.
in iOS 3 is used to hide the status bar when the Notification MPMoviePlayerContentPreloadDidFinishNotification was fired.
in iOS4 i didn't have any problems hiding the bar before i set the ContentURL of my MPMoviePlayerViewController's moviePlayer property.
i hope i could help.
sam