Skip to content

Commit d3705c5

Browse files
author
Gilgamesh
committed
Merge branch 'dev' of https://github.com/oslabs-beta/Swell into dev
2 parents c173504 + 2578fb2 commit d3705c5

File tree

3 files changed

+47
-4
lines changed

3 files changed

+47
-4
lines changed

src/client/components/Versions.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
import * as React from 'react';
22
import { useState } from 'react';
33

4+
declare global {
5+
interface Window {
6+
api: {
7+
versions: {
8+
electron: string;
9+
chrome: string;
10+
node: string;
11+
};
12+
};
13+
}
14+
}
15+
416
function Versions(): JSX.Element {
517
const [versions] = useState(window.api.versions);
618

src/client/components/main/WebRTC-composer/WebRTCServerEntryForm.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React from 'react';
22
import Joyride from 'react-joyride';
33
import { useState, useRef, useEffect } from 'react';
44
import { MdRefresh } from 'react-icons/md';
5+
import { Placement } from 'react-joyride';
6+
57

68
// import '/Users/katharinehunt/Swell/src/assets/style/WebRtcEntry.css';
79
import '../../../../assets/style/WebRtc.css';
@@ -88,23 +90,23 @@ const WebRTCServerEntryForm: React.FC<Props> = (props: Props) => {
8890
{
8991
target: '.get-offer-button',
9092
content: 'Caller: Generate an offer by clicking “Get Offer”.',
91-
placement: 'bottom',
93+
placement: 'bottom' as Placement,
9294
},
9395
{
9496
target: '.copy-offer-button', // Target the "Copy" button in the Offer code box
9597
content:
9698
'Caller: Copy to clipboard, paste and send to recipient (email recommended).',
97-
placement: 'bottom',
99+
placement: 'bottom' as Placement,
98100
},
99101
{
100102
target: '.offer-paste-button',
101103
content: 'Recipient: Copy the offer received and paste into the top box',
102-
placement: 'bottom',
104+
placement: 'bottom' as Placement,
103105
},
104106
{
105107
target: '.get-answer-btn',
106108
content: "Recipient: Click 'Get Answer' and copy it.",
107-
placement: 'bottom',
109+
placement: 'bottom' as Placement,
108110
},
109111
{
110112
target: '.answer-paste-button',

src/client/controllers/webrtcPeerController.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,33 @@ const webrtcPeerController = {
3131
],
3232
};
3333
let peerConnection = new RTCPeerConnection(servers);
34+
// ? if you want to attempt to build a websocket with a live connection through ngrok,
35+
// ? give it a shot - we attempted below, this may be helpful, probably isn't (-Isaac M)
36+
37+
// let wsIp = newRequestWebRTC.webRTCWebsocketServer;
38+
// const socket = io('http://localhost:3000');
39+
40+
// socket.on('connect', async () => {
41+
// // try {
42+
// // const url = await ngrok.connect({
43+
// // proto: 'http',
44+
// // addr: 3000,
45+
// // });
46+
// // console.log(`ngrok tunnel opened at: ${url}`);
47+
// // // client.emit('ngrokUrl', url);
48+
// // } catch (err) {
49+
// // console.error('Failed to create ngrok tunnel:', err);
50+
// // }
51+
// console.log('Connected to server');
52+
// });
53+
54+
// socket.on('disconnect', () => {
55+
// console.log('Disconnected from server');
56+
// });
57+
58+
// socket.on('message', (message: string) => {
59+
// console.log('Message:', message);
60+
// });
3461

3562
if (newRequestWebRTC.webRTCDataChannel === 'Video') {
3663
let localStream = await navigator.mediaDevices.getUserMedia({
@@ -204,6 +231,8 @@ const webrtcPeerController = {
204231
event.candidate &&
205232
peerConnection.localDescription!.type === 'offer'
206233
) {
234+
// ? more websocket hints below (-Isaac)
235+
// ? // socket.emit('offer', JSON.stringify(peerConnection.localDescription));
207236
// checks for canidate and if event type is offer
208237
appDispatch(
209238
newRequestWebRTCOfferSet(

0 commit comments

Comments
 (0)