Your application is as simple as your schema.
Just create a player and a WebRtcEndpoint. Assign rtsp URL to player and negotiate webrtc endpoint. Then execute play in player.
There are examples of all of this in demo projects.
--
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I cannot write the code for you now, There is a lot of sample code in the repository, I think that there is a player example for java.
Okay, but how to do it? You can sample code using PlayerEndpoint? Where to indicate the source PlayerEndpoint?
пятница, 9 января 2015 г., 14:03:08 UTC+4 пользователь Jose Antonio Santos Cadenas написал:
private synchronized void master(WebSocketSession session, JsonObject jsonMessage) throws IOException {
if (masterUserSession == null) { masterUserSession = new UserSession(session);
pipeline = kurento.createMediaPipeline(); masterUserSession.setWebRtcEndpoint(new WebRtcEndpoint.Builder(pipeline).build());
WebRtcEndpoint masterWebRtc = masterUserSession.getWebRtcEndpoint(); PlayerEndpoint player = new PlayerEndpoint.Builder(pipeline, "rtsp://user:pass...@192.168.1.6:554").build()); //Create piperline PlayerEndpoint and URL RTSP player.connect(masterWebRtc); masterWebRtc.connect(player); String sdpOffer = jsonMessage.getAsJsonPrimitive("sdpOffer").getAsString(); String sdpAnswer = masterWebRtc.processOffer(sdpOffer);
JsonObject response = new JsonObject(); response.addProperty("id", "masterResponse"); response.addProperty("response", "accepted"); response.addProperty("sdpAnswer", sdpAnswer); masterUserSession.sendMessage(response);
}
else { JsonObject response = new JsonObject(); response.addProperty("id", "masterResponse"); response.addProperty("response", "rejected"); response.addProperty("message", "Another user is currently acting as sender. Try again later ..."); session.sendMessage(new TextMessage(response.toString())); } }Received message: {"id":"viewerResponse","response":"accepted","sdpAnswer":"v=0
o=- 4703690930233602263 0 IN IP4 0.0.0.0
s=TestSession
c=IN IP4 0.0.0.0
t=0 0
a=group:BUNDLE audio video
m=audio 57339 RTP/SAVPF 0
c=IN IP4 192.168.1.74
a=rtpmap:0 PCMU/8000
a=sendonly
a=rtcp:57339 IN IP4 192.168.1.74
a=ice-ufrag:Pebg
a=ice-pwd:gBaz2VNNan2mTJbQ8Tdf/S
a=fingerprint:sha-256 ...trunc...
a=rtcp-mux
a=candidate:1 1 UDP 2013266431 192.168.1.74 57339 typ host
a=ssrc:1383035648 cname:user3936730632@host-2fb7e75f
m=video 57339 RTP/SAVPF 100
c=IN IP4 192.168.1.74
a=rtpmap:100 VP8/90000
a=sendonly
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp:57339 IN IP4 192.168.1.74
a=ice-ufrag:Pebg
a=ice-pwd:gBaz2VNNan2mTJbQ8Tdf/S
a=fingerprint:sha-256 ...trunc...
a=rtcp-mux
a=candidate:1 1 UDP 2013266431 192.168.1.74 57339 typ host
a=ssrc:97106667 cname:user3936730632@host-2fb7e75f
"}
SDP answer received, setting remote description
--