Live stream with Session ID

Issues related to playing with Flash Player

Live stream with Session ID

Postby JeffHr » Wed Mar 26, 2014 8:35 am

I have not been able to get the umsplayer.js to play a live stream with a session ID. It all works without a session ID. I've verified that the server is accurately registering the ID by using the installed Unreal Streaming Media Player which will play with the ID. And if I use an incorrect ID, it won't play. So the server side is working with the session ID. I've searched the FAQ, Googled, etc., but I can't find any documentation on how to stream live flash using a session ID.

Here is my player code:
<html>
<script charset="utf-8" src="/SiteDirectory/csm/_layouts/staffmeeting/umsplayer.js" type="text/javascript"></script>

<body id="unload-trigger-element">
<!-- player container -->
<div id="player-container">
</div>

<script type="text/javascript">
embedPlayer('player-container', {
flashvars : {
'rtmp' : 'rtmp://10.10.11.145:5119/live/CaryStaffMeeting\\\\\\SID:<asp:Literal id="sid" runat="server" />'
},
size : { width: 640, height: 600 },
playerStyle : 'glow'
});
</script>
</body>
</html>

A packet capture on the server shows it is receiving "CaryStaffMeeting\\\SID:dTrERJxXJyCxQvOM1xrnB" as the alias. For the same session ID, a connection from the Streaming Media Player results in "rtp-unicast:{fbb866af-7670-4757-bf61-1a65cf924de2}/URMS80/0000live-alias:CaryStaffMeeting///SID:64547245524a78584a79437851764f4d3178726e42" One notable thing here is that the SID seems to be encrypted where the embedded player shows the actual SID that was generated. I tried using the encrypted version of the SID in the code above, but that did not work either.

Thank you for your help.
Jeff
JeffHr
 
Posts: 0
Joined: Wed Mar 26, 2014 7:55 am

Re: Live stream with Session ID

Postby admin » Wed Mar 26, 2014 9:15 am

Jeff,

Your code looks OK, but I think you misunderstand how our session-based authentication works.

First, make sure that a live broadcast with alias "CaryStaffMeeting" uses session-based authentication. Does it? And then Unreal Streaming Media Player still plays OK with the session id?
One thing that also needs to happen is that some web app (your web app) needs to authorize the user and call "AddSessionWithIP" COM method of Media Server, passing session id as a parameter.
Do you have this functionality done? Please refer to our sample code found in SDK package: http://www.umediaserver.net/umediaserver/source.html
admin
Site Admin
 
Posts: 1030
Joined: Fri Aug 21, 2009 10:13 am

Re: Live stream with Session ID

Postby JeffHr » Wed Mar 26, 2014 10:20 am

I used the installed Unreal Streaming Media Player to verify that the server is working with a session ID. The player will only play it with a valid session ID. So there is a live broadcast with alias "CaryStaffMeeting" using session based authentication. For now, "AddSession" COM method is being called, not the "AddSessionWithIP" since I don't have the code in place to get the IP address. If there was a problem with the server, it would not have worked with this player.

I can't use the Unreal Streaming Media Player for production because it requires an admin to install it. Therefore, I'm trying to use an embedded player on the page.

The problem is that the embedded player will only work if I turn off session based authentication. With it on, I get "The session doesn't exist on the server" in the player. But I've proved it does exist on the server by using the Streaming Media Player which will play, but only with the correct session ID.

Will umsplayer.js work with session based authentication or do I need to use UMediaControl6.cab? If the later, how do I tell it to play a live rtmp stream instead of a file. The demo in the SDK package uses the UMediaControl6.cab, but it has .UseFile("MediaRoot\\test.avi"). How would I tell it to use a live rtmp stream?

Thanks,
Jeff
JeffHr
 
Posts: 0
Joined: Wed Mar 26, 2014 7:55 am

Re: Live stream with Session ID

Postby admin » Wed Mar 26, 2014 2:49 pm

Yes umsplayer.js (Flash player) will work with session-based authentication.
Streaming Media Player (standalone or embedded in web page) will work too.

You seem to do everything correctly. Let's verify that your web page passes the right SID to the server:
"CaryStaffMeeting\\\SID:dTrERJxXJyCxQvOM1xrnB" - are you sure that dTrERJxXJyCxQvOM1xrnB is the right session ID?
You are adding this exact session id on the server with AddSession COM method?
admin
Site Admin
 
Posts: 1030
Joined: Fri Aug 21, 2009 10:13 am

Re: Live stream with Session ID

Postby JeffHr » Wed Mar 26, 2014 3:51 pm

I added a link to the bottom of the page for testing with Unreal Streaming Media Player. Here is the "View Page Source" from Firefox of the page:

<html>
<script charset="utf-8" src="/SiteDirectory/csm/_layouts/staffmeeting/umsplayer.js" type="text/javascript"></script>

<body id="unload-trigger-element">
<div id="player-container"></div>

<script type="text/javascript">
embedPlayer('player-container', {
flashvars : {'rtmp' : 'rtmp://10.10.11.145:5119/live/CaryStaffMeeting\\\\\\SID:3U1nE0k10cd6fo677VPNT'},
size : { width: 640, height: 600 },
playerStyle : 'glow'});
</script>
<a href="ums://udp:10.10.11.145:5119/CaryStaffMeeting\\\SID:3U1nE0k10cd6fo677VPNT">UMS link</a>;
</body>
</html>

When I click on the UMS Link (3rd line from the bottom), it works great in the Streaming Media Player. If I copy and paste the link into the browser, it works the same. If I change a character in the SID string, it tells me that the session doesn't exist. This proves that the server is receiving and properly registering the SID. If not, the Streaming Media Player would not work.

Note that each new session gets a different SID.

One thing that I notice is that the ums link needs to have udp: in front of the address. It also does not like "live/" in front of the alias. I experimented with putting udp: in front of the address on the embedded player and it does make it look like it is going the work, but then eventually gives a "Connect Failed" message. I understand these are different players and will need different links, but I thought this might give a clue.

Thank you,
Jeff
JeffHr
 
Posts: 0
Joined: Wed Mar 26, 2014 7:55 am

Re: Live stream with Session ID

Postby admin » Wed Mar 26, 2014 5:24 pm

Not sure what to tell you. Everything seems right. Yet the Flash player says "Session doesn't exist"?
At what point do you call AddSession on the server, and RemoveSession? Any chance that you remove session before Flash player connects?
From packet capture at the server, do you see RTMP command like "play...........CaryStaffMeeting\\\\\\SID:3U1nE0k10cd6fo677VPNT"?
admin
Site Admin
 
Posts: 1030
Joined: Fri Aug 21, 2009 10:13 am

Re: Live stream with Session ID

Postby JeffHr » Thu Mar 27, 2014 2:27 pm

Thank you for your replies.

I do not currently have a RemoveSession implimented. I added a delay to the player to make sure the player was not loading before the server was ready, but that did not solve the problem. With a 20 second delay, I was able to use the session ID that was generated to view the stream with Streaming Media Player before and after the embedded player came on the screen, but the embedded player still fails with "The session doesn't exist on the server".

The packet capture is a little different from your example of the RTMP command. I have 12 dots instead of 11 plus I have a comma just before CaryStaffMeeting. Also, only 3 \\\. Here is what I get:
play............,CaryStaffMeeting\\\SID:i0qwIMt6PkWtVMeAwqz0u...
And with the dots replaced with their ascii code:
play NUL NUL NUL NUL NUL NUL NUL NUL NUL ENQ STX NUL ,CaryStaffMeeting\\\SID:i0qwIMt6PkWtVMeAwqz0u xC2 NUL ETX

The packet capture coming from the Streaming Media Player with the same session ID is: /URMS80/0000live-alias:carystaffmeeting///SID:69307177494d7436506b5774564d654177717a3075
I see in this that the SID is sent in the hex values of the actual SID: i is 0x69, 0 is 0x30, etc.
Do I need to convert the string given to the embedded player to hex?

Thank you,
Jeff
JeffHr
 
Posts: 0
Joined: Wed Mar 26, 2014 7:55 am

Re: Live stream with Session ID

Postby admin » Fri Mar 28, 2014 1:10 pm

Everything seems right.
You don't have to convert the SID to HEX.

But I have an idea - Try convert Session ID to lower case for Flash player.
admin
Site Admin
 
Posts: 1030
Joined: Fri Aug 21, 2009 10:13 am

Re: Live stream with Session ID

Postby JeffHr » Tue Apr 01, 2014 11:22 am

Converting the Session ID to lowercase with numbers solved the problem.

Will the Flash player be fixed to work with uppercase as well?

Thank you for your help.

Jeff
JeffHr
 
Posts: 0
Joined: Wed Mar 26, 2014 7:55 am

Re: Live stream with Session ID

Postby admin » Tue Apr 01, 2014 1:37 pm

It's not a Flash player problem - you will have the same problem with JW player, Flowplayer. We just accept SIDs with lowercase characters only - that's current server behavior.
Just use lowercase SIDs.

Note that Unreal player converts SIDs to lowercase automatically.
admin
Site Admin
 
Posts: 1030
Joined: Fri Aug 21, 2009 10:13 am


Return to Playing with Flash Player

Who is online

Users browsing this forum: No registered users and 1 guest

cron