diff --git a/README.md b/README.md index 887720b..1818cd7 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,3 @@ -# hello-express - -A server that serves a webpage, its resources, and some data - - -## Your Project - -On the front-end, - -- Edit `views/index.html` to change the content of the webpage -- `public/client.js` is the javacript that runs when you load the webpage -- `public/style.css` is the styles for `views/index.html` -- Drag in `assets`, like images or music, to add them to your project - -On the back-end, - -- your app starts at `server.js` -- add frameworks and packages in `package.json` -- safely store app secrets in `.env` (nobody can see this but you and people you invite) - -Click `Show` in the header to see your app live. Updates to your code will instantly deploy. - - -## Made by [Glitch](https://glitch.com/) - -**Glitch** is the friendly community where you'll build the app of your dreams. Glitch lets you instantly create, remix, edit, and host an app, bot or site, and you can invite collaborators or helpers to simultaneously edit code with you. - -Find out more [about Glitch](https://glitch.com/about). - -( ᵔ ᴥ ᵔ ) \ No newline at end of file +# YASWVC - Yet Another Simple WebRTC Video Chat +- simple webrtc videochat using peerjs +- based on [https://glitch.com/~peerjs-video](https://glitch.com/~peerjs-video) \ No newline at end of file diff --git a/package.json b/package.json index 1286c9e..24072c7 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,7 @@ { - "//1": "describes your app and its dependencies", - "//2": "https://docs.npmjs.com/files/package.json", - "//3": "updating this file will download and update your packages", - "name": "hello-express", + "name": "yaswvc", "version": "0.0.1", - "description": "A simple Node app built on Express, instantly up and running.", + "description": "Yet Another Simple WebRTC Video Chat", "main": "server.js", "scripts": { "start": "node server.js" @@ -16,9 +13,6 @@ "engines": { "node": "12.x" }, - "repository": { - "url": "https://glitch.com/edit/#!/hello-express" - }, "license": "MIT", "keywords": [ "node", diff --git a/public/main.js b/public/main.js index 74d17fe..e9989d6 100644 --- a/public/main.js +++ b/public/main.js @@ -13,8 +13,8 @@ let logMessage = (message) => { messagesEl.appendChild(newMessage); }; -let renderVideo = (stream) => { - videoEl.srcObject = stream; +let renderVideo = (stream, selector = '.remote-video') => { + document.querySelector(selector).srcObject = stream; }; // Register with the peer server @@ -45,6 +45,7 @@ peer.on('call', (call) => { navigator.mediaDevices.getUserMedia({video: true, audio: true}) .then((stream) => { call.answer(stream); // Answer the call with an A/V stream. + renderVideo(stream, '#localVideo') call.on('stream', renderVideo); }) .catch((err) => { diff --git a/views/index.html b/views/index.html index ac9713b..606b44e 100644 --- a/views/index.html +++ b/views/index.html @@ -6,9 +6,9 @@ - + - Welcome to Glitch! + YASWVC @@ -21,6 +21,7 @@ +