mirror of
https://github.com/redlib-org/redlib.git
synced 2025-06-08 07:37:45 +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 UserTemplate {
|
|||
sort: (String, String),
|
||||
ends: (String, String),
|
||||
prefs: Preferences,
|
||||
url: String,
|
||||
}
|
||||
|
||||
// FUNCTIONS
|
||||
|
@ -33,6 +34,7 @@ pub async fn profile(req: Request<Body>) -> Result<Response<Body>, String> {
|
|||
|
||||
// Request user posts/comments from Reddit
|
||||
let posts = Post::fetch(&path, "Comment".to_string()).await;
|
||||
let url = String::from(req.uri().path_and_query().map_or("", |val| val.as_str()));
|
||||
|
||||
match posts {
|
||||
Ok((posts, after)) => {
|
||||
|
@ -45,6 +47,7 @@ pub async fn profile(req: Request<Body>) -> Result<Response<Body>, String> {
|
|||
sort: (sort, param(&path, "t")),
|
||||
ends: (param(&path, "after"), after),
|
||||
prefs: Preferences::new(req),
|
||||
url,
|
||||
})
|
||||
}
|
||||
// If there is an error show error page
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue