windows phone 8.1 music library get current media queue - windows-phone-8.1

How to get current media queue in windows phone 8.1 (runtime) as in windows phone 8 MediaPlayer.Queue
Is it available or we have to implement?
Similarly IsShuffled functionality is there ?

The MediaPlayer API belongs to the Microsoft.Xna.Framework.Media namespace which is no longer available for WinRT components. So you can't use it but you can implement your own logic for it using the MediaElement API which has sufficient properties for a media player except for the logic of queuing etc.
The explanation here and the msdn-code-sample would surely help you out.
For background music player you should use the SystemMediaTransportControls API and attach the events that occur when your app is running in background.
This link has a background audio explanation. Seems helpful.

Related

PJSIP not running in Windows Phone 8 background process

I've studied the Windows ChatterBox sample app for Windows Phone 8 and I was able to write a small app to try out PJSIP. However I've run into a problem with the CallInProgressAgent. When creating an outgoing call, I create a VoipPhoneCall object by calling the RequestOutgoingCall method on the VoipCallCoordinator class, thereafter I create the pjsip call by using the pjsua api. It seems pjsip looses all rtp connectivity as soon as I call the RequestOutgoingCall method. My guess is that pjsip is unable to run in a background process initiated by calling the RequestOutgoingCall method. Can anybody shed more light on this situation?
I found this on the pjsip website:
Windows Phone 8 (WP8) support is being added and is still under development on projects/winphone branch. Specific considerations for this platform are:
WP8 governs specific interaction with WP8 GUI and framework that needs to be followed by application in order to make VoIP call work seamlessly on the device. Some lightweight process will be created by WP8 framework in order for background call to work and PJSIP needs to put its background processing in this process’ context. Currently this feature is under development.
The moral of this story is that we cannot use PJSIP in an application until the above background process development is complete.

Playing songs from a user's music library in WP8.1?

In WP8 I had to get the list of songs from "MusicLibrary" class and play it through the "MediaPlayer" class. It was simple enough. But both of these are gone in 8.1. Actually pretty much everything is gone. Even simple things like page navigation syntax has changed completely (and I don't see any logical reason behind doing that)
Can someone tell me how I can get the list of songs in the user's phone in WP8.1? And how to play them in the background? I can't find any documentation on 8.1 on the net at the moment. After a lot of googling I only managed to find one example which showed how to play a file from isolated storage. Please help..
I think you are targeting windows phone 8.1 (Windows Run time version) If you target windows phone 8.1 Silverlight almost everything is same as windows phone 8. Windows phone 8.1 winRt is targeted for code re-usability on window phone and windows store app. So if you are targeting both platforms then try to Use Universal Apps.
Edit
For Player use <MediaElement... and for accessing Music library use below code.
var folder = Windows.Storage.KnownFolders.MusicLibrary;
var files = await folder.GetFilesAsync();
Hope this helps.

Using Flash Player in Windows HTML5 app

While looking over the Adobe Flash Player/AIR Roadmap (found here) I saw this:
"Flash Player release and debug players are available and supported for Windows 8 Desktop and Modern UI experiences on both x86/64 and ARM platforms."
Which got me thinking about a potential method that apps for Windows 8 might be able to be released using Flash Player.
Currently, using AIR, you can build apps for Android and iOS, as well as for Windows Desktop. But Windows 8 Modern UI and Windows Phone 8 are both unsupported platforms.
So the idea was this. If IE 10 for Modern UI supports Flash Player, and if HTML5 Modern UI Windows apps use IE under the hood in order to run, then supposedly you could wrap a Flash Player app inside of an HTML5 app, and then, voilĂ , you'd have a Windows Modern UI app running off of ActionScript. (Though it still wouldn't work for Windows Phone 8.)
Well, I have tested this, and (sadly) it doesn't work. I would almost bet that this isn't because the functionality isn't there, but rather it is because of some switch on the backend that prevents this functionality from being used.
So, finally, here is my question, mainly to sate my curiosity on the subject. Does anyone know whether or not such a backend switch exists, and if so, is there a way to switch it?
I have tried the same thing as you and no, I don't think such a switch exists.
I can only assume Microsoft has purposely blocked off ActiveX controls on purpose, since Silverlight also does not work in HTML5 apps.
It is sort of possible that with Windows 8.1 Update 1, they may change this, but I believe it opens up a lot of problems for them from a security / app store catalogue perspective, so would be unlikely.

Starting with audio in Windows Phone 8

I recently started doing some development in the Windows Phone 8 OS I'm pretty new on this. I was doing some searching about the fact to create an app who play any audio for some specific events/actions.
I was reading the Windows Phone API reference from Windows Phone Dev Center http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff626516%28v=vs.105%29.aspx#BKMK_Win32andCOMAPIforWindowsPhone
But it seems a little confusing to me at first glance and I have the doubt of which one of the following should I use to accomplish my task.
The .Net API for Windows Phone
Win 32 and COM API
... or the Windows Phone Runtime API
Any help would be very appreciate
It really depends what you're trying to do. If you're writing a native application or are interested in cross-compatability with Windows 8 then XAudio2 or the WinRT APIs are definitely the way to go. If you just want to play some infrequent sounds (say, when you pop up a warning dialog) from within a XAML app then I have seen a number of approaches, teh easiest of which is probably just having a MediaElement in your XAML that you use to play the audio.

Capture screen of Windows store App

Is it possible to capture the contents of running Windows store app? I need to capture the entire screen or a user defined rectangular area.
The application will provide share option
When the application is running and share option is selected, I want to get the screen shot periodically say 4 times in a second
This screen shot image will be posted to server, which will store the same
It's now possible in Windows 8.1 to capture the screen of a Store App. You need to use the RenderTargetBitmap class.
You can find an example here:
http://mariusbancila.ro/blog/2013/11/05/render-the-screen-of-a-windows-store-app-to-a-bitmap-in-windows-8-1/
Hope it helps.
You can't capture screen programatically. See the below threads from MSDN.
Programmatically take snap shot Windows RT.
How to capture screen in Metro app?
There is no built-in mechanism to render Windows 8 XAML UI to a bitmap in Windows 8.0. Depending on how complicated your UI is you could implement your own composition engine to render your UI to a bitmap using Direct2D or use the WinRT XAML Toolkit WriteableBitmap.Render() method implementation which has a limited support for doing what you ask (it doesn't render all types of controls, doesn't support RenderTransform, etc.). You could update it though to add support for the missing features.
Windows 8.1 APIs include the new 'RenderTargetBitmap' class that allows to render to a bitmap with its RenderAsync methods.