diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious.cr | 3 | ||||
| -rw-r--r-- | src/views/watch.ecr | 26 |
2 files changed, 15 insertions, 14 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 24bcbdf6..59873958 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -2,8 +2,8 @@ require "http/client" require "json" require "kemal" require "pg" -require "xml" require "time" +require "xml" PG_DB = DB.open "postgres://kemal:kemal@localhost:5432/invidious" CONTEXT = OpenSSL::SSL::Context::Client.insecure @@ -124,7 +124,6 @@ end get "/watch" do |env| id = env.params.query["v"] listen = env.params.query["listen"]? || "false" - speed = env.params.query["speed"]? && env.params.query["speed"].to_f? ? env.params.query["speed"].to_f : 1 env.params.query.delete_all("listen") diff --git a/src/views/watch.ecr b/src/views/watch.ecr index 8a16dbca..0a5824e9 100644 --- a/src/views/watch.ecr +++ b/src/views/watch.ecr @@ -2,21 +2,23 @@ <%= video.info["title"] + " - " %> <% end %> -<video id="player" class="video-js" data-setup="{}" style="width:100%" controls> - <% if listen == "true" %> - <% adaptive_fmts.each do |fmt| %> - <% url = fmt["url"] %> - <% type = fmt["type"].to_s.split(";")[0] %> - <% if type.starts_with?("audio") %> - <source src="<%= url %>" type="<%= type %>"> - <% end %> - <% end %> - <% else %> - <% fmt_stream.each do |fmt| %> - <source src="<%= fmt["url"] %>" type="<%= fmt["type"].split(";")[0] %>"> +<% if listen == "true" %> +<audio id="player" class="video-js" data-setup="{}" style="width:100%" controls> + <% adaptive_fmts.each do |fmt| %> + <% url = fmt["url"] %> + <% type = fmt["type"].to_s.split(";")[0] %> + <% if type.starts_with?("audio") %> + <source src="<%= url %>" type="<%= type %>"> <% end %> <% end %> +</audio> +<% else %> +<video id="player" class="video-js" data-setup="{}" style="width:100%" controls> + <% fmt_stream.each do |fmt| %> + <source src="<%= fmt["url"] %>" type="<%= fmt["type"].split(";")[0] %>"> + <% end %> </video> +<% end %> <script> var options = { |
