- From: Jan-Ivar Bruaroey via GitHub <sysbot+gh@w3.org>
- Date: Wed, 10 May 2023 20:55:53 +0000
- To: public-webrtc-logs@w3.org
A use case for this may be to attempt to reconnect after a temporary network drop when signaling is unavailable (from [this stackoverflow question](https://stackoverflow.com/questions/76210224/can-i-reuse-the-offer-of-webrtc-once-connection-got-disconnected)).
It should be noted this simple [workaround](https://jsfiddle.net/jib1/1foL6p9r/32/) works in Firefox as well:
```js
const offer = await pc1.createOffer();
await pc1.setLocalDescription(offer)
await pc2.setRemoteDescription(offer);
const answer = await pc2.createAnswer();
await pc2.setLocalDescription(answer);
await pc1.setRemoteDescription(answer);
await pc1.setLocalDescription(); // regenerates [[LastCreatedOffer]]
await pc2.setRemoteDescription(offer);
await pc2.setLocalDescription(); // regenerates [[LastCreatedAnswer]]
await pc1.setRemoteDescription(answer);
```
...though if transceivers have been modified then the new offer may not fit the old answer and fail to renegotiate.
--
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2869#issuecomment-1542798801 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 10 May 2023 20:55:55 UTC