question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Promise syntax for RTCPeerConnection#createOffer

See original GitHub issue

Hi there,

I’ve been experimenting with Safari Technology Preview R34 and I’m getting an error:

Unhandled Promise Rejection: TypeError: Argument 1 ('options') to RTCPeerConnection.createOffer must be a dictionary

Looks like the currently used pc.createOffer(successCallback, failureCallback, [options]) is deprecated, and the pc.createOffer([options]) should be used instead:

In older code and documentation, you may see a callback-based version of this function. This has been deprecated and its use is strongly discouraged. You should update any existing code to use the Promise-based version of createOffer() instead.

What are the plans for supporting this new syntax? I could make a new pull request with the fix, but I’m worried it would cause issues with older browsers.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
t-mullencommented, Jul 6, 2017

I suggest waiting for the actual Safari release, as technology previews are extremely likely to change.

Hopefully Safari implements callbacks, else many existing applications are going to break.

0reactions
t-mullencommented, Sep 12, 2018

That’s right.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RTCPeerConnection.createOffer() - Web APIs | MDN
The createOffer() method of the RTCPeerConnection interface ... The return value is a Promise which, when the offer has been created, ...
Read more >
dom RTCPeerConnection.createOffer() - CodeProject Reference
The return value is a Promise which, when the offer has been created, is resolved with a RTCSessionDescription object containing the newly-created offer....
Read more >
RTCPeerConnection.createOffer() - Web APIs
The return value is a Promise which, when the offer has been created, is resolved with a RTCSessionDescription object containing the newly-created offer....
Read more >
RTCPeerConnection.createOffer "promise" usage
I am learning WebRTC recently and found a usage of "promise" here (https://github.com/mdn/samples-server/blob/master/s/webrtc-simple- ...
Read more >
How to use createOffer function in RTCPeerConnection
Best JavaScript code snippets using builtins.RTCPeerConnection.createOffer(Showing top 15 results out of 315). Tabnine ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found