ffmpeg implemented

This commit is contained in:
2026-01-11 13:40:01 +01:00
parent 34c3f0dc89
commit c4020615d2
18 changed files with 474 additions and 16 deletions

View File

@@ -64,6 +64,17 @@ async fn player_set_volume(
#[tauri::command]
async fn player_play(player: State<'_, PlayerRuntime>, url: String) -> Result<(), String> {
// Fail fast if audio output or ffmpeg is not available.
// This keeps UX predictable: JS can show an error without flipping to "playing".
if let Err(e) = player::preflight_check() {
{
let mut s = player.shared.state.lock().unwrap();
s.status = player::PlayerStatus::Error;
s.error = Some(e.clone());
}
return Err(e);
}
{
let mut s = player.shared.state.lock().unwrap();
s.error = None;