Skip to content

Commit fa6d2bc

Browse files
authored
Added getCapabilities() to RtcRtpReceiver (#3941)
1 parent 7ad4c3f commit fa6d2bc

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
* Added bindings for `InputDeviceInfo` and `MediaTrackCapabilities`.
2121
[#3935](https://github.com/rustwasm/wasm-bindgen/pull/3935)
2222

23+
* Add bindings for `RTCRtpReceiver.getCapabilities(DOMString)` method.
24+
[#3941](https://github.com/rustwasm/wasm-bindgen/pull/3941)
25+
2326
### Changed
2427

2528
* Stabilize Web Share API.

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

+8
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

+1
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)