Skip to content

Commit

Permalink
Added getCapabilities() to RtcRtpReceiver (#3941)
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-moqvist committed May 14, 2024
1 parent 7ad4c3f commit fa6d2bc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
* Added bindings for `InputDeviceInfo` and `MediaTrackCapabilities`.
[#3935](https://github.com/rustwasm/wasm-bindgen/pull/3935)

* Add bindings for `RTCRtpReceiver.getCapabilities(DOMString)` method.
[#3941](https://github.com/rustwasm/wasm-bindgen/pull/3941)

### Changed

* Stabilize Web Share API.
Expand Down
8 changes: 8 additions & 0 deletions crates/web-sys/src/features/gen_RtcRtpReceiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ extern "C" {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `RtcRtpReceiver`*"]
pub fn track(this: &RtcRtpReceiver) -> MediaStreamTrack;
#[cfg(feature = "RtcRtpCapabilities")]
# [wasm_bindgen (static_method_of = RtcRtpReceiver , js_class = "RTCRtpReceiver" , js_name = getCapabilities)]
#[doc = "The `getCapabilities()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/getCapabilities)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`, `RtcRtpReceiver`*"]
pub fn get_capabilities(kind: &str) -> Option<RtcRtpCapabilities>;
# [wasm_bindgen (method , structural , js_class = "RTCRtpReceiver" , js_name = getContributingSources)]
#[doc = "The `getContributingSources()` method."]
#[doc = ""]
Expand Down
1 change: 1 addition & 0 deletions crates/web-sys/webidls/enabled/RTCRtpReceiver.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
JSImplementation="@mozilla.org/dom/rtpreceiver;1"]
interface RTCRtpReceiver {
readonly attribute MediaStreamTrack track;
static RTCRtpCapabilities? getCapabilities(DOMString kind);
Promise<RTCStatsReport> getStats();
[Pref="media.peerconnection.rtpsourcesapi.enabled"]
sequence<RTCRtpContributingSource> getContributingSources();
Expand Down

0 comments on commit fa6d2bc

Please sign in to comment.