Skip to content

Commit

Permalink
third commmit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronak-Ronu committed Nov 20, 2022
1 parent c15b9d1 commit 069f200
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 12 deletions.
128 changes: 128 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"description": "",
"main": "server.js",
"scripts": {
"test": "echo Error: no test specified && exit 1",
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},

"keywords": [],
"author": "",
"license": "ISC",

"dependencies": {
"ejs": "^3.1.8",
"express": "^4.18.2",
"peer": "^0.6.1",
"peerjs": "^1.4.7",
"socket.io": "^4.5.3",
"uuid": "^9.0.0"
}
Expand Down
8 changes: 4 additions & 4 deletions public/script.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const socket= io('/');
const videogrid=document.getElementById('video-grid');
const myvideo=document.createElement('video');
myvideo.muted=true;
var peer = new Peer(undefined,{
path:'/peerjs',
host:'/',
port:'443'
port:'9000'
});
const myvideo=document.createElement('video');
myvideo.muted=true;
let myvideostream;
navigator.mediaDevices.getUserMedia({
video:true,
Expand Down Expand Up @@ -35,7 +35,7 @@ const connecttouser=(userid,stream)=>{
call.on('stream',uservideostream =>{
addvideostream(video,uservideostream);
})
console.log('new user connected :',userid);
console.log('user connected :',userid);
}
const addvideostream=(video,stream)=>{
video.srcObject=stream;
Expand Down
4 changes: 2 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const app = express()
const server= require('http').Server(app);
const io=require('socket.io')(server);
const { v4:uuidv4} = require('uuid');
const {ExpressPeerServer}=require('peer');
const peerServer=ExpressPeerServer(server,{
const { ExpressPeerServer}=require('peer');
const peerServer = ExpressPeerServer(server,{
debug:true
});
app.set('view engine','ejs');
Expand Down
8 changes: 5 additions & 3 deletions views/room.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@
text-align: center;
}
video{
display: grid;
height: 380px;
width: 300px;
border-radius: 30px;
grid-template-columns: repeat(auto-fill,100px);
grid-auto-rows: 300px;
border: 7px solid rgba(156, 70, 156,.2);
object-fit: cover;
}
video-grid{
display: grid;
grid-template-columns: repeat(auto-fill,100px);
grid-auto-rows: 300px;
}
</style>
<script>
const ROOMID="<%= roomId %>";
Expand Down

0 comments on commit 069f200

Please sign in to comment.