1
0
Fork 0
mirror of https://api.glitch.com/git/yaswvc synced 2026-01-12 17:38:11 +00:00

Compare commits

...

4 commits

Author SHA1 Message Date
Glitch (peerjs-video)
62a2a001ad 🐮🏭 Checkpoint
./public/main.js:5975361/453
2020-09-10 22:27:39 +00:00
Glitch (peerjs-video)
6585d78d83 🎯👞 Checkpoint
./public/main.js:5975361/95
2020-09-10 21:30:56 +00:00
Glitch (peerjs-video)
9daa3a4950 🐿😘 Checkpoint
./public/index.html:5975361/109
./public/main.js:5975361/275
2020-09-10 21:19:22 +00:00
Glitch (peerjs-video)
ed5abf84bc 🌏🍩 Checkpoint
./public/index.html:5975361/1007
2020-09-10 21:08:03 +00:00
2 changed files with 26 additions and 10 deletions

View file

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

View file

@ -13,16 +13,10 @@ var app = new Vue({
{ urls: 'stun:stun.sipnet.net:3478' }, { urls: 'stun:stun.sipnet.net:3478' },
{ urls: 'stun:stun.ideasip.com:3478' }, { urls: 'stun:stun.ideasip.com:3478' },
{ urls: 'stun:stun.iptel.org:3478' }, { urls: 'stun:stun.iptel.org:3478' },
{ urls: 'turn:numb.viagenie.ca', username: 'imvasanthv@gmail.com', credential: 'd0ntuseme' },
{ {
urls: [ urls: 'turn:161.35.211.133:3478',
'turn:173.194.72.127:19305?transport=udp', username: 'guest',
'turn:[2404:6800:4008:C01::7F]:19305?transport=udp', credential: 'somepassword'
'turn:173.194.72.127:443?transport=tcp',
'turn:[2404:6800:4008:C01::7F]:443?transport=tcp'
],
username: 'CKjCuLwFEgahxNRjuTAYzc/s6OMT',
credential: 'u1SQDR/SQsPQIxXNWQT7czc/G4c='
} }
], ],
'sdpSemantics': 'unified-plan', 'sdpSemantics': 'unified-plan',
@ -32,6 +26,7 @@ var app = new Vue({
stream: null, stream: null,
calls: [], calls: [],
connections: [], connections: [],
chatInput: '',
}, },
methods: { methods: {
logMessage: function(message) { logMessage: function(message) {
@ -81,12 +76,21 @@ var app = new Vue({
}, },
hangUp: function() { hangUp: function() {
this.calls.forEach(c => { this.calls.forEach(c => {
console.log('hangUp - closing', c);
c.close(); c.close();
}); });
this.connections.forEach(c => { this.connections.forEach(c => {
console.log('hangUp - closing', c);
c.close(); c.close();
}); });
}, },
sendMessage: function(text = this.chatInput) {
this.connections.forEach(c => {
c.send(text);
this.logMessage(`Me: ${text}`);
this.chatInput = '';
});
},
listenForPeerEvents: function () { listenForPeerEvents: function () {
this.peer.on('open', (id) => { this.peer.on('open', (id) => {
localStorage.setItem('yaswvc-peerId', id); localStorage.setItem('yaswvc-peerId', id);