windows phone background player share - windows-phone-7

I'm developing a windows phone app with a background player based on the windows phone 7.1 project template(so i have 2 projects). My question is how i dynamically set the list of tracks for the background player to play? I tried static fields but didn't work and my guess is that i have to define a resource in the app.xaml but how it is done exactly? I need to share a List and an integer.
Thanks for the help!

The audio agent won't be able to read any resources in the App object (app.xaml).
As far as I can see the only way to communicate between your app and the background audio is via the BackgroundAudioPlayer.Instance object, the AudioTrack (see especially the Tag property) and using files stored in Isolated Storage.
This is described on MSDN here.
Also check out the Background Audio player in the MSDN code samples.

Related

Add music to windows 8.1 app - Visual studio 2013

I'm creating a windows app , windows 8.1 app, using visual studio 2013.
i want to add a background music to it.
how to add it?
Do you mean music while the app is playing or music running when the app is in the background?
For both you'll set up a MediaElement running the music file you want to play.
Since the MediaElement will only play while it's in the visual tree you need to play a small trick to keep it running through all of the app's pages: instead of running the app out of a top-level page, create a root page with the MediaElement and a child frame, then run the app's pages out of the child frame. See my blog entry Frame of reference: keeping the music playing across pages for more details.
To play music when the app is in the background you'll need to declare the background audio task, set the MediaElement to BackgroundCapableMedia, and wire up SystemMediaTransportControls. See the How to play audio in the background documentation on MSDN for details.

Share videos camera roll wp 8

I tired to googling that how share videos form camera roll in windows phone 8 like in Nokia video upload and facebook app. I used to try this
http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff967563(v=vs.105).aspx
Only share picture but I want to share only videos for my app e.g. when my app show in list when share a video by camera roll of windows phone in sharing
To quote the link you included in your question:
Note that this extensibility is only available when the photo is a JPG
file.
And from my experience, I can confirm that it is not possible to register your app as a share target for a video file.
In other words, if a user tries to share a video from the camera roll or another app, there is no way to make your app appear as one of the options in that list.
Did you try using the share media task function?
Check this article out from the msdn :
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207027(v=vs.105).aspx
You can use MediaLibrary and there is already an answer for your question in this link. As said, there is no way to select existing sound media and video files through default choosers. Thank you.

Record audio in background

I'm wondering if anyone has any idea that capture audio from the device's microphone on the new Windows Phone 7 in background (Silverlight, not XNA)
or any code to do it?
Even in a Silverlight application, the Microphone is accessed via libraries in the Microsoft.Xna.* namespaces.
The use of such namespaces is not supported in a Background Task. See http://msdn.microsoft.com/en-us/library/hh202962(v=vs.92)
This is not possible and would break the security principle of not allowing apps to do something that the user isn't aware of.

Accessing MediaPlayer in Background Agent in Windows Phone 7

I am trying to capture the current playing track in the Zune music player, in my Background Agent app. Looking at the Unsupported APIs for Background Agents page on MSDN, all of XNA is not supported - which means I can't use XNA's Media.MediaPlayer. Is there any workaround or solution for this?
Nope.
There is currently no way to access anything other than the tracks which you are playing in a BackgroundAudioPlayer agent.
Actually, there is no way to access anything other than THE track (not tracks) that the background audio player is playing. There is no concept of a playlist exposed by the BAP singleton, which apparently is the source for much frustration with this component. You have to resort to IsolatedStorage or some other hack to feed the BAP a playlist.

Camera capture in Windows Phone 7 through an XNA application

I know that Microsoft hasn't officially supported doing any video capture applications as of yet. I've found the Clarity Consulting blog entry that highlights how to use the camera through Silverlight (entry is here: http://blogs.claritycon.com/kevinmarshall/2010/12/23/wp7-camera-access-flashlight-augmented-reality-and-barcode-scanning/). But, as of yet, I have been unsuccessful in porting the code to be used by an XNA framework.
Has anyone had any luck either using the Windows Phone 7 camera in an XNA application? If so, care to share your wisdom?
Thanks!
Generally you can access the camera the same way you do it in Silverlight - there is the CameraCaptureTask - you need to add a reference to Microsoft.Phone first and then call it from the game.
Microsoft.Phone.Tasks.CameraCaptureTask task = new Microsoft.Phone.Tasks.CameraCaptureTask();
task.Completed += new EventHandler<Microsoft.Phone.Tasks.PhotoResult>(task_Completed);
task.Show();
That would be for static capture, and your event handler is like this:
void task_Completed(object sender, Microsoft.Phone.Tasks.PhotoResult e)
{
// Do something with e.ChosenPhoto
}
Currently, video recording is done through the undocumented way - this will most likely get your app submission disapproved from the Marketplace, but it is possible nonetheless.
What's done that way is a MP4 file is constantly updated in the IsolatedStorage as the recording is in progress. But then again, there are methods present to include the file in the media library.
Think you are a bit unclear about the whole microsoft and supporting cameras.
Microsoft released not too long ago Expression Encoder 4 which allows you not only to video screen capture your screen but as well access all devices connected to your pc.
I would believe this would be much more ideal then being restrained to only using a windows 7 phone especially for an xna game.
Hope this sheds some light.
Nowadays you can use FileSink to save video from a CaptureSource like VideoCaptureDevice into a file.
http://msdn.microsoft.com/en-us/library/system.windows.media.filesink%28v=vs.96%29.aspx
http://msdn.microsoft.com/en-us/library/system.windows.media.capturesource%28v=vs.96%29.aspx
http://msdn.microsoft.com/en-us/library/system.windows.media.videocapturedevice%28v=vs.96%29.aspx

Resources