`OnClosing` is only implemented in WASM at this time.
`OnError` isn't tested, but should work as follows the existing
code.
Relates to #479
Relates to #519
In Go 1.22 and earlier, a ticker needs to be explicitly stopped
when it's no longer useful in order to avoid a resource leak.
In Go 1.23 and later, an orphaned ticker will eventually be
garbage collected, but it's still more thrifty to stop it early.
copySessionDescription adds a button to all examples that copies the
local Session Description. This makes it easier for users to copy the
values.
Resolves#2092
Add OnICECandidate and OnICEGatheringStateChange methods to
PeerConnection. The main goal of this change is to improve API
compatibility with the JavaScript/Wasm bindings. It does not actually
add trickle ICE support or change the ICE candidate gathering process,
which is still synchronous in the Go implementation. Rather, it fires
the appropriate events similar to they way they would be fired in a true
trickle ICE process.
Remove unused OnNegotiationNeeded event handler. This handler is not
required for most applications and would be difficult to implement in
Go. This commit removes the handler from the JavaScript/Wasm bindings,
which leads to a more similar API for Go and JavaScript/Wasm.
Add OnICEGatheringStateChange to the JavaScript/Wasm bindings. Also
changes the Go implementation so that the function signatures match.
Fixes#515
This includes a few small and closely related changes:
1. All occurrences of the build tag `+build js` have been changed to the
more precise `+build js,wasm`. This will exclude the files from being
included by third-party compilers like GopherJS, with which they are
incompatible.
2. Some files which are incompatible with JavaScript/Wasm now have the
correct build tag (`+build -js`) so they will be excluded from Wasm
builds.
3. Some configuration options which are incompatible with
JavaScript/Wasm (or at least the current bindings) will now no longer
appear in Wasm builds. This meant creating new files with new struct
definitions and the appropriate build tags.
Resolves#478. Adds minimal JavaScript/WASM bindings. This makes it
possible to compile core parts of pions/webrtc to WASM and run it in the
browser. Only data channels are supported for now and there is
limited/no support for certificates and credentials.
Let's pull off the bandaid!
* Reduces studdering: webrtc.RTCTrack -> webrtc.Track
* Makes it easier to find types by editor autocomplete
* Makes code read more fluently (less repetition)
Since we're breaking the API in 2.0, our only chance to
do this is now.
Relates to #408
This deviates from the WebRTC spec, so we need to fix it. This is a
massively breaking change, so we need to figure out the best way to help
users with this.
I also renamed our RTCPeerConnection constructor. The hope is that
people will refer to the examples/backlog and see what changed.
Resolves#309
Methods that were marked as deprecated weren't properly handled. There
was a mix of old+new ones supported which caused broken behavior.
SDP creation didn't add SCTP to Offer
Resolves#156