summaryrefslogtreecommitdiff
path: root/src/audio/mpv.rs
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2024-05-31 14:59:25 +0200
committerYuval Adam <_@yuv.al>2024-05-31 14:59:25 +0200
commit4a4c5b9174cf0182d4eb755f5d97ca432e5960ca (patch)
treee0d49598fa09ed0ad859b9afb95ea4b88e51d04f /src/audio/mpv.rs
parent10976b7bdfcdb57724d9e2b1dedd2c172b0b5973 (diff)
Add multiple backend support
Diffstat (limited to 'src/audio/mpv.rs')
-rw-r--r--src/audio/mpv.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/audio/mpv.rs b/src/audio/mpv.rs
new file mode 100644
index 0000000..dddb6b2
--- /dev/null
+++ b/src/audio/mpv.rs
@@ -0,0 +1,13 @@
+use super::AudioBackend;
+use std::process::Command;
+
+pub struct Mpv {}
+
+impl AudioBackend for Mpv {
+ fn play(&self, url: &str) {
+ Command::new("mpv")
+ .args([url])
+ .output()
+ .expect("Failed to start mpv, make sure it is installed.");
+ }
+}