Skip to content
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

Add RTCRtpTransceiver.setCodecPreferences() #3828

Merged
merged 10 commits into from
Feb 6, 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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@

### Added

* Added bindings for the `RTCRtpTransceiver.setCodecPreferences()` and unstable bindings for the `RTCRtpEncodingParameters.scalabilityMode`.
[#3828](https://github.com/rustwasm/wasm-bindgen/pull/3828)

* Add unstable bindings for the FileSystemAccess API
[#3810](https://github.com/rustwasm/wasm-bindgen/pull/3810)

* Added support for running tests in shared and service workers with ``wasm_bindgen_test_configure!` `run_in_shared_worker` and `run_in_service_worker`.
* Added support for running tests in shared and service workers with `wasm_bindgen_test_configure!` `run_in_shared_worker` and `run_in_service_worker`.
[#3804](https://github.com/rustwasm/wasm-bindgen/pull/3804)

* Accept the `--skip` flag with `wasm-bindgen-test-runner`.
Expand Down
21 changes: 21 additions & 0 deletions crates/web-sys/src/features/gen_RtcRtpEncodingParameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,27 @@ impl RtcRtpEncodingParameters {
let _ = r;
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `scalabilityMode` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn scalability_mode(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("scalabilityMode"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `scaleResolutionDownBy` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
Expand Down
7 changes: 7 additions & 0 deletions crates/web-sys/src/features/gen_RtcRtpTransceiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ extern "C" {
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiver`*"]
pub fn get_remote_track_id(this: &RtcRtpTransceiver) -> String;
# [wasm_bindgen (method , structural , js_class = "RTCRtpTransceiver" , js_name = setCodecPreferences)]
#[doc = "The `setCodecPreferences()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpTransceiver/setCodecPreferences)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiver`*"]
pub fn set_codec_preferences(this: &RtcRtpTransceiver, codecs: &::wasm_bindgen::JsValue);
# [wasm_bindgen (method , structural , js_class = "RTCRtpTransceiver" , js_name = stop)]
#[doc = "The `stop()` method."]
#[doc = ""]
Expand Down
3 changes: 1 addition & 2 deletions crates/web-sys/webidls/enabled/RTCRtpTransceiver.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ interface RTCRtpTransceiver {
readonly attribute RTCRtpTransceiverDirection? currentDirection;

undefined stop();
// TODO: bug 1396922
// undefined setCodecPreferences(sequence<RTCRtpCodecCapability> codecs);
undefined setCodecPreferences(sequence<RTCRtpCodecCapability> codecs);

[ChromeOnly]
undefined setRemoteTrackId(DOMString trackId);
Expand Down
3 changes: 3 additions & 0 deletions crates/web-sys/webidls/unstable/RTCRtpSender.webidl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
partial dictionary RTCRtpEncodingParameters {
DOMString scalabilityMode;
};
Loading