summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-02-11 17:01:32 -0600
committerOmar Roth <omarroth@hotmail.com>2018-02-11 17:01:32 -0600
commit6adbcd050c1932963973fda077d4332cea84f049 (patch)
tree5cabc68378054c038520ad0328ae2c350aebe332 /src
parentda97dfad8e3195bf8c50672669ed61b4dc353a44 (diff)
downloadinvidious-6adbcd050c1932963973fda077d4332cea84f049.tar.gz
invidious-6adbcd050c1932963973fda077d4332cea84f049.tar.bz2
invidious-6adbcd050c1932963973fda077d4332cea84f049.zip
Clarify listen param and update icon
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr6
-rw-r--r--src/views/watch.ecr6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 417472a1..b54630fd 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -147,9 +147,13 @@ end
get "/watch" do |env|
id = env.params.query["v"]
- listen = env.params.query["listen"]? || "false"
+ if env.params.query["listen"]? && env.params.query["listen"] == "true"
+ listen = true
env.params.query.delete_all("listen")
+ else
+ listen = false
+ end
client = get_client(pool)
begin
diff --git a/src/views/watch.ecr b/src/views/watch.ecr
index f727c4a9..bdbf4b92 100644
--- a/src/views/watch.ecr
+++ b/src/views/watch.ecr
@@ -5,7 +5,7 @@
<title><%= video.title %> - Invidious</title>
<% end %>
-<% if listen == "true" %>
+<% if listen %>
<audio id="player" class="video-js" data-setup="{}" style="width:100%;" controls>
<% adaptive_fmts.each do |fmt| %>
<% url = fmt["url"]? %>
@@ -76,9 +76,9 @@ var player = videojs('player', options, function() {
<h1>
<%= video.info["title"] %>
- <% if listen == "true" %>
+ <% if listen %>
<a class="link" href="/watch?<%= env.params.query %>">
- <i class="fa fa-video-camera" aria-hidden="true"></i>
+ <i class="fa fa-video" aria-hidden="true"></i>
</a>
<% else %>
<a class="link" href="/watch?<%= env.params.query %>&listen=true">