Created
July 17, 2015 15:16
-
-
Save randallb/bb52e8a57fc560316c2f to your computer and use it in GitHub Desktop.
Kurento pipeline which only one audio records.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.createCompositePipeline = function(hostSdpOffer, guestSdpOffer, callback) { | |
| if (callback == null) { | |
| callback = function() {}; | |
| } | |
| console.log("Creating call pipeline"); | |
| return client.create('MediaPipeline', function(err, pipeline) { | |
| return pipeline.create('WebRtcEndpoint', function(err, hostWebRtcEndpoint) { | |
| return pipeline.create('WebRtcEndpoint', function(err, guestWebRtcEndpoint) { | |
| return pipeline.create('Composite', function(err, composite) { | |
| return composite.createHubPort(function(err, guestHubPort) { | |
| return composite.createHubPort(function(err, hostHubPort) { | |
| return hostWebRtcEndpoint.connect(hostHubPort, function() { | |
| return guestWebRtcEndpoint.connect(guestHubPort, function() { | |
| return hostHubPort.connect(hostWebRtcEndpoint, function() { | |
| return guestHubPort.connect(guestWebRtcEndpoint, function() { | |
| return hostWebRtcEndpoint.processOffer(hostSdpOffer, function(err, hostAnswer) { | |
| return guestWebRtcEndpoint.processOffer(guestSdpOffer, function(err, guestAnswer) { | |
| console.log("Sending host answer back."); | |
| callback(err, hostAnswer, guestAnswer); | |
| return pipeline.create('RecorderEndpoint', { | |
| uri: "file:///tmp/movie_recordings/composite_sample_clip_" + (getFilename()) + ".webm" | |
| }, function(err, _recorder) { | |
| return hostHubPort.connect(_recorder, function() { | |
| console.log("probably connected everything correctly?"); | |
| return _recorder.record(function() { | |
| return console.log("probably recording??"); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://s3.amazonaws.com/media.vidpresso.com/uploads/1437146359546-mj1t0fk78v1b57b9-f1e211178edfcd42cb13b4e9c1e0324a/composite_sample_clip_980.webm