MPMoviePlayerController - handle phone call

2019-08-23 14:52发布

问题:

I'm using MPMoviePlayerController to play a video. When a call comes, i want to pause and when he completes, i want to continue the video. I couldn't find relevant solution in my search. Is this something possible?

Its possible to handle the interruptions using AVAudioSessionDelegate "beginInterruption" and "endInterruption". But when I am setting the session to play back, my movie player sound is not heard at all. Does any one know the solution?

回答1:

There is a callEventHandler in Core Telephony framework. I hope, You could find what you want here.



回答2:

We've to set the session active after endInterruption.