diff --git a/.vscode/settings.json b/.vscode/settings.json index 672e240..de6dcb3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,9 +7,9 @@ "editor.defaultFormatter": "rust-lang.rust-analyzer", "editor.inlayHints.enabled": "on" }, - "rust-analyzer.cargo.cfgs": { - "web_sys_unstable_apis": "" - }, "rust-analyzer.checkOnSave": true, - "rust-analyzer.check.command": "clippy" + "rust-analyzer.check.command": "clippy", + "rust-analyzer.cargo.extraEnv": { + "RUSTFLAGS": "--cfg web_sys_unstable_apis" + } } diff --git a/README.md b/README.md index 89353cb..363e1a2 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ Both server and browser client are written in Rust. +> [!NOTE] +> draft-ietf-moq-transport-06 prototype is [here](https://github.com/nttcom/moq-wasm/tree/draft-06) + ## Implementation Supported version: draft-ietf-moq-transport-06 @@ -38,6 +41,7 @@ Supported version: draft-ietf-moq-transport-06 - [ ] Priorities - [ ] Object Cache + ## Modules ### moqt-core diff --git a/moqt-client-sample/Cargo.toml b/moqt-client-sample/Cargo.toml index 78f4e8b..4952189 100644 --- a/moqt-client-sample/Cargo.toml +++ b/moqt-client-sample/Cargo.toml @@ -37,4 +37,4 @@ features = [ ] [lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(web_sys_unstable_apis)'] } +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(web_sys_unstable_apis)'] } \ No newline at end of file diff --git a/moqt-client-sample/config.toml b/moqt-client-sample/config.toml deleted file mode 100644 index 2296f55..0000000 --- a/moqt-client-sample/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[build] -rustflags = "--cfg web_sys_unstable_apis" diff --git a/moqt-client-sample/src/lib.rs b/moqt-client-sample/src/lib.rs index 7332882..5cf205f 100644 --- a/moqt-client-sample/src/lib.rs +++ b/moqt-client-sample/src/lib.rs @@ -671,22 +671,9 @@ impl MOQTClient { } #[wasm_bindgen(js_name = sendUnsubscribeMessage)] - pub async fn send_unsubscribe_message( - &self, - track_namespace: js_sys::Array, - track_name: String, - ) -> Result { + pub async fn send_unsubscribe_message(&self, subscribe_id: u64) -> Result { if let Some(writer) = &*self.control_stream_writer.borrow() { - let length = track_namespace.length(); - let mut track_namespace_vec: Vec = Vec::with_capacity(length as usize); - for i in 0..length { - let js_element = track_namespace.get(i); - let string_element = js_element - .as_string() - .ok_or_else(|| JsValue::from_str("Array contains a non-string element"))?; - track_namespace_vec.push(string_element); - } - let unsubscribe_message = Unsubscribe::new(track_namespace_vec, track_name); + let unsubscribe_message = Unsubscribe::new(subscribe_id); let mut unsubscribe_message_buf = BytesMut::new(); unsubscribe_message.packetize(&mut unsubscribe_message_buf);