function create() {
getKurentoClient(function(error, kurentoClient) {
if (error) {
return console.error(error);
}
kurentoClient.create('MediaPipeline', function(error, pipeline) {
if (error) {
return console.error(error);
}
pipeline.create('DispatcherOneToMany', function(error, dispatcher) {
if (error) {
pipeline.release();
return console.error(error);
}
var opts = {uri: 'file:///tmp/big_buck_bunny.webm'};
pipeline.create('PlayerEndpoint', opts, function(error, playerEndpoint) {
if (error) {
return console.error(error);
}
dispatcher.createHubPort(function(error, hubPort) {
if (error) {
return console.error(error);
}
dispatcher.setSource(hubPort, function(error) {
if (error) {
return console.error(error);
}
hubPort.connect(playerEndpoint, function(error) {
if (error) {
return console.error(error);
}
playerEndpoint.connect(hubPort, function(error) {
if (error) {
return console.error(error);
}
startPlayer(playerEndpoint, hubPort, dispatcher);
});
});
});
});
});
});
});
});
}
function startPlayer(playerEndpoint, hubPort, dispatcher) {
playerEndpoint.play().then(function() {
playerEndpoint.on('EndOfStream', function(event) {
playerEndpoint.stop().then(function() {
playerEndpoint.play().then(function() {
dispatcher.setSource(hubPort).then(handleSuccess, handleError);
}, handleError);
}, handleError);
});
}, handleError);
}
function handleError(err) {
if (err) {
console.error(err);
}
}
function handleSuccess(data) {
if (data) {
console.log("Success: " + JSON.stringify(data));
}
else {
console.log("Success");
}
}
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/ec219cba-ea50-4188-b791-dd3173097cf5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+unsubscribe@googlegroups.com.
To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/3a7c7d46-ea8b-48d2-8640-04d2b727e41a%40googlegroups.com.
To unsubscribe from this group and all its topics, send an email to kurento+unsubscribe@googlegroups.com.
To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/CAGjSk5%2B2xRiYZB0KoBLoo_djBKN7DRn2a34ugxoZ1E%2BafeO3gw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/F6AB4413-0636-4CA8-8560-D72DCA5A0DE7%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/CAGjSk5Kq4%2BTFtH1v1KgmMr-7FyP2ZniExtM%3DpuoaG-0T60F0Mg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/CA%2Bix1gzL9ToVgDGTE-zhAVPh%3DojxmSdpML1%2BDPvAnDkEihM5jw%40mail.gmail.com.