问题
In my iPhone application I want to mute & unmute MPMoviePlayerController. I have searched a lot but I am unable to succeed. Is it possible to mute audio in MPMoviePlayer controller? Please help me out. Thanks in advance.
回答1:
[[MPMusicPlayerController applicationMusicPlayer] setVolume:0];
This Line will mute the sound(hopefully)..:)
回答2:
Use this to mute.
NSError *error;
if ( ![[AVAudioSession sharedInstance] setActive:NO error:&error] ) {
NSLog(@"Error encountered: %@", [error localizedDescription]);
}
You will have to include the AVFoundation framework.
来源:https://stackoverflow.com/questions/6108407/is-it-possible-to-mute-mpmovieplayercontroller