bilibili / ijkplayer

Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.
GNU General Public License v2.0
32.43k stars 8.11k forks source link

Microphone gets block on iOS device #2496

Open noamtcohen opened 7 years ago

noamtcohen commented 7 years ago

I have an application with ijkplayer and an embedded wkWebView. I am using this project in order to record audio from a wkWebView: https://github.com/common-tater/wkwebview-getusermedia-shim/ But when I start ijkplayer it stop the functionality of the microphone and thus stops recording. This only happens on a physical device. It works fine on android and iOS simulator.

xinzhengzhang commented 7 years ago

No idea, audioSession will be helpful.

noamtcohen commented 7 years ago

Maybe the system is blocking the microphone when the speakers are used in order to avoid echo. Is there a way to mute ijkplayer?

xinzhengzhang commented 7 years ago

I don't know yet but I think some config for audiosession can solve your issue.

noamtcohen commented 7 years ago

I tried:

AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord,with:AVAudioSessionCategoryOptions.mixWithOthers);

Didn't make a change...