Copyright © 2013-2016 Kurento. Licensed under Apache 2.0 License.
The project contains the implementation of the JavaScript Kurento Client for [Bower].
The source code of this project can be cloned from the GitHub repository.
Be sure to have installed Node.js and [Bower] in your system:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g bower
To install the library, it's recommended to do that from the [Bower repository] :
bower install kurento-client
Alternatively, you can download the code using git and install manually its dependencies:
git clone https://github.com/Kurento/kurento-client-bower
cd kurento-client-bower
bower install
For tutorial purposes, we are going to create a basic pipeline that play a video file from its URL and stream it over HTTP :
-
Create an instance of the KurentoClient class that will manage the connection with the Kurento Media Server, so you'll need to provide the URI of its WebSocket endpoint. Alternatively, instead of using a constructor, you can also provide success and error callbacks:
var kurento = kurentoClient.KurentoClient(ws_uri); kurento.then(function(kurento) { // Connection success ... }, function(error) { // Connection error ... });
kurentoClient.KurentoClient(ws_uri, function(kurento) { // Connection success ... }, function(error) { // Connection error ... });
-
Create a pipeline. This will host and connect the diferent elements. In case of error, it will be notified on the
error
parameter of the callback, otherwise this will be null as it's common on Node.js style APIs:kurento.create('MediaPipeline', function(error, pipeline) { ... });
-
Create the elements. The player need an object with the URL of the video, and we'll also subscribe to the 'EndOfStream' event of the HTTP stream:
pipeline.create('PlayerEndpoint', {uri: "https://ci.kurento.com/video/format/small.webm"}, function(error, player) { ... }); pipeline.create('HttpGetEndpoint', function(error, httpGet) { httpGet.on('EndOfStream', function(event) { ... }); ... });
-
Connect the elements, so the media stream can flow between them:
player.connect(httpGet, function(error, pipeline) { ... });
-
Get the URL where the media stream will be available:
httpGet.getUrl(function(error, url) { ... });
-
Start the reproduction of the media:
player.play(function(error) { ... });
Kurento is an open source software project providing a platform suitable for creating modular applications with advanced real-time communication capabilities. For knowing more about Kurento, please visit the Kurento project website: https://kurento.openvidu.io/.
Kurento is part of FIWARE. For further information on the relationship of FIWARE and Kurento check the Kurento FIWARE Catalog Entry
Kurento is part of the NUBOMEDIA research initiative.
The Kurento project provides detailed documentation including tutorials, installation and development guides. A simplified version of the documentation can be found on readthedocs.org. The Open API specification a.k.a. Kurento Protocol is also available on apiary.io.
Code for other Kurento projects can be found in the GitHub Kurento Group.
Check the Kurento blog Follow us on Twitter @kurentoms.
Issues and bug reports should be posted to the GitHub Kurento bugtracker
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
You can contribute to the Kurento community through bug-reports, bug-fixes, new code or new documentation. For contributing to the Kurento community, drop a post to the Kurento Public Mailing List providing full information about your contribution and its value. In your contributions, you must comply with the following guidelines
- You must specify the specific contents of your contribution either through a detailed bug description, through a pull-request or through a patch.
- You must specify the licensing restrictions of the code you contribute.
- For newly created code to be incorporated in the Kurento code-base, you must accept Kurento to own the code copyright, so that its open source nature is guaranteed.
- You must justify appropriately the need and value of your contribution. The Kurento project has no obligations in relation to accepting contributions from third parties.
- The Kurento project leaders have the right of asking for further explanations, tests or validations of any code contributed to the community before it being incorporated into the Kurento code-base. You must be ready to addressing all these kind of concerns before having your code approved.
The Kurento project provides community support through the Kurento Public Mailing List and through StackOverflow using the tags kurento and fiware-kurento.
Before asking for support, please read first the Kurento Netiquette Guidelines