Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Use new conference API #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function startListening (client, mqttClient, activeRtcStream, agentLabel) {

signalList = []

client.createRtcSignal(handleId, signals, undefined, agentLabel)
client.createTrickleSignal(handleId, signals)
.catch(errorCallback)
}

Expand Down Expand Up @@ -227,21 +227,20 @@ function startListening (client, mqttClient, activeRtcStream, agentLabel) {
// })
// }

client.connectRtc(activeRtcId, agentLabel)
.then((response) => {
handleId = response.handle_id

return peer.createOffer(listenerOptions)
})
peer.createOffer(listenerOptions)
.then(offer => {
const newOffer = transformOffer(offer, { videoCodec })

return client.createRtcSignal(handleId, newOffer, undefined, agentLabel)
.then((response) => ({ response, offer: newOffer }))
return client.createSignal(activeRtcId, newOffer)
.then((response) => {
handleId = response.handle_id
return { response, offer: newOffer }
})
})
.then(({ response, offer }) => {
return peer.setOffer(offer)
.then(() => peer.setAnswer(response.jsep))
.then(() => {
peer.setAnswer(response.jsep)
})
})
.catch(error => console.debug('[startListening] error', error))
}
Expand Down
Loading