A stream published on the WCS server can be played via RTSP in a third-party player. In this case, WCS itself serves as an RTSP-source.
1. For the test we use:
2. Open the Two Way Streaming application. Click Connect, then Publish. Copy the identifier of the stream:
3. Run VLC, select the "Media - Open network stream" menu. Enter the URL of the WCS server and enter the identifier of the stream, in this exampe:
rtsp://demo.flashphoner.com/fc6a:
4. Click the "Play" button. The player starts playing the stream:
Below is the call flow when playing a stream via RTSP in a software player.
RTSP playback authentication via REST hook acn be set up if necessary. To do this, the following parameter should be set in flashphoner.properties file:
rtsp_server_auth_enabled=true |
When RTSP connection is established, /playRTSP query will be sent to backend server
URL:http://localhost:8081/EchoApp/playRTSP OBJECT: { "nodeId" : "d2HdO4ImTdAhrdXzfszhH2vaQUCarwIw@192.168.1.5", "appKey" : "defaultApp", "sessionId" : "/192.168.1.100:32008/192.168.1.5:554", "published" : false, "hasVideo" : false, "hasAudio" : true, "status" : "NEW", "record" : false, "width" : 0, "height" : 0, "bitrate" : 0, "minBitrate" : 0, "maxBitrate" : 0, "quality" : 0, "rtspUrl" : "rtsp://test.flashphoner.com/test", "User-Agent" : "WebCallServer-5.1.3656-c89df1ade515d826aaef1e006e6f3d3398d21c69" } |
Such query will be sent on using every RTSP method excepting OPTIONS. If backend server responds 200 OK, WCS server allows to execute RTSP method and to play RTSP stream. If backend server returns 403 Forbidden, WCS server breaks the connection with RTSP client.
Thus, RTSP client can be authenticated by RTSP stream URL, User-Agent, client and server IP address and port.