Reputation: 11
I am developing some sort of video and music security aap,so i am trying to find the background music play under lock screen ...actully i created the custome music player and did'nt use windows phone 8 default player, to play the music in background we need to call the windows phone 8 default player if i use default player the reason of my security app will be fail so my question is how to play music in background using custome music player(Player must be hide under lock screen and start menu),only access the music list and other features of music player when user is inside the app,on the other hand in lock screen music will just play without interacting with user
Upvotes: 0
Views: 911
Reputation: 1827
For playing audio in the background, you'll want to look into using a BackgroundAudioPlayer
. This page describes how you can use this class. This will show your tracks in the volume control, but there isn't a way to play audio in the background without that.
If you wanted to just enable your app to run under the lock screen (and remain the foreground app) you'd have to do the following:
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled
PhoneApplicationFrame.Obscured
and Unobscured
events to detect entering and exiting the lock screenIt's also a good idea to have a setting that lets the user disable running under the lock screen.
Upvotes: 1