martpie / museeks

🎵 A simple, clean and cross-platform music player
https://museeks.io
MIT License
1.71k stars 200 forks source link

Tauri #753

Closed martpie closed 5 months ago

martpie commented 8 months ago
yarn
cargo test --manifest-path src-tauri/Cargo.toml
yarn tauri dev

Let me keep track of what's working and what's yet to be fixed using the tauri branch. Non-exhaustive. Hard bockers are marked with 🚫.

Screenshots

Screenshot 2024-03-05 223247

Screenshot 2024-03-12 at 16 31 17

Serial-ATA commented 8 months ago

Hey @uklotzde & @martpie , I fixed that bug in WebKit and enabled MediaSession by default. The player should work fine on Linux now whenever my commits make it into a release (I'm still not entirely sure about how their release schedule works).

uklotzde commented 7 months ago

Generating TypeScript bindings is a burden.

Those definitions are probably better defined once as part of the application API in museeks. Every integration then needs to implement the bridging code manually instead of bringing their own definitions.

martpie commented 7 months ago

Generating TypeScript bindings is a burden.

I would argue this is a setup issue and not a philosophical issue.

Types generated from the backend is a very very useful feature, I just need to automate it, without slowing the devX too much.

Edit: Typically, by running cargo test in the beforeDevCommand. But that would run cargo twice (test + build), but maybe things are cached.

uklotzde commented 7 months ago

Edit: Typically, by running cargo test in the beforeDevCommand. But that would run cargo twice (test + build), but maybe things are cached.

Only a single TypeScript API is needed and those definitions should be driven by the requirements and use cases of the app and rendering. If you want pluggable backends then backends need to adapt these definitions instead of bringing their own.

I already have JSON representations and JSON schema mapping and started to utilize ts-rs. But this turns out as complicated and wouldn't really help if you need a second layer of type adapters for app integration anyway. Mapping the idiomatic, native Rust types directly instead of opinionated, JSON-serializable types makes more sense here.

martpie commented 7 months ago

I think I don't fully understand what you mean.

Can you detail how using JSON schemas would be an improvement and how the dev workflow would look like?

Serial-ATA commented 7 months ago

🚫 Audio output selection

What of macOS? seems impossible bugs.webkit.org/show_bug.cgi?id=216641

Just letting you know, it doesn't seem to work on any platform, not just macOS. WebKit just returns a list of inputs.

martpie commented 7 months ago

Yep, that is what I figured out too :( testing on Windows only produces a list of audio/video inputs when request permission with getUserMedia(), audio outputs seem to just not be working.

To be completely frank, I think I will just remove the feature, people should probably rely on system settings to route their app to specific audio outputs (example for windows, for macOS and linux, good luck).

https://github.com/martpie/museeks/issues/449 was the original feature request.

I should also check how other players deal with it (app setting vs system setting)

martpie commented 7 months ago

Actually nevermind, this seems to be working on Windows after calling

await navigator.mediaDevices.getUserMedia({
  audio: true,
});

setSinkId works too.

It does require giving access to the microphone though, which is privacy-sensitive and users make be scared of seeing this popup. Also, the permission seems to be requested every time the app is open. https://github.com/tauri-apps/tauri/issues/8979

image

image

Serial-ATA commented 7 months ago

I should also check how other players deal with it (app setting vs system setting)

Being able to choose an output is a pretty common feature, but they'll use the system default initially, of course.

people should probably rely on system settings to route their app to specific audio outputs

Yeah, it's trivial anyway to use something like pavucontrol (on Linux) to choose outputs.

Serial-ATA commented 7 months ago

I can look into getting the outputs to show up on Linux at least. Just looks like a case similar to the MediaSession bug where they lost interest and left the issue sitting there.

martpie commented 7 months ago

damn, stop being awesome mate

uklotzde commented 7 months ago

Config broken after updates?

yarn run v1.22.21
$ tauri dev
       Error `tauri.conf.json` error on `build`: Additional properties are not allowed ('devUrl', 'frontendDist' were unexpected)
       Error `tauri.conf.json` error: Additional properties are not allowed ('app', 'bundle', 'identifier', 'productName', 'version' were unexpected)
error Command failed with exit code 1.
martpie commented 7 months ago

Did you run yarn before yarn tauri dev?

uklotzde commented 7 months ago

Did you run yarn before yarn tauri dev?

Thanks, that fixed it. Not familiar with Node.js tooling :grimacing:

martpie commented 5 months ago

Let's merge this. It's not ready, but it will show the project is alive :)