简体   繁体   中英

MPMoviePlayer play on when application goes Background when incoming call is coming

I am developing an audio streamer and have declared an interruption listener, that means when an interruption occurs - like an incoming call or an sms.After complete my call again automatically play that audio live stream

Explain

my first question Is it possible.... (that means if my song is ten min . After 2 min playing, suddenly incoming call is coming at that time i am talking 4 min... So my song should be continue from 6th min(that means 4 min should be background running without noise ) ) I am MPMoviePlayer in IOS5

player =  [[MPMoviePlayerController alloc] initWithContentURL:audioUrl];
[player prepareToPlay];

My guess is you can do it by:

  1. Capture the current time when you app got interrupted.
  2. When applicationDidBecomeActive got called. Calculate the elapsed time base on the time captured above.
  3. Initialize the MPMoviePlayerController with initialPlaybackTime to seek to the calculated offset.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM