user2563086
user2563086

Reputation: 11

Wp8 Background Music Play

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

Answers (1)

steveg89
steveg89

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:

  • Set PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled
  • Handle PhoneApplicationFrame.Obscured and Unobscured events to detect entering and exiting the lock screen

It's also a good idea to have a setting that lets the user disable running under the lock screen.

Upvotes: 1

Related Questions