#How to use wgpu in a tauri window?

5 messages · Page 1 of 1 (latest)

fallen fable
#

I'm trying to develop a video player app with tauri. But the video element in html doesn't support enough codecs. I investigated a media framework named gstreamer, and I know how to get video textures now. The only barrier is, how to draw it in a window. I found a wgpu example in the wry repo. https://github.com/tauri-apps/wry/blob/dev/examples/wgpu.rs The code in the example use wgpu to draw a triangle in a winit window. So I wonder if I can do similar thing to draw video textures via wgpu in tauri window. It's ideal if I can draw video textures with wgpu, and render a webview above it to receive user interactions, in the same window. tauri-runtime-wry use WebviewBuilder::new instead of WebviewBuilder::new_as_child which might be a problem for me.
And I found that a wgpu drawable window needs two traits: HasRawWindowHandle and HasRawDisplayHandle. Winit and tao window both implement these except tauri window. If I use app_handle.create_tao_window, then the problem is how to render webview? I try wry::WebviewBuilder but no luck.
Are there any other ways I can try? Thanks for any relies!

GitHub

Cross-platform WebView library in Rust for Tauri. Contribute to tauri-apps/wry development by creating an account on GitHub.

midnight sleet
#

The wry features you talked about are quite new and didn't land in tauri yet

fallen fable
midnight sleet
#

a mix of the first 2

#

it was in development but i think it was paused because we had not enough time to get it into 2.0