diff options
Diffstat (limited to 'src/views/watch.ecr')
| -rw-r--r-- | src/views/watch.ecr | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/views/watch.ecr b/src/views/watch.ecr index 30aa9a61..12799fb6 100644 --- a/src/views/watch.ecr +++ b/src/views/watch.ecr @@ -1,10 +1,23 @@ <title><%= video_info["title"] %> - Invidious</title> <video style="width: 100%" poster="<%= video_info.has_key?("iurlhq720") ? video_info["iurlhq720"] : video_info["iurlmq"] %>" controls> - <% fmt_stream.each do |fmt| %> - <source src="<%= fmt["url"] %>" type="<%= fmt["type"].split(";")[0] %>"> + <% if listen %> + <% 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] %>"> <% end %> + <% end %> </video> - <h1><%= video_info["title"] %></h1> + <h1><%= video_info["title"] %> <a href="/watch?<%= env.request.query %>"> + <i class="fa <%= listen ? "fa-video-camera" : "fa-volume-up" %>" aria-hidden="true"></i> + </a> + </h1> <div class="pure-g"> <div class="pure-u-1 pure-u-md-1-5"> <p><i class="fa fa-eye" aria-hidden="true"></i> <%= video_record.views %></p> |
