This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const leaveConference = (socket, namespace) => async ({ room, from, conferenceRoom }) => { | |
| console.log(`Conference - User "${from}" wants to leave the conference room ${room}`) | |
| try { | |
| const user = await ChatRedis.getUser(room, from) | |
| await ChatRedis.setUser(room, from, { ...user, conference: false }) | |
| socket.leave(conferenceRoom, () => { | |
| namespace.to(conferenceRoom).emit('leaveConference', { room, from }) | |
| }) | |
| } catch (error) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| export default { | |
| async mounted() { | |
| this.myVideo = document.getElementById("localVideo") | |
| // New user gets the offer | |
| if(this.conference.offer) { | |
| const { offer: { from, desc } } = this.conference | |
| this.init(from, desc) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| export default { | |
| methods: { | |
| initWebRTC(user, desc) { | |
| // Add user | |
| this.$set(this.peers, user, { | |
| username: user, | |
| pc: new RTCPeerConnection(this.configuration), | |
| peerStream: undefined, | |
| peerVideo: undefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const conferenceInvitation = (namespace) => async ({ room, to, from }) => { | |
| console.log(`Conference - Invitation from "${from}" to "${to}" in room ${room}`) | |
| try { | |
| const { privateChat, conference } = await ChatRedis.getUser(room, to) | |
| // User already talking | |
| if (privateChat || conference) { | |
| console.log(`Conference - User "${to}" is already talking. PrivateChat: ${privateChat} - Conference: ${conference}`) | |
| return namespace.to(from).emit('conferenceInvitation', { message: `User ${to} is already talking`, from }) | |
| } | |
| namespace.in(room).emit('conferenceInvitation', { room, to, from }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="conference-container"> | |
| <div class="conference-container__header"> | |
| <h3>Private conference (up to 3)</h3> | |
| <md-menu> | |
| <md-button | |
| class="md-icon-button page-container-logout" | |
| md-menu-trigger | |
| :disabled="peersLength === 2 || users.length === 1" | |
| v-if="conference.admin"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const joinConference = (socket, namespace) => ({ username, room, to, from }) => { | |
| const admin = username === to | |
| console.log(admin | |
| ? `Conference - User "${username}" wants to open a conference room` | |
| : `Conference - User "${username}" wants to join the "${to}" conference`) | |
| // Join the room | |
| socket.join(to, async () => { | |
| if (!room) return | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="video"> | |
| <div class="video__spinner"> | |
| <md-progress-spinner | |
| v-if="!videoStream" | |
| class="md-accent" | |
| md-mode="indeterminate"> | |
| </md-progress-spinner> | |
| </div> | |
| <AudioVideoControls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const videoConfiguration = { | |
| data() { | |
| return { | |
| constraints: {}, // Media constraints | |
| configuration: servers, // TURN/STUN ice servers | |
| // Offer config | |
| offerOptions: { | |
| offerToReceiveAudio: 1, | |
| offerToReceiveVideo: 1 | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 23.21.150.121:3478 | |
| iphone-stun.strato-iphone.de:3478 | |
| numb.viagenie.ca:3478 | |
| s1.taraba.net:3478 | |
| s2.taraba.net:3478 | |
| stun.12connect.com:3478 | |
| stun.12voip.com:3478 | |
| stun.1und1.de:3478 | |
| stun.2talk.co.nz:3478 | |
| stun.2talk.com:3478 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let totalSeconds = 0 | |
| // Background image | |
| const backgroundObj = { image: new Image(), ready: false, speed: 100 } | |
| backgroundObj.image.onload = () => backgroundObj.ready = true | |
| backgroundObj.image.src = "images/sky.png" | |
| function paintElements(elapsed) { | |
| if (!firstMove) { |
NewerOlder