Add speed and fix <select> options

This commit is contained in:
Omar Roth 2018-07-16 11:57:52 -05:00
parent 96c520b02b
commit 58b5e97fc4
4 changed files with 20 additions and 4 deletions

View file

@ -700,6 +700,9 @@ post "/preferences" do |env|
autoplay ||= "off"
autoplay = autoplay == "on"
speed = env.params.body["speed"]?.try &.as(String).to_f
speed ||= 1.0
quality = env.params.body["quality"]?.try &.as(String)
quality ||= "hd720"
@ -713,6 +716,7 @@ post "/preferences" do |env|
preferences = {
"video_loop" => video_loop,
"autoplay" => autoplay,
"speed" => speed,
"quality" => quality,
"volume" => volume,
"dark_mode" => dark_mode,