Added getCapabilities() to RtcRtpReceiver (#3941)

This commit is contained in:
Erik Moqvist
2024-05-14 12:01:08 +02:00
committed by GitHub
parent 7ad4c3f931
commit fa6d2bc726
3 changed files with 12 additions and 0 deletions

View File

@@ -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.

View File

@@ -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 = ""]

View File

@@ -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();