Windows 10 mobile BackgroundMediaPlayer don't want work - windows

I have a big issue with BackgroundMediaPlayer on Windows 10 mobile but I think that is very similar as API on Windows Phone 8.1. My app works similar as windows 10 sample. But I decided to add small user interface on mainpage where user can easily stop actual music. Problem is that when I am trying access BackgroundMediaPlayer.Current with events my music player don't play any music but when I delete events from main page It start works again. I manage my music player from other page. Is some way how to find out if my BackgroundMediaPlayer actualy playing some music with name of music ? Because I do not know how to continue with my project... Thanks for help

Related

Recording Audio Stream in Background in Windows phone 7/8

I m developing an app which can record audio stream.
I want to know that is it possible to record that audio in background, i,e when the application is in deactivated mode?
I have already tried to do that in many different ways,but its not helping out.
Please suggest me some way to do such...
Thank you.
As mentioned in the comments, it's not possible to record in the background.
Your app must be running in the foreground for it to be able to record audio using the microphone. For an overview of all the audio recording options, please refer to this tutorial on the Nokia Developer Wiki.
Also, an app will not run when the phone is locked - it is suspended. So if your app was recording, it would stop when the phone is locked. You can change this behaviour with IdleDetectionMode.Disabled which means your app keeps running even though the phone is locked.
Haven't implemented it before, but classifying it as a VOIP app could be the way to go:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207046(v=vs.105).aspx

CameraCaptureTask in Windows Phone 8 - auto saves to camera roll

I have an existing application developed for Windows Phone 7, which uses CameraCaptureTask.
The captured image is returned back to the app, which will be processed for grayscale conversion.
While testing the same app (same binary to be precise) in Windows Phone 8 Lumia 920, I figured that a copy of all the images captured through the CameraCaptureTask are saved in "camera roll" folder.
This is a bit annoying as the users of my app are not expecting the captured images crowding the "camera roll" folder. I looked up the documentation http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006(v=vs.105).aspx and found the below quote,
On Windows Phone 8, if the user accepts a photo taken with the camera capture task, the photo is automatically saved to the phone’s camera roll. On previous versions of Windows Phone, the photo is not automatically saved.
So far I couldn't find a way to avoid this case in Windows Phone 8.
Is there a way to turn off this feature before calling the CameraCaptureTask's Show() method in Windows Phone 8?
No. This is a consumer feature request implemented on WP8 that's transparent to developers. The usecase here is that a consumer uses the CameraCaptureTask to line up a perfect shot, doesn't use it an app for whatever reason and can't find it ever again later.
As a side-note, I actually had this happen a few times to me when using various twitter and photo editing apps and it's quite annoying.
Makes no sense. CameraCaptureTask was created to allow apps to capture photos for the app use, not for users to push them into Camera Roll. That is what Lenses are for (either custom code can write into camera roll as well).
It is not transparent to developers because one of my apps has just been removed from the WP8 market. They say because can cause "undesired upload of an app photo to skydrive".
Justin are you sure it isn't a bug? is it going to be fixed?
This forces me to break my development into 2 now: WP7 and WP8. I don't want that hassle right now...

windows phone application crashing after changing current playing song

I'm using Mediaplayer.Queue to retrieve information from zune on Windows Phone about currently playing song (artist, song name, etc). Everything is fine, but if I'm changing song from the fast access menu (ie. from clicking the volume-buttons) the app crashes.
What do I need to do to prevent this scenario in the future? Also, when the user changes the track, how do I update the current song info?
To enable music hub debugging on the device, you need to connect with WPConnect.exe instead of Zune. The guide tells you how.
Once you got debugging running, you should be able to get a full exception and stack-trace. If you post that, we can give you further help, if necessary.

get current playing song list windows phone 7

I want to display the list of songs in current playing lists, If users play music in my app, I could know what playlist is playing but if they were playing in zune app then switch to my app, my song list will be empty, even though the playlists is still running.
For example: if users's playing a playlists in windows phone 7 by Zune app, then they navigate to my App, how do I get that current play lists?
The current Windows Phone 7 APIs only integrate with phone media via the MediaPlayerLauncher, which allows you to launch media from your application.
The Mango (7.1) APIs allow you to integrate with the media + video hub, however, the APIs are still pretty simple. You can determine the currently playing media via MediaHistory.NowPlaying.
MediaHistory.NowPlaying is of Type MediaHistoryItem which has the Properties Title and ImageStream. You could add the Title and Image to your collection.
You can use MediaPlayer.Queue property of static class MediaPlayer from Microsoft.Xna.Framework library

How to know if a music is currently playing on Windows Phone 7?

I am currently building an application for Windows Phone 7 which has to play music with the MediaPlayer.
However, I would like to know whether the phone is already playing some music, to ask the user if he want to play also my app's.
How could I get this information?
Thanks.
MediaPlayer.Queue.ActiveSong should do the trick.
MediaPlayer doco here for your reference.

Resources