Gapless looping in Background Media Player for Windows Phone 8.1 - c#

I'm creating an app (Windows Runtime) that requires sound to run in the background (even when the phone is locked) so I set the BackgroundMediaPlayer's isLoopingEnabled property to true in the background task but when I play back the audio in the app there is about a 1 second gap between the audio finishing and starting again.
I've also tried setting the position property of the player to 0 on the MediaEnded event but that bared the same result.
Is there any way to achieve gapless looping using the BackgroundMediaPlayer in Windows Phone 8.1???

There's no workaround for this feature AFAIK but Gapless Audio support is coming with upcoming Windows 10.

Related

Background audio stops playing when minimize windows 10 universal

I created an radio app for windows 10 using mediaElement for audio output with AudioCategory = BackgroundCapableMedia but whenever I minimize the app on desktop or mobile the audio stops playing. So how do I keep the audio alive after I minimize? And all examples I find is for 8.1 silverlight applications
You need to implement a Background Task to keep audio alive when your application is minimized.
You can find a sample which targets Windows 10 on github. The project is splitted in 3 parts (a/ your main application b/ the background task and c/ code shared between the two first projects)
Background audio sample
In addition, you can find documentation associated to this sample on MSDN.
Background Audio
Please let me know if you need additional information.

Set Lock Screen and Background image in windows phone 8.1(winrt) using c#

I want to set my lock screen and background image using c# in windows phone 8.1(WinRT) app.I have a button which jobs is to change lock screen by selecting the image from the gallery or made at runtime .Is there any api or specific tutorial or document available ?
Need help?
There is no way to set the lock-screen wallpaper in a Windows Runtime Phone app at this time - you need to keep using Silverlight to use the lock screen API.
MSDN source
EDIT:
Not applicable to 8.1, but there is now an API for setting the Start Screen and Lock Screen backgrounds in Windows 10 - UserProfilePersonalizationSettings. The API is universal, but it only does something meaningful on Desktop and Mobile (the IsSupported property is true). On other platforms like Xbox, it just fails silently (no exception, but no background is set either).

How to play a list of (online) video segments as a whole video for Windows phone 8.1

I need to play a list of videos using a player framework. When I play the first video, I need the second video to start loading in a different thread while the first is still playing, this way when the first video ends, the second video can start playing immediatly.
You can play media files on a Windows Phone using the MediaPlayerLauncher , or for a more customized experience, you can use the MediaElement class.
For more Reference Windows Phone Streaming Media Project would be Useful to You and this too How to play or stream a video file for Windows Phone 8.

Windows Phone turn flash on in background

I am working on a tools app and I need a way to turn on the camera flash when I click a tile, then keep it on in the background and turn it off once I click the tile again.
I don't need any help with the tile yet all I want to know is what I can do to turn on the flash and then keep it on. All the examples I have seen thus far simply pretend to be a camera and then turn the flash on.
Do you know of anything?
PS. I am planning on making this for WP 7 and 8 but if you know of a way that will on work on WP 8 that will also help me a lot.
The simple answer is no.
While the app is running, you can control the camera and turn on the flash. But as soon as you exit the app (Back button) or the app is suspended (due to a phone call or by pressing the Start button), the use of the camera is suspended.
Windows Phone does have Background Agents but these are very limited and do not allow access to the camera API at all (and many other APIs).

Disable Application from sleeping in Windows 8 Metro

I am working on an app which displays videos and am running into an issue where the machine goes to sleep after hitting the sleep time limit while a video is playing. Is there a way to disable this behavior in a Windows 8 Metro application?
You should use the DisplayRequest class, specifically DisplayRequest.RequestActive for this purpose. You must also remember to call DisplayRequest.RequestRelease once you are done to allow the display to sleep, for example, if you are not actively playing the movie, or in a menu screen, etc.

Categories

Resources