mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Use videojs-markers for start end end times
This commit is contained in:
parent
4acc09f30d
commit
e1391f4ac7
4 changed files with 101 additions and 31 deletions
|
@ -287,7 +287,7 @@ get "/watch" do |env|
|
|||
subscriptions ||= [] of String
|
||||
|
||||
autoplay = env.params.query["autoplay"]?.try &.to_i
|
||||
video_loop = env.params.query["video_loop"]?.try &.to_i
|
||||
video_loop = env.params.query["loop"]?.try &.to_i
|
||||
|
||||
if preferences
|
||||
autoplay ||= preferences.autoplay.to_unsafe
|
||||
|
@ -1287,6 +1287,10 @@ get "/embed/:id" do |env|
|
|||
video_loop = env.params.query["loop"]?.try &.to_i
|
||||
video_loop ||= 0
|
||||
|
||||
autoplay = autoplay == 1
|
||||
video_loop = video_loop == 1
|
||||
controls = controls == 1
|
||||
|
||||
begin
|
||||
video = get_video(id, PG_DB)
|
||||
rescue ex
|
||||
|
@ -1294,6 +1298,20 @@ get "/embed/:id" do |env|
|
|||
next templated "error"
|
||||
end
|
||||
|
||||
if video.info["hlsvp"]?
|
||||
hlsvp = video.info["hlsvp"]
|
||||
|
||||
if Kemal.config.ssl || CONFIG.https_only
|
||||
scheme = "https://"
|
||||
else
|
||||
scheme = "http://"
|
||||
end
|
||||
host = env.request.headers["Host"]
|
||||
url = "#{scheme}#{host}"
|
||||
|
||||
hlsvp = hlsvp.gsub("https://manifest.googlevideo.com", url)
|
||||
end
|
||||
|
||||
fmt_stream = [] of HTTP::Params
|
||||
video.info["url_encoded_fmt_stream_map"].split(",") do |string|
|
||||
if !string.empty?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue