How to prevent MPMoviePlayerController from showing application icon on iPod controls in iOS4.0 +?

I use MPMoviePlayerControllerto play a movie inside my application.

When a movie is playing, if I press the home button twice and scroll left (where the iPod icon is usually located, as well as the “orientation lock” button), I see the icon of my application.

Playback controls control the movie inside my application, even if I switched to another view controller inside my application.

I want to disable this feature. Any ideas?

As a side note, I control the audio session manually, and the session is AVAudioSessionPlaybackat that point.

I searched for a reference to the MPMoviePlayerController class for a while to find out if I can find anything, but it doesn't seem to refer to this behavior.

When I put my application in the background, it does what you expect - it returns the iPod icon to the panel.

+3
source share
1 answer

Although I don’t know why you need it, setting Audio Session on AVAudioSessionCategorySoloAmbientshould disable this feature (but also disable the ability to play in the background).

Also make sure useApplicationAudioSessionyours is MPMoviePlayerControllerset to YES.

0
source

Source: https://habr.com/ru/post/1795187/


All Articles