[Help needed] How to play streams with HTTP Basic Authentication? (1 Viewer)

Anthrax

Portal Pro
February 15, 2007
157
48
pretty much in the center
Home Country
Germany Germany
Hey devs,

I'm hard at work with my new MyPlexMedia plugin at the moment and ran into the following problem:

1. PlexMediaServer uses HTTP basic authentication for stream requests
2. MediaPortals internal g_Player is absolutely capable of playing the plex stream types
3. Problem is when I try to play stream via "g_Player.PlayAudioStream(streamUrl)" it throws an error because plex needs authentication headers before sending the content over!
4. The quick fix was to use the same technique as the Trailers plugin: a local HttpProxy but this requires elevated privileges (start MediaPortal as administrator) as the HttpListener needs to be registered...

So the question is: Is there a way to override any of the BasePlayers to allow for HTTP authentication?

regards,
Anthrax

PS: I strumbled through /trunk/mediaportal/Core/Player/ for hours yesterday :(
 

offbyone

Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    Does the HttpHeader have to be send on the same request as the request the codec sends? In that case you HAVE to use a local proxy or implement a directhshow source filter. If you can send it just in a standalone single request apart from the playback, you can override the Player to create a new one (as I did in OnlineVideos)

    PS: I didn't know the MyTrailers plugin had a proxy as well :) You can check OnlineVideos sources, it also has a local proxy for issues like you describe.
     

    Anthrax

    Portal Pro
    February 15, 2007
    157
    48
    pretty much in the center
    Home Country
    Germany Germany
    AW: Re: [Help needed] How to play streams with HTTP Basic Authentication?

    wow offbyone,

    that was quick! Much appreciated.

    well it seemed it did at least som time ago: VideoProxy.cs - mytrailers - a trailer plugin for MediaPortal - Google Project Hosting
    I incorporated this method in MyPlexMedia but I hit the wall when I realized this requires admin privileges for MediaPortal in order to work.

    I'll try your suggestions asap and even though I studied your code as well I just didn't have the time (and mental strength) to fix this before the release of 0.5.0 Alpha ;-)

    Vielen Dank,
    Anthrax
     

    Users who are viewing this thread

    Top Bottom