Skip to content

Added getCapabilities() to RtcRtpReceiver #3941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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