Skip to content

Commit

Permalink
update things
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Oct 14, 2024
1 parent f9288e2 commit b3f746c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/SimliClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class SimliClient extends EventEmitter {
const config: RTCConfiguration = {
iceServers: [{ urls: ['stun:stun.l.google.com:19302'] }],
}
console.log('Server running: ', config.iceServers)
// console.log('Server running: ', config.iceServers)

this.pc = new window.RTCPeerConnection(config)

Expand All @@ -69,7 +69,7 @@ export class SimliClient extends EventEmitter {
})

this.pc.addEventListener('track', (evt) => {
console.log('Track event: ', evt.track.kind)
// console.log('Track event: ', evt.track.kind)
if (evt.track.kind === 'video' && this.videoRef?.current) {
this.videoRef.current.srcObject = evt.streams[0]
} else if (evt.track.kind === 'audio' && this.audioRef?.current) {
Expand Down Expand Up @@ -118,7 +118,7 @@ export class SimliClient extends EventEmitter {
})

this.dc.addEventListener('message', (evt) => {
console.log('Received message: ', evt.data)
// console.log('Received message: ', evt.data)

if (evt.data.includes('START')) {
this.emit('started')
Expand All @@ -145,10 +145,8 @@ export class SimliClient extends EventEmitter {
}

private sendPingMessage() {
console.log('Sending ping message')
if (this.dc && this.dc.readyState === 'open') {
const message = 'ping ' + Date.now()
console.log('Sending: ' + message)
try {
this.dc.send(message)
} catch (error) {
Expand Down Expand Up @@ -239,7 +237,7 @@ export class SimliClient extends EventEmitter {
this.pc?.iceGatheringState === 'complete' ||
this.candidateCount === this.prevCandidateCount
) {
console.log(this.pc?.iceGatheringState, this.candidateCount)
// console.log(this.pc?.iceGatheringState, this.candidateCount)
resolve()
} else {
this.prevCandidateCount = this.candidateCount
Expand Down
1 change: 1 addition & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const App = () => {
cancelTokenRef.current = axios.CancelToken.source()

try {
console.log('sending input to chatgpt')
const chatGPTResponse = await axios.post(
completionEndpoint + '/ruby/message',
{
Expand Down

0 comments on commit b3f746c

Please sign in to comment.