ffmpeg implemented
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user