function onOffer(error, sdpOffer) {
if (error) return onError(error);
kurentoClient(args.ws_uri, function (error, kurentoClient) {
if (error) return onError(error);
kurentoClient.create("MediaPipeline", function (error, pipeline) {
if (error) return onError(error);
console.log("Got MediaPipeline");
var elements =
[
{type: 'PlayerEndpoint', params: {uri: address.value}},
{type: 'RecorderEndpoint', params: {uri: args.file_uri}},
{type: 'WebRtcEndpoint', params: {}},
]
pipeline.create(elements, function (error, elements) {
if (error) return onError(error);
var player = elements[0];
var recorder = elements[1];
var webRtcEndpoint = elements[2];
setIceCandidateCallbacks(webRtcEndpoint, webRtcPeer, onError);
webRtcEndpoint.processOffer(sdpOffer, function (error, sdpAnswer) {
if (error) return onError(error);
console.log("offer");
webRtcEndpoint.gatherCandidates(onError);
webRtcPeer.processAnswer(sdpAnswer);
});
kurentoClient.connect(webRtcEndpoint, webRtcEndpoint, recorder, function (error) {
if (error) return onError(error);
console.log("Connected");
recorder.record(function (error) {
if (error) return onError(error);
console.log("Record");
player.connect(webRtcEndpoint, function (error) {
if (error) return onError(error);
console.log("PlayerEndpoint-->WebRtcEndpoint connection established");
player.play(function (error) {
if (error) return onError(error);
console.log("Player playing ...");
recordButton.addEventListener("click", function (event) {
recorder.stop();
console.log("Record Stopped");
});
});
});
});
});
});
});
}
);
}
--
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.
player.connect(webRtcEndpoint, function (error) {
if (error) return onError(error);
console.log("PlayerEndpoint-->WebRtcEndpoint connection established");
kurentoClient.connect(player, player, recorder, function (error) {
if (error) return onError(error);
console.log("PlayerEndpoint-->Recorder connection established");
player.play(function (error) {
if (error) return onError(error);
console.log("Player playing ...");
recorder.record(function (error) {
if (error) return onError(error);
console.log("Record");
recordButton.addEventListener("click", function (event) {
recorder.stop();
console.log("Record Stopped");
});
});
});
});
});
player.connect(webRtcEndpoint, function (error) {
if (error) return onError(error);
console.log("PlayerEndpoint-->WebRtcEndpoint connection established");
player.connect(recorder, function (error) {
if (error) return onError(error);
console.log("PlayerEndpoint-->Recorder connection established");
player.play(function (error) {
if (error) return onError(error);
console.log("Player playing ...");
recorder.record(function (error) {
if (error) return onError(error);
console.log("Record");
recordButton.addEventListener("click", function (event) {
recorder.stop();
console.log("Record Stopped");
});
});
});
});
});
...
...
...
type: 'RecorderEndpoint', params: {
stopOnEndOfStream:true,
mediaProfile:'WEBM',
uri: args.file_uri
}
...
...