iPhone MPMoviePlayer hide movie Control - iphone

hi i want hide movie control (Play - next - volume and ..)from MPMoviePlayer ...
what can i do ?

You can do this by this line of code
which hides the controls of the
player.
[player setMovieControlMode:MPMovieControlModeHidden];

Haven't tried it, but isn't there a setHidden:YES you can do?

iOS 3.2 and later use "setControlStyle" e.g.
[player setControlStyle:MPMovieControlStyleNone];

Check out the movieControlMode property of MPMoviePlayerController. You'll probably want MPMovieControlModeHidden.

Related

adding timer to mpmovieplayerviewcontroller

I am using MPMoviePlayerViewController for playing the sound and video. I am streaming the song from the url. It is working fine.But the problem is, MPMoviePlayerViewController is not showing the time progress for the song I playing. That bar is disabled. How to make the time progress bar active? I have following code to play the song.
mediaPlayerController = [[MPMoviePlayerViewController alloc] initWithContentURL:songUrl];
[self presentModalViewController:mediaPlayerController animated:YES];
[[mediaPlayerController moviePlayer] play];
If you want to show the current progress time on your own custom way, you can show it by using the currentPlaybackTime property in the MPMediaPlayback protocol gives you that info.
U use AVPlayer for playing live streaming. Refer this link.
Also refer StitchedStreamPlayer link sample code by apple.
Set controlStyle for mediaPlayerController:
[mediaPlayerController moviePlayer].controlStyle = MPMovieControlStyleFullscreen

MPMusicPlayerController not play on background

i am using MPMusicPlayerController in my app and when i enter to background it stop playing.
this is how i add it :
musicPlayer = [MPMusicPlayerController iPodMusicPlayer];
The iPodMusicPlayer is always enabled in the background. You shouldn't have to set anything. And [MPMusicPlayerController applicationMusicPlayer] won't play in the background ever. I'd say you're using the wrong MPMusicPlayerController somewhere.
You need to indicate in your app's plist file that you want to play audio in the background.
you create the applicationMusicPlayer it is not play in back ground.
you have to create ipodMusicPlayer to overcome this.
check this out for further refference.
http://developer.apple.com/library/ios/#documentation/MediaPlayer/Reference/MPMusicPlayerController_ClassReference/Reference/Reference.html#//apple_ref/doc/uid/TP40008221

programmatically off the sound on tapping mute button on iphone

How to programmatically disable the sound when mute button of iphone pressed while playing audio file?
I'm using streamer for audio.
This may help you
Now, here is something from MediaPlayer framework that we are going to use if we want in most easiest way control level of volume in our application. This is very useful if you are implementing an audio player in your app.
The best thing about this small feature is easy implementation in any class. We just import MediaPlayer framework in header of our class (#import ) and add this code below in method we know that is appropriate for this feature (init method).
MPVolumeView *volumeView = [[[MPVolumeView alloc] initWithFrame:CGRectMake(0, 0, 200, 20)] autorelease];
volumeView.center = CGPointMake(150,370);
[volumeView sizeToFit];
[self.view addSubview:volumeView];
This kind of volume control is connected with iPhone hardware volume buttons. You get same thing like in Music player.
You have to use the audio framework of the iOS SDK and choose the correct profile. The system automatically decides if muting is appropriate.
Apple explains it here. :-)
probably you can use ....
if you are using MPMoviewPlayerController and intend to control the volume using mpvolumeview
[[MPMusicPlayerController applicationMusicPlayer] setVolume: 0.0];

Customizing the media player in iphone

In my iphone app i want to change the buttons of media player.for example (play/pause)button,(full screen button)etc.Is this possible.please help me.
I'm sorry but I'm afraid that you can only create you own.
You will need to hide the controller:
[moviePlayer setControlStyle:MPMovieControlStyleNone];
and use a UIToolbar.

Stop iPad MoviePlayer video when a view is changed

I'm writing my first iPad app that plays a video on a portion of the screen. My problem is that if the user changes to another view while the video is playing, the audio keeps playing in the background. I assume I have to add something to the "viewDidUnload" method but I'm not sure what to do. Any ideas? Thanks for any info.
You can try adding
[myMoviePlayer pause]; // assume myMoviePlayer is an instance variable
[myMoviePlayer stop];
myMoviePlayer = nil;
to your viewWillDisappear method.