This is more of a conceptual question than the direct "how to do it."
As a rule, it is possible to implement a flash-like solution for streaming audio (regardless of where we get the stream data from, for example, webRTC or another) in HTML5 and nodeJS / binaryJS. If so, how would you do it?
Only one object was found in stackoverflow and it has been since 2010. NodeJS and HTML5 have grown and matured since then.
What people usually do: When using streaming media (such as video or audio) to the server, there is certainly nothing that beats Flash at the current time until getUserMedia () arrives completely, which, frankly, can spend some time until 99 % of browser users will not be able to use it at all.
A common practice for transferring data to a server is to use a Flash or Flex client application, which then connects to the server powered by RTMP, such as RED5 , FMS or Wowza . For example, a client application sending microphone input via RTMP might look (simplified version)
import flash.net.NetStream; private var myMic:Microphone; private var nc:NetConnection; private var ns:NetStream nc = new NetConnection(); ns = new NetStream(nc); nc.connect(rtmp:
Together with the server application, you can easily transfer data to the server.
What I would like to do: An application server running on nodeJS (possibly implementing socketIO and binaryJS ) that captures the incoming RTMP stream. Something like
//require var rtmp = require('node-rtmp'), var fs = require('fs'); //rtmp server address var rtmpServer = 'rtmp://localhost'; //create a binary server listening that receives stream data var RTMPServer = rtmp.RTMPServer(); var server = RTMPServer ({port: 1935}); server.on('connection', function(client){ //check if user is allowed to do so rtmp.newStream(client.stream); });
It might be better to use socketIO to differentiate user interactions using eventEmitters.
What may be the benefits:. Generally speaking, it seems a bit overkill to make such an approach, but there may be advantages to me, and I would also like you to comment on this.
- simple verification of user interaction by running, for example. express and socketIO
- hybrid flash implementation (via RTMP) and getUserMedia () (via binary transport mechanisms by adding binary JS and Mozilla AudioAPI)
- if getUserMedia () is fully supported, Flash implementations can be easily removed.
- more control over rtmp execution and user interaction in general
- Simplified implementation in server infrastructure.
UPDATE: I spoke with Mr. Malcontenti-Wilson, who is only responsible for the node-rtmp package , which was written but stopped 8 months ago because it was poorly written, and it ended up at the checkpoint. Has anyone used this or were able to verify the code?
UPDATE 2: Mr. Malcontenti-Wilson will just send me a letter to draw attention to node -mtrude (a kind of odd name), which does something like what we probably want. Does anyone work with such a package?