Pull 'player' out into seperate component

This commit is contained in:
Omar Roth 2018-08-11 10:52:13 -05:00
parent debe5cbea9
commit ce0e4babad
7 changed files with 207 additions and 338 deletions

View file

@ -200,7 +200,7 @@ get "/watch" do |env|
end
subscriptions ||= [] of String
autoplay, video_loop, video_start, video_end, listen, raw, quality, autoplay = process_video_params(env.params.query, preferences)
autoplay, video_loop, video_start, video_end, listen, raw, quality, controls = process_video_params(env.params.query, preferences)
if listen
env.params.query.delete_all("listen")
end
@ -226,6 +226,7 @@ get "/watch" do |env|
captions = captions - preferred_captions
end
preferred_captions ||= [] of Caption
aspect_ratio = "16:9"
video.description = fill_links(video.description, "https", "www.youtube.com")
video.description = add_alt_links(video.description)
@ -316,7 +317,21 @@ get "/embed/:id" do |env|
next env.redirect url
end
autoplay, video_loop, video_start, video_end, listen, raw, quality, autoplay, controls = process_video_params(env.params.query, nil)
autoplay, video_loop, video_start, video_end, listen, raw, quality, controls = process_video_params(env.params.query, nil)
preferred_captions = [] of Caption
preferences = Preferences.from_json({
"video_loop" => video_loop,
"autoplay" => autoplay,
"speed" => 1.0,
"quality" => quality,
"volume" => 100,
"max_results" => 0,
"sort" => "",
"latest_only" => false,
"unseen_only" => false,
"dark_mode" => false,
}.to_json)
aspect_ratio = nil
begin
video = get_video(id, PG_DB)