Coder Social home page Coder Social logo

johnnyz2017 / rtmp.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yurydelendik/rtmp.js

0.0 0.0 0.0 386 KB

Real Time Message Protocol (RTMP) messaging library in JavaScript

License: Apache License 2.0

JavaScript 1.59% HTML 10.96% TypeScript 87.45%

rtmp.js's Introduction

Real Time Message Protocol (RTMP) messaging library in JavaScript

Prototype implementation of the RTMP protocol. Based on the RTMP specification at http://www.adobe.com/devnet/rtmp.html. Currently only Firefox in special configuration is supported. The RTMP or RTMPT requires either TCP sockets or unrestricted access to XHR. The Firefox (OS) provides both of those features: TCPSocket or systemXHR.

Try running demo-rtmp.html in the browser and monitoring the traffic in the web console. Use a local web server (e.g. python -m SimpleHTTPServer) for that.

Setting up the desktop browser

The security reasons, the desktop browser disables access to the HTTP traffic from the sites that are located in different domains. Also it has no means to communicate over TCP protocol by default. The Firefox OS introduces the following APIs:

To enable that for desktop, follow the instructions at https://github.com/mozilla-b2g/gaia/blob/master/apps/email/README.md :

  • Turn on mozTCPSocket -- in about:config, create "dom.mozTCPSocket.enabled";
  • Grant permission for certain URL, e.g. evaluate in the error console:
host = 'http://test.local:8000';
perm = Components.classes["@mozilla.org/permissionmanager;1"]
                 .createInstance(Components.interfaces.nsIPermissionManager);
ios = Components.classes["@mozilla.org/network/io-service;1"]
                .getService(Components.interfaces.nsIIOService);
uri = ios.newURI(host, null, null);
perm.add(uri, 'systemXHR', 1);
perm.add(uri, 'tcp-socket', 1);
'Successfully added systemXHR and tcp-socket permissions for '+host;

Setting up RTMP server

The Red5 server (http://www.red5.org/) is used for testing. Its download can be found at http://red5.org/downloads/red5/1_0/red5-1.0.0.tar.gz. Navigate to http://localhost:5080/installer/ at install the "OFLA Demo" application.

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.