2018-01-07 23:10:03 +05:30
|
|
|
<% content_for "header" do %>
|
2018-01-07 23:19:48 +05:30
|
|
|
<%= video.info["title"] + " - " %>
|
2018-01-07 23:10:03 +05:30
|
|
|
<% end %>
|
2018-01-15 08:46:09 +05:30
|
|
|
|
2018-01-16 08:00:57 +05:30
|
|
|
<script>
|
|
|
|
function setRate(rate) {
|
|
|
|
var video = document.getElementById("player")
|
|
|
|
video.playbackRate = rate;
|
|
|
|
};
|
|
|
|
function toggle() {
|
|
|
|
var video = document.getElementById("player")
|
|
|
|
if (video.paused == true) {
|
|
|
|
video.play();
|
|
|
|
} else {
|
|
|
|
video.pause();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<video id="player" onclick="toggle()" onplay="setRate(<%= speed %>)" style="width: 100%" poster="<%= player_response["videoDetails"]["thumbnail"]["thumbnails"][-1]["url"] %>" controls>
|
2018-01-15 08:46:09 +05:30
|
|
|
<% if listen == "true" %>
|
2018-01-04 07:36:16 +05:30
|
|
|
<% 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 %>
|
2017-12-31 03:00:21 +05:30
|
|
|
<% end %>
|
2018-01-04 07:36:16 +05:30
|
|
|
<% else %>
|
|
|
|
<% fmt_stream.each do |fmt| %>
|
|
|
|
<source src="<%= fmt["url"] %>" type="<%= fmt["type"].split(";")[0] %>">
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2017-12-31 03:00:21 +05:30
|
|
|
</video>
|
2018-01-16 08:00:57 +05:30
|
|
|
|
2018-01-15 08:46:09 +05:30
|
|
|
<h1>
|
|
|
|
<%= video.info["title"] %>
|
|
|
|
<% if listen == "true" %>
|
2018-01-16 08:00:57 +05:30
|
|
|
<a class="link" href="/watch?<%= env.params.query %>">
|
2018-01-15 08:46:09 +05:30
|
|
|
<i class="fa fa-video-camera" aria-hidden="true"></i>
|
2018-01-04 07:36:16 +05:30
|
|
|
</a>
|
2018-01-15 08:46:09 +05:30
|
|
|
<% else %>
|
2018-01-16 08:00:57 +05:30
|
|
|
<a class="link" href="/watch?<%= env.params.query %>&listen=true">
|
2018-01-15 08:46:09 +05:30
|
|
|
<i class="fa fa-volume-up" aria-hidden="true"></i>
|
|
|
|
</a>
|
|
|
|
<% end %>
|
2018-01-04 07:36:16 +05:30
|
|
|
</h1>
|
2018-01-16 08:00:57 +05:30
|
|
|
|
2017-12-31 03:00:21 +05:30
|
|
|
<div class="pure-g">
|
|
|
|
<div class="pure-u-1 pure-u-md-1-5">
|
2018-01-15 08:46:09 +05:30
|
|
|
<p><i class="fa fa-eye" aria-hidden="true"></i> <%= views %></p>
|
|
|
|
<p><i class="fa fa-thumbs-up" aria-hidden="true"></i> <%= likes %></p>
|
|
|
|
<p><i class="fa fa-thumbs-down" aria-hidden="true"></i> <%= dislikes %></p>
|
|
|
|
<p id="Wilson">Wilson Score : <%= ci_lower_bound(likes, likes + dislikes).round(4) %></p>
|
|
|
|
<p id="Rating">Rating : <%= rating.round(4) %> / 5</p>
|
|
|
|
<p id="Engagement">Engagement : <%= engagement.round(2) %>%</p>
|
2017-12-31 03:00:21 +05:30
|
|
|
</div>
|
2018-01-16 08:00:57 +05:30
|
|
|
|
2017-12-31 03:00:21 +05:30
|
|
|
<div class="pure-u-1 pure-u-md-3-5">
|
2018-01-08 00:05:13 +05:30
|
|
|
<p><a class="link" href="https://youtube.com/channel/<%= video.info["ucid"] %>"><%= video.info["author"] %></a></p>
|
2018-01-15 08:46:09 +05:30
|
|
|
<p id="Description"><%= description %></p>
|
2017-12-31 03:00:21 +05:30
|
|
|
</div>
|
2018-01-16 08:00:57 +05:30
|
|
|
|
2017-12-31 03:00:21 +05:30
|
|
|
<div class="pure-u-1 pure-u-md-1-5">
|
2018-01-15 08:46:09 +05:30
|
|
|
<% rvs.each do |rv| %>
|
|
|
|
<% if rv.has_key?("id") %>
|
|
|
|
<p><a class="link" href="/watch?v=<%= rv["id"] %>"><%= rv["title"] %></a></p>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2018-01-07 23:20:04 +05:30
|
|
|
</div>
|