1
0
Fork 0
mirror of https://api.glitch.com/git/yaswvc synced 2026-01-12 03:18:10 +00:00

🐿😘 Checkpoint

./public/index.html:5975361/109
./public/main.js:5975361/275
This commit is contained in:
Glitch (peerjs-video) 2020-09-10 21:19:22 +00:00
parent ed5abf84bc
commit 9daa3a4950
2 changed files with 12 additions and 4 deletions

View file

@ -94,13 +94,13 @@
</button>
<hr>
<div class="messages mt-1" style="min-height:30px;border:1px solid lightgrey;border-radius:.25rem;"></div>
<hr>
<br>
<div class="row">
<div class="col-12 col-sm-10">
<input type="text" class="form-control">
<input type="text" v-model="chatInput" class="form-control">
</div>
<div class="col-2">
<div class="btn btn-primary float-right">
<div class="col-12 col-sm-2">
<div class="btn btn-primary float-right" v-on:click="sendMessage()">
Send
</div>
</div>

View file

@ -32,6 +32,7 @@ var app = new Vue({
stream: null,
calls: [],
connections: [],
chatInput: '',
},
methods: {
logMessage: function(message) {
@ -81,12 +82,19 @@ var app = new Vue({
},
hangUp: function() {
this.calls.forEach(c => {
console.log('hangUp - closing', c);
c.close();
});
this.connections.forEach(c => {
console.log('hangUp - closing', c);
c.close();
});
},
sendMessage: function(text = this.chatInput) {
this.connections.forEach(c => {
c.send(text);
});
},
listenForPeerEvents: function () {
this.peer.on('open', (id) => {
localStorage.setItem('yaswvc-peerId', id);