Skip to content

Commit 82f5f91

Browse files
committed
Added getCapabilities() to RtcRtpReceiver
1 parent e78db23 commit 82f5f91

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
* Added support for returning `Vec`s from async functions.
1818
[#3630](https://github.com/rustwasm/wasm-bindgen/pull/3630)
1919

20+
* Add bindings for `RTCRtpReceiver.getCapabilities(DOMString)` method.
21+
[#3941](https://github.com/rustwasm/wasm-bindgen/pull/3941)
22+
2023
### Changed
2124

2225
* Stabilize Web Share API.

crates/web-sys/src/features/gen_RtcRtpReceiver.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ extern "C" {
2020
#[doc = ""]
2121
#[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `RtcRtpReceiver`*"]
2222
pub fn track(this: &RtcRtpReceiver) -> MediaStreamTrack;
23+
#[cfg(feature = "RtcRtpCapabilities")]
24+
# [wasm_bindgen (static_method_of = RtcRtpReceiver , js_class = "RTCRtpReceiver" , js_name = getCapabilities)]
25+
#[doc = "The `getCapabilities()` method."]
26+
#[doc = ""]
27+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/getCapabilities)"]
28+
#[doc = ""]
29+
#[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`, `RtcRtpReceiver`*"]
30+
pub fn get_capabilities(kind: &str) -> Option<RtcRtpCapabilities>;
2331
# [wasm_bindgen (method , structural , js_class = "RTCRtpReceiver" , js_name = getContributingSources)]
2432
#[doc = "The `getContributingSources()` method."]
2533
#[doc = ""]

crates/web-sys/webidls/enabled/RTCRtpReceiver.webidl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
JSImplementation="@mozilla.org/dom/rtpreceiver;1"]
1212
interface RTCRtpReceiver {
1313
readonly attribute MediaStreamTrack track;
14+
static RTCRtpCapabilities? getCapabilities(DOMString kind);
1415
Promise<RTCStatsReport> getStats();
1516
[Pref="media.peerconnection.rtpsourcesapi.enabled"]
1617
sequence<RTCRtpContributingSource> getContributingSources();

0 commit comments

Comments
 (0)