snake case fix (#221)

This commit is contained in:
Kurt Hutten
2023-08-03 05:51:52 +10:00
committed by GitHub
parent 8be7805ac2
commit 1962af760c

View File

@ -103,7 +103,7 @@ export class EngineCommandManager {
console.warn('something went wrong: ', event.data) console.warn('something went wrong: ', event.data)
} else { } else {
const message = JSON.parse(event.data) const message = JSON.parse(event.data)
if (message.type === 's_d_p_answer') { if (message.type === 'sdp_answer') {
this.pc?.setRemoteDescription( this.pc?.setRemoteDescription(
new RTCSessionDescription(message.answer) new RTCSessionDescription(message.answer)
) )
@ -124,10 +124,10 @@ export class EngineCommandManager {
this.pc.addEventListener('icecandidate', (event) => { this.pc.addEventListener('icecandidate', (event) => {
if (!this.pc || !this.socket) return if (!this.pc || !this.socket) return
if (event.candidate === null) { if (event.candidate === null) {
console.log('sent s_d_p_offer') console.log('sent sdp_offer')
this.socket.send( this.socket.send(
JSON.stringify({ JSON.stringify({
type: 's_d_p_offer', type: 'sdp_offer',
offer: this.pc.localDescription, offer: this.pc.localDescription,
}) })
) )
@ -142,9 +142,9 @@ export class EngineCommandManager {
.createOffer() .createOffer()
.then(async (descriptionInit) => { .then(async (descriptionInit) => {
await this?.pc?.setLocalDescription(descriptionInit) await this?.pc?.setLocalDescription(descriptionInit)
console.log('sent s_d_p_offer begin') console.log('sent sdp_offer begin')
const msg = JSON.stringify({ const msg = JSON.stringify({
type: 's_d_p_offer', type: 'sdp_offer',
offer: this.pc?.localDescription, offer: this.pc?.localDescription,
}) })
this.socket?.send(msg) this.socket?.send(msg)