mirror of
https://api.glitch.com/git/yaswvc
synced 2026-01-12 22:38:11 +00:00
Compare commits
4 commits
6ace8df5d4
...
62a2a001ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62a2a001ad | ||
|
|
6585d78d83 | ||
|
|
9daa3a4950 | ||
|
|
ed5abf84bc |
2 changed files with 26 additions and 10 deletions
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue