mirror of
https://github.com/redlib-org/redlib.git
synced 2025-06-07 15:17:47 +00:00
HLS video playback (#182)
* HLS video playback Signed-off-by: Adrian Lebioda <adrianlebioda@gmail.com> * Add LibreJS compliance * Locally host hls.js * Notification about HLS under videos that support it Signed-off-by: Adrian Lebioda <adrianlebioda@gmail.com> * Use .contains() instead of .find() == None * Make list of preferences constant * Change headers_keys from Vector into Array * Fix incorrect detecting of # in paths * Remove trailing-slash-appending if statement * Change HLS notification styling Co-authored-by: spikecodes <19519553+spikecodes@users.noreply.github.com>
This commit is contained in:
parent
dc9fbc1a05
commit
928907086c
15 changed files with 265 additions and 28 deletions
|
@ -16,6 +16,7 @@ struct SubredditTemplate {
|
|||
sort: (String, String),
|
||||
ends: (String, String),
|
||||
prefs: Preferences,
|
||||
url: String,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
|
@ -79,12 +80,15 @@ pub async fn community(req: Request<Body>) -> Result<Response<Body>, String> {
|
|||
Subreddit::default()
|
||||
};
|
||||
|
||||
let url = String::from(req.uri().path_and_query().map_or("", |val| val.as_str()));
|
||||
|
||||
template(SubredditTemplate {
|
||||
sub,
|
||||
posts,
|
||||
sort: (sort, param(&path, "t")),
|
||||
ends: (param(&path, "after"), after),
|
||||
prefs: Preferences::new(req),
|
||||
url,
|
||||
})
|
||||
}
|
||||
Err(msg) => match msg.as_str() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue