ios设备开启静音时播放视频没有声音

通过下面的设置可以在静音模式下播放声音

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionAllowBluetooth error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];

具体详见博客:iOS音频掌柜-- AVAudioSession

 

by:梁羽

posted @ 2020-03-30 17:29  WidgetBox  阅读(2283)  评论(0编辑  收藏  举报