summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/listen.ecr21
-rw-r--r--views/watch.ecr29
2 files changed, 29 insertions, 21 deletions
diff --git a/views/listen.ecr b/views/listen.ecr
index 13f03805..c8040f14 100644
--- a/views/listen.ecr
+++ b/views/listen.ecr
@@ -1,16 +1,19 @@
-<h1><%= URI.unescape(video_info["title"].to_s,true) %></h1>
-<video style="width: 100%" poster="<%= video_info["iurlmq"] %>" controls>
-<% adaptive_fmt.each do |fmt| %>
- <% fmt_type = fmt["type"].to_s.split(";")[0] %>
- <% if fmt_type.starts_with?("audio") %>
- <source src="<%= fmt["url"] %>" type="<%= fmt_type %>">
+<% title = URI.unescape(video_info["title"].as(String), true) %>
+<h1><%= title %></h1>
+<video style="width: 100%" poster="<%= video_info["iurlhq720"] %>" controls>
+<% video_info["adaptive_fmts"].as(Hash).each do |key, value| %>
+ <% url = value["url"] %>
+ <% type = value["type"].to_s.split(";")[0] %>
+ <% if type.starts_with?("audio") %>
+ <source src="<%= url %>" type="<%= type %>">
<% end %>
<% end %>
</video>
-
-
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-5"></div>
<div class="pure-u-1 pure-u-md-3-5"></div>
-<div class="pure-u-1 pure-u-md-1-5"></div>
+<div class="pure-u-1 pure-u-md-1-5">
+ <p>Views : <%= video_info["view_count"] %></p>
+ <p>Rating : <%= video_info["avg_rating"] %></p>
+</div>
</div> \ No newline at end of file
diff --git a/views/watch.ecr b/views/watch.ecr
index e46cf77c..3ad33676 100644
--- a/views/watch.ecr
+++ b/views/watch.ecr
@@ -1,15 +1,20 @@
-<h1><%= URI.unescape(video_info["title"].to_s,true) %></h1>
-<video style="width: 100%" poster="<%= video_info["iurlmq"] %>" controls>
- <% fmt_stream.each do |fmt| %>
- <source src="<%= fmt["url"] %>" type="<%= fmt["type"].to_s.split(";")[0] %>">
- <% end %>
+<% title = URI.unescape(video_info["title"].as(String), true) %>
+<h1><%= title %></h1>
+<video style="width: 100%" poster="<%= video_info["iurl"] %>" controls>
+<% video_info["url_encoded_fmt_stream_map"].as(Hash).each do |key, value| %>
+ <% url = value["url"] %>
+ <% type = value["type"]["0"].to_s.split(";")[0] %>
+ <source src="<%= url %>" type="<%= type %>">
+<% end %>
</video>
<div class="pure-g">
-<div class="pure-u-1 pure-u-md-1-5"></div>
-<div class="pure-u-1 pure-u-md-3-5">
-<% fmt_stream.each do |fmt| %>
-<p><%= fmt["quality"] %></p>
-<% end %>
-</div>
-<div class="pure-u-1 pure-u-md-1-5"></div>
+ <div class="pure-u-1 pure-u-md-1-5">
+ <p>Likes: <%= likes %></p>
+ <p>Dislikes: <%= dislikes %></p>
+ </div>
+ <div class="pure-u-1 pure-u-md-3-5"></div>
+ <div class="pure-u-1 pure-u-md-1-5">
+ <p>Views : <%= video_info["view_count"] %></p>
+ <p>Rating : <%= video_info["avg_rating"] %></p>
+ </div>
</div> \ No newline at end of file