From 93e7d47cd14457385afa931bf97329838fc2d945 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Jun 2025 16:29:04 +0100 Subject: [PATCH] Update index.html with stream links and HLS.js player using mustache templating (#6) * Initial plan for issue * Add mustache templating and update index.html with stream links Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> * Add documentation and update TODO for completed stream index feature Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> * Implement serializable structs and stream caching to address review feedback Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> * Fix stream cache sharing and remove duplicated caching code Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> * Address feedback: remove docs file, revert TODO changes, optimize template compilation Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> --- crates/zap-stream/Cargo.toml | 3 +- crates/zap-stream/index.html | 115 +++++++++++++++++++++++- crates/zap-stream/src/api.rs | 10 +++ crates/zap-stream/src/http.rs | 162 +++++++++++++++++++++++++++++++--- crates/zap-stream/src/main.rs | 9 +- 5 files changed, 281 insertions(+), 18 deletions(-) diff --git a/crates/zap-stream/Cargo.toml b/crates/zap-stream/Cargo.toml index 217995c..e36ba39 100644 --- a/crates/zap-stream/Cargo.toml +++ b/crates/zap-stream/Cargo.toml @@ -42,4 +42,5 @@ sha2.workspace = true pretty_env_logger = "0.5.0" clap = { version = "4.5.16", features = ["derive"] } futures-util = "0.3.31" -matchit = "0.8.4" \ No newline at end of file +matchit = "0.8.4" +mustache = "0.9.0" \ No newline at end of file diff --git a/crates/zap-stream/index.html b/crates/zap-stream/index.html index b952b71..8881675 100644 --- a/crates/zap-stream/index.html +++ b/crates/zap-stream/index.html @@ -9,9 +9,122 @@ color: white; font-family: monospace; } + .container { + padding: 20px; + max-width: 1200px; + margin: 0 auto; + } + .stream-list { + margin: 20px 0; + } + .stream-item { + background: #333; + margin: 10px 0; + padding: 15px; + border-radius: 5px; + } + .stream-title { + font-size: 18px; + font-weight: bold; + margin-bottom: 5px; + } + .stream-link { + color: #00ff00; + text-decoration: none; + } + .stream-link:hover { + text-decoration: underline; + } + .video-player { + margin: 20px 0; + max-width: 800px; + } + video { + width: 100%; + max-width: 800px; + background: #000; + } + .no-streams { + color: #999; + font-style: italic; + } + .player-section { + margin-top: 30px; + border-top: 1px solid #555; + padding-top: 20px; + } +
-