Is it possible to mute MPMoviePlayerController?

最后都变了- 提交于 2020-01-01 00:27:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!