From 3d252a2604f78e57fc521df6ae36ffdc3286fb48 Mon Sep 17 00:00:00 2001 From: Philipp Hofer Date: Tue, 12 Aug 2025 20:11:57 +0200 Subject: [PATCH] remove fancy player --- Cargo.lock | 44 ------------------------ Cargo.toml | 2 -- src/lib.rs | 3 +- src/main.rs | 96 ++--------------------------------------------------- 4 files changed, 4 insertions(+), 141 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a470ce2..5da2321 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -689,30 +689,6 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" -[[package]] -name = "maud" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8156733e27020ea5c684db5beac5d1d611e1272ab17901a49466294b84fc217e" -dependencies = [ - "axum-core", - "http", - "itoa", - "maud_macros", -] - -[[package]] -name = "maud_macros" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7261b00f3952f617899bc012e3dbd56e4f0110a038175929fa5d18e5a19913ca" -dependencies = [ - "proc-macro2", - "proc-macro2-diagnostics", - "quote", - "syn", -] - [[package]] name = "mediatype" version = "0.20.0" @@ -824,13 +800,11 @@ dependencies = [ "axum", "bytes", "chrono", - "maud", "reqwest", "serde_json", "stream-download", "tokio", "tokio-stream", - "tracing", ] [[package]] @@ -860,18 +834,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "proc-macro2-diagnostics" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "version_check", -] - [[package]] name = "quinn" version = "0.11.8" @@ -1519,12 +1481,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - [[package]] name = "want" version = "0.3.1" diff --git a/Cargo.toml b/Cargo.toml index 1eb7470..dbbb05d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,5 @@ reqwest = { version = "0.12", features = ["stream", "json", "rustls-tls"], defau bytes = "1" async-stream = "0.3" serde_json = "1" -tracing = "0.1" stream-download = "0.22" chrono = "0.4" -maud = { version = "0.27", features = ["axum"] } diff --git a/src/lib.rs b/src/lib.rs index 7a7bcc8..e1e629c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,7 +16,8 @@ async fn get_newest_morning_journal() -> Result Markup { - html! { - (DOCTYPE) - html lang="en" { - head { - meta charset="utf-8"; - meta name="viewport" content="user-scalable=no"; - title { "Ö1 Morgenjournal" } - link rel="stylesheet" href="/styles.css"; - } - body { - // Top Info - div #title { - span #track {} - div #timer { "0:00" } - div #duration { "0:00" } - } - - // Controls - div .controlsOuter { - div .controlsInner { - div #loading {} - div .btn #playBtn {} - div .btn #pauseBtn {} - div .btn #prevBtn {} - div .btn #nextBtn {} - } - div .btn #playlistBtn {} - div .btn #volumeBtn {} - } - - // Progress - div #waveform {} - div #bar {} - div #progress {} - - // Playlist - div #playlist { - div #list {} - } - - // Volume - div #volume .fadeout { - div #barFull .bar {} - div #barEmpty .bar {} - div #sliderBtn {} - } - - // Scripts - script src="/howler.core.min.js" {} - script src="/siriwave.js" {} - script src="/player.js" {} - } - } - } -} - -async fn styles() -> impl IntoResponse { - ( - [(header::CONTENT_TYPE, "text/css")], - include_str!("../static/styles.css"), - ) -} - -async fn howler() -> impl IntoResponse { - ( - [(header::CONTENT_TYPE, "text/javascript")], - include_str!("../static/howler.core.min.js").to_string(), - ) -} - -async fn player() -> impl IntoResponse { - ( - [(header::CONTENT_TYPE, "text/javascript")], - include_str!("../static/player.js").to_string(), - ) -} - -async fn siriwave() -> impl IntoResponse { - ( - [(header::CONTENT_TYPE, "text/javascript")], - include_str!("../static/siriwave.js").to_string(), - ) -} - #[tokio::main] async fn main() -> Result<(), Box> { let state = Arc::new(AppState::new()); let app = Router::new() - .route("/", get(index)) - .route("/stream", get(streamer::stream_handler)) - .route("/howler.core.min.js", get(howler)) - .route("/styles.css", get(styles)) - .route("/player.js", get(player)) - .route("/siriwave.js", get(siriwave)) + .route("/", get(streamer::stream_handler)) .with_state(state); println!("Streaming server running on http://localhost:3029");