App is similar to Twitch
Node Media Server package & RTMP Server
Node Media Server package & RTMP Server
[ Streamer's comp (Open Broadcaster Software - OBS) ]
⇩ (Video stream + stream key) ⇩
[ Real time messaging protocol (RTMP) server ]
⇩ (Video feed) ⇩
[ Viewer's browser #1 ]
[ Viewer's browser #2 ]
[ Viewer's browser #3 ]
[ Streamer's comp (Open Broadcaster Software - OBS) ]
⇩ (Video feed) ⇩
[ Real time messaging protocol (RTMP) server ]
⇩ (Request of [ Viewer's browser #1 ] to get Video feed) ⇩
[ Web server that knows which streams are currently broadcasting ]
⇩ (Response with Video feed URL) ⇩
[ Viewer's browser #1 ]
[ Redux Store (Auth State) ]
⇩ ( isSignedIn: true/false ) ⇩
[ GoogleAuth Component ( onSignInClick() / onSignOutClick() )]
⇩ ⇩
[ GAPI Auth2 ]
⇩ ⇩
[ GoogleAuth Component ( onAuthChange() )]
⇩ ⇩
[ Action Creators ( signIn() / signOut() )]
⇩ ⇩
[ Redux Store (Auth State) ]
[ Redux Store (Auth State) ]
⇩ ( isSignedIn: true/false ) ⇩
[ GoogleAuth Component ( onSignInClick() / onSignOutClick() )]
⇩ ⇩
[ Action Creators ( trySignIn() / trySignOut() )]
⇩ ⇩
[ GAPI Auth2 ]
⇩ ⇩
[ Action Creators ( changeAuth() )]
⇩ ⇩
[ Redux Store (Auth State) ]
[ Selection Reducer ]
( when a user clicks on a stream to edit it, use a selectionReducer to record what stream is being edited )
[ URL-based selection]
( put the ID of the stream being edited in the URL )
( when we use React Router DOM with a specific URL paths with variable /:id pass as a prop )
( Router renders Edit & Delete components with new props: match.params.id )
( we can use some params: edit/:id/:userId/:token )
we will install the Node Media Server package and create our RTMP server
npm version (recommended)
mkdir nms cd nms npm install node-media-server vi app.js
const NodeMediaServer = require('node-media-server');