GithubHelp home page GithubHelp logo

imclab / kurento-client-bower Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kurento/kurento-client-bower

0.0 2.0 0.0 19.39 MB

Bower code generated from kurento-client-js

License: GNU Lesser General Public License v2.1

JavaScript 100.00%

kurento-client-bower's Introduction

Copyright © 2014 Kurento. Licensed under LGPL License.

JavaScript Kurento Client for Bower

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.

Installation instructions

Be sure to have installed Node.js and Bower in your system:

curl -sL https://deb.nodesource.com/setup | sudo 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

How to create a basic pipeline

For tutorial purposes, we are going to create a basic pipeline that play a video file from its URL and stream it over HTTP :

  1. 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
      
    });
  2. 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)
    {
      
    });
  3. 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/small.webm"},
    function(error, player)
    {
      
    });
    
    pipeline.create('HttpGetEndpoint', function(error, httpGet)
    {
      httpGet.on('EndOfStream', function(event)
      {
        
      });
    
      
    });
  4. Connect the elements, so the media stream can flow between them:

    player.connect(httpGet, function(error, pipeline)
    {
      
    });
  5. Get the URL where the media stream will be available:

    httpGet.getUrl(function(error, url)
    {
      
    });
  6. Start the reproduction of the media:

    player.play(function(error)
    {
      
    });

Kurento

What is Kurento

Kurento provides an open platform for video processing and streaming based on standards.

This platform has several APIs and components which provide solutions to the requirements of multimedia content application developers. These include:

  • Kurento Media Server (KMS). A full featured media server providing the capability to create and manage dynamic multimedia pipelines.
  • Kurento Clients. Libraries to create applications with media capabilities. Kurento provides libraries for Java, browser JavaScript, and Node.js.

Downloads

To download binary releases of Kurento components visit http://kurento.org

Code for other Kurento projects can be found in the GitHub Kurento group.

News and Website

Information about Kurento can be found on our website. Follow us on Twitter @kurentoms.

kurento-client-bower's People

Contributors

funlaburjc avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.