user2799350
user2799350

Reputation: 399

How to play a sound in foreground under lock screen?

I play sounds with MediaElement. But I want it to continue playing if the screen is locked.

I read here that we should do it this way:

PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;

I have added it to the page's constructor, but nothing happens, and after locking, it stops the sound.

I don't want to play it even when the app isn't in foreground. but just under the lock screen. (It's WP8)

Upvotes: 0

Views: 440

Answers (1)

Ivan Crojach Karačić
Ivan Crojach Karačić

Reputation: 1911

This may do the trick

PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;

Upvotes: 1

Related Questions