This commit is contained in:
yumoqing 2024-09-03 18:09:40 +08:00
parent c455615478
commit c56e103044

View File

@ -68,6 +68,13 @@ class RTCLLM:
"type":"candidate",
"candidate":candidate,
}))
async def send_candidate(self, to, candidate):
print(f'send_candidate():{candidate=}')
await self.ws_send(json.dumps({
'type':'candidate',
'to':to,
'candidate':candidate
}))
async def save_onlineList(self, data):
print(f'{self}, {type(self)}')
@ -162,6 +169,10 @@ class RTCLLM:
'answer':{'type':pc.localDescription.type, 'sdp':pc.localDescription.sdp},
'to':data['from']
}))
cands = await pc.gather__candidates()
for c in cands:
await self.send_candidate(data['from'], c)
"""
offer = await pc.createOffer()
await pc.setLocalDescription(offer)