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:
Adrian Lebioda 2021-05-10 01:25:52 +00:00 committed by GitHub
parent dc9fbc1a05
commit 928907086c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 265 additions and 28 deletions

View file

@ -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() {