Anyone know of a way to access an audio file that is protected with Basic auth when using a BackgroundMediaPlayer
in WP8.1?
I've tried using the StreamingRandomAccessStream
from How to play a video stream that requires authentication? but it doesn't work with BackgroundMediaPlayer
. This is because SetStreamSource()
needs to be run from the background agent, and I can't use a HttpClient
in a Windows Runtime Component.
EDIT (2015-04-13):
I've now tried using a Windows.Web.Http.HttpClient
but it never worked properly because of an apparent bug in the HttpClient
stack: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/07e551c1-37c0-4bd9-9d98-aa3fc90df974/windows-phone-8-portable-httpclient-causes-outofmemoryexception-downloading-large-file?forum=wpdevelop&prof=required#5eb62907-92cd-4643-8c74-9e6c2a30e464
The SM.Mono.Net repository has a solution, but doesn't work with files over TLS, which unfortunately makes it unusable for me.