User-Agent and Cookies

Topics: Windows 8 Xaml
Nov 25, 2012 at 6:44 PM

Does anyone know of a mechanism that I could use to control the HTTP User-Agent and Cookies of the player, when accessing the associated Source? A number of the content providers that i'm attempting to integrate with require an application specific User-Agent. Also, it's likely that I will need to perform manual authentication in order to obtain suitable cookies which I would then need the player to use when attempting to access the video...

Any help/suggestions would be greatly appreciated.

Coordinator
Nov 27, 2012 at 12:38 AM

If you're using smooth streaming, it's possible to create an IDownloadPlugin implementation (which you can wire up by setting AdaptivePlugin.DownloadPlugin). In a nutshell: this will give you the ability to provide code that acts as a middleman between the smooth SDK and your content.

If you're using progressive download content, I think your only option is to create a media foundation extension and register it as a bytestreamhandler.

Nov 27, 2012 at 8:08 AM

Thanks for your response!

It's for progressive download content, so I guess I need to read up on how to implement my own media foundation extension. One of the previous thoughts was to implement a custom IRandomAccessStream and set this as the Source. Would this approach not work? If it would, do you know of any advantages over both approaches?

Coordinator
Nov 27, 2012 at 6:11 PM

Ah yes, a custom IRandomAccessStream may work too. You'll just want to check to see if you can block read requests while you fetch data, support seeking, ...etc so you don't have to download the entire stream ahead of time (and therefore defeat the purpose of *progressive* download). Looking at the interface, it does seem like this would work. If so, IRandomAcessStream would probably be simpler.

If you want to share finidngs, I'd love to hear what you learn,

Tim

Nov 29, 2012 at 3:13 PM

We've managed to temporarily side step the issue for now but it's definitely something that we'll need to revisit soon. Once i've had the opportunity to properly attempt it, i'll be happy to share my findings... Thanks again for your help!

Jan 19, 2013 at 7:11 AM

For what it's worth, we've solved this problem by using a proxy URL inside our own process.  It increases latency a little, but it does allow us to customize the HTTP request quite a bit more.

Mar 21, 2013 at 2:24 PM
Hi IanDB,

Coud you please provide code extract of your solution, non support of credential or cookies for progressive download is very worth, hope this will be supported for te next release :-)

Zucher