diff options
author | metamuffin <metamuffin@disroot.org> | 2023-01-25 07:42:27 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-01-25 07:42:27 +0100 |
commit | 814896238c9b3928709f27606816ab6de60abdf3 (patch) | |
tree | 8134ed5213cf41f907f2af68ad9c8df245a937bd /server | |
parent | 4529d07cc3f2f86a9dbb0d4802875a81d5c4c495 (diff) | |
download | jellything-814896238c9b3928709f27606816ab6de60abdf3.tar jellything-814896238c9b3928709f27606816ab6de60abdf3.tar.bz2 jellything-814896238c9b3928709f27606816ab6de60abdf3.tar.zst |
generate seek index
Diffstat (limited to 'server')
-rw-r--r-- | server/src/routes/stream.rs | 7 | ||||
-rw-r--r-- | server/src/routes/ui/player.rs | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/server/src/routes/stream.rs b/server/src/routes/stream.rs index 1b2c741..4fbc990 100644 --- a/server/src/routes/stream.rs +++ b/server/src/routes/stream.rs @@ -15,15 +15,16 @@ use std::path::PathBuf; use tokio::io::{duplex, DuplexStream}; use tokio_util::io::SyncIoBridge; -pub fn stream_uri(path: &PathBuf, tracks: &Vec<u64>) -> String { +pub fn stream_uri(path: &PathBuf, tracks: &Vec<u64>, webm: bool) -> String { format!( - "/stream/{}?tracks={}", + "/stream/{}?tracks={}&webm={}", path.to_str().unwrap().to_string(), tracks .iter() .map(|v| format!("{v}")) .collect::<Vec<_>>() - .join(",") + .join(","), + if webm { "1" } else { "0" } ) } diff --git a/server/src/routes/ui/player.rs b/server/src/routes/ui/player.rs index 4b66f04..ed7e4f7 100644 --- a/server/src/routes/ui/player.rs +++ b/server/src/routes/ui/player.rs @@ -49,7 +49,7 @@ pub fn r_player( Ok(LayoutPage { title: item.info.title.to_owned(), content: markup::new! { - video[src=stream_uri(&item.lib_path, &tracks), controls]; + video[src=stream_uri(&item.lib_path, &tracks, true), controls]; }, }) } |