• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Newbie question regarding authorization

Guest
Nov 29, 2013 Nov 29, 2013

Copy link to clipboard

Copied

Hi there,

I have an AMS 5.0.1 up and running. But I am a newbie to AMS.

I want to implement authorisation functionalities to the AMS for streaming recorded mp4 files (vod).

As a start, for Flash-based clients using RTMP, later on for iOS/Android devices using HLS/HDS.

My plan is that the client sends an internal id of the video to stream and a session id.

These two parms should be passed over from AMS to another remote server having an PHP API or a SOAP web service. This remote server checks if the video may be streamed and (simplified) returns true or false back to the AMS.

Now, my problem is that I have no idea where to hook into the communication between client and server.

As far as I understood the normal way to do this would be to listen to some events in the main.asc.

All examples I've found so far do only show how to handle application.onConnect.

But I would like the AMS to react on the NetStream.play() command sent by the Flash client.

How can this be done?

And, is there a way to do this for the HLS streaming that is not based on Flash clients?

Thanks a lot in advance

Hyper

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Dec 03, 2013 Dec 03, 2013

You pass additional arguments to the connect function:

nc.connect("rtmp://myserver.com/test", "12345", "abcdefgh");

On the media server, you define the onConnect function to take as many arguments as you expect:

application.onConnect = function(client, videoID, sessionID){

     // your code to handle client connection here, presumably to check values at remote server

}

The client argument is always present. You can add additional arguments after it.

http://help.adobe.com/en_US/flashmediaserver/ssaslr/WS5b3ccc516d4fbf351e63e3d11a11afc95e-7edfSSASLR.html#WS5b3ccc516d4fbf351e63e3d11a11afc95e-7fe1SSASLR

...

Votes

Translate

Translate
Participant ,
Dec 02, 2013 Dec 02, 2013

Copy link to clipboard

Copied

I think you want the client to send the session ID and video ID when it connects. As far as I know, there is no event that is generated by a a play command.

I can't help with the HLS.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 02, 2013 Dec 02, 2013

Copy link to clipboard

Copied

Hi mmah-umd,

thanks for that idea.

In the examples I've found so far the connect command never contains  parameters other than the URL. It always looks like this:

  new NetConnection();

  nc.connect("rtmp://myserver.com/test");

I don't understand how I could add session ID and video ID.

Would this work?

  nc.connect("rtmp://myserver.com/test?video=12345&session=abcdefgh");

Thanks again

Hyper

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 03, 2013 Dec 03, 2013

Copy link to clipboard

Copied

You pass additional arguments to the connect function:

nc.connect("rtmp://myserver.com/test", "12345", "abcdefgh");

On the media server, you define the onConnect function to take as many arguments as you expect:

application.onConnect = function(client, videoID, sessionID){

     // your code to handle client connection here, presumably to check values at remote server

}

The client argument is always present. You can add additional arguments after it.

http://help.adobe.com/en_US/flashmediaserver/ssaslr/WS5b3ccc516d4fbf351e63e3d11a11afc95e-7edfSSASLR....

You have to pass the arguments in the same order as the onConnect function.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 03, 2013 Dec 03, 2013

Copy link to clipboard

Copied

I'm using OSMF strobe media playback and therefore don't have access to the connect() call, but I can change the URL.  Is it possible to send url-encoded params like Hyper.Sonic is suggesting?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 03, 2013 Dec 03, 2013

Copy link to clipboard

Copied

Thanks a lot, that's exactly what I was looking for.

My next step is to check the authorization on the remote server.

Therefore the LoadVars class seems to fit best if my remote server can receive GET and POST requests, right?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 05, 2013 Dec 05, 2013

Copy link to clipboard

Copied

LATEST

@Hyper.Sonic

Yes, LoadVars should work.

@N Tyler

Sorry, I'm not familiar with that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines