When i'm trying to capture the webcam image via ImageCapture, the grab_frame method is missing and also the take_photo method seems to be a void.
I wonder if this is a case where our WebIDL we're using is out of date? The source for these APIs doesn't list grab_frame and has a different signature of take_photo than what's documented on MDN. Would you be interested in looking to see if there's an updated version of the WebIDL we can use?
Yes i would love to. But to be very honest am completely new to the term WebIDL. So where should i start?
@fitzgen where was it again you pulled all the original WebIDL from?
Seems like they have the old one too.
@mahadeer13 maybe you could check other browsers? Is this feature implemented in Firefox?
@alexcrichton My bad. These are an experimantal features only works in chrome for now.
No worries!
In that case for now I'm going to close this since we're only adding standardized APIs to js-sys/web-sys for now.
Note though that you can always bind the API locally in your crate without the assistance of web-sys, it'd look like:
#[wasm_bindgen]
extern "C" {
type ImageCapture;
#[wasm_bindgen(method, js_name = grabFrame)]
fn grab_frame(this: &ImageCapture);
}
(etc)
Yes thanks for the suggestion, but i'm trying to create some benchmark on drivers using WebSys and Native JavaScript. So i prefer the Rusty way, with just two lines of JS Code.
Or maybe from what you say, every web_sys is going to call the native javascript method again?
@mahadeer13 Yes, the APIs only exist in JS (not wasm), so every time you call a web_sys (or js_sys or wasm_bindgen) API it will make a call into JS.
@Pauan Thanks.