0

How would one create a video or audio stream using OSMF when there must be basic authentication on the url?

Can one feed in Audio/Video using HTTPService to provide the header authentication?

All the examples available ignore the authentication portion!

Omar Mir
  • 1,500
  • 1
  • 19
  • 39

2 Answers2

0

See my answer here about adding basic authentication to an HTTPService:

Remote Image with basic authentication?

It should do the trick for you :)

Community
  • 1
  • 1
Nate
  • 2,881
  • 1
  • 14
  • 14
0

credentials is a string with "username:password" encoded in Base64 For Audio:

        private function auth_play(reqestURL:URLRequest) : void {

            stream = new Sound();

            var credsHeader:URLRequestHeader = new URLRequestHeader("Authorization", "Basic " + credentials);
            reqestURL.requestHeaders.push(credsHeader);

            var context:SoundLoaderContext = new SoundLoaderContext(1000, true);

            stream.load(reqestURL, context);                
        }

For Video I couldn't find anything but I SUSPECT this will work with netconnection and netstream:

nc.addHeader("Authorization", true, "Basic " + credentials);
Omar Mir
  • 1,500
  • 1
  • 19
  • 39