Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MPMoviePlayerViewController stops playback when unplugging headphones

I'm currently developing a web-tv application that uses MPMoviePlayerViewController resp. MPMoviePlayer to playback streaming video content on the iphone.

the issue I've got here is that once i unplug my headphones (while watching tv) the player stops. Due to the fact that I'm not showing the standard controls (previous button, play/pause button, next button) but my custom controlls, the user is stuck with the frozen picture unless he switches to a new channel..

is there any way to detect a playback interuption caused by unplugging the headphones?

thanks for your tipps and tricks in advance,

sam

like image 876
samsam Avatar asked Oct 19 '10 09:10

samsam


1 Answers

I don't have a direct answer to your question. But I think MPMoviePlayerPlaybackStateDidChangeNotification will be good enough to solve your issue. Once you are notified, Get the playback state from the playbackState property of the movie player object and take appropriate action.

like image 129
Jose Cherian Avatar answered Sep 28 '22 04:09

Jose Cherian