2019-04-11 22:03:37 +00:00
|
|
|
<video style="outline:none;width:100%;background-color:#000" playsinline poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>"
|
2019-08-09 00:00:22 +00:00
|
|
|
id="player" class="video-js player-style-<%= params.player_style %>"
|
2018-11-26 01:01:04 +00:00
|
|
|
onmouseenter='this["data-title"]=this["title"];this["title"]=""'
|
|
|
|
onmouseleave='this["title"]=this["data-title"];this["data-title"]=""'
|
|
|
|
oncontextmenu='this["title"]=this["data-title"]'
|
2019-05-01 04:39:04 +00:00
|
|
|
<% if params.autoplay %>autoplay<% end %>
|
|
|
|
<% if params.video_loop %>loop<% end %>
|
|
|
|
<% if params.controls %>controls<% end %>>
|
2019-07-07 14:07:53 +00:00
|
|
|
<% if hlsvp && !CONFIG.disabled?("livestreams") %>
|
2019-04-25 17:41:35 +00:00
|
|
|
<source src="<%= hlsvp %>?local=true" type="application/x-mpegURL" label="livestream">
|
2018-08-11 15:52:13 +00:00
|
|
|
<% else %>
|
2019-05-01 04:39:04 +00:00
|
|
|
<% if params.listen %>
|
2018-08-11 15:52:13 +00:00
|
|
|
<% audio_streams.each_with_index do |fmt, i| %>
|
2019-05-01 04:39:04 +00:00
|
|
|
<source src="/latest_version?id=<%= video.id %>&itag=<%= fmt["itag"] %><% if params.local %>&local=true<% end %>" type='<%= fmt["type"] %>' label="<%= fmt["bitrate"] %>k" selected="<%= i == 0 ? true : false %>">
|
2018-08-11 15:52:13 +00:00
|
|
|
<% end %>
|
2019-03-23 18:31:07 +00:00
|
|
|
<% else %>
|
2019-05-01 04:39:04 +00:00
|
|
|
<% if params.quality == "dash" %>
|
2018-09-25 00:28:36 +00:00
|
|
|
<source src="/api/manifest/dash/id/<%= video.id %>?local=true" type='application/dash+xml' label="dash">
|
|
|
|
<% end %>
|
2019-03-23 18:31:07 +00:00
|
|
|
|
2018-08-11 15:52:13 +00:00
|
|
|
<% fmt_stream.each_with_index do |fmt, i| %>
|
2019-05-01 04:39:04 +00:00
|
|
|
<% if params.quality %>
|
|
|
|
<source src="/latest_version?id=<%= video.id %>&itag=<%= fmt["itag"] %><% if params.local %>&local=true<% end %>" type='<%= fmt["type"] %>' label="<%= fmt["label"] %>" selected="<%= params.quality == fmt["label"].split(" - ")[0] %>">
|
2018-08-11 15:52:13 +00:00
|
|
|
<% else %>
|
2019-05-01 04:39:04 +00:00
|
|
|
<source src="/latest_version?id=<%= video.id %>&itag=<%= fmt["itag"] %><% if params.local %>&local=true<% end %>" type='<%= fmt["type"] %>' label="<%= fmt["label"] %>" selected="<%= i == 0 ? true : false %>">
|
2018-08-11 15:52:13 +00:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2019-05-02 01:03:39 +00:00
|
|
|
<% end %>
|
2018-08-11 15:52:13 +00:00
|
|
|
|
|
|
|
<% preferred_captions.each_with_index do |caption, i| %>
|
2019-05-02 01:03:39 +00:00
|
|
|
<track kind="captions" src="/api/v1/captions/<%= video.id %>?label=<%= caption.name.simpleText %>&hl=<%= env.get("preferences").as(Preferences).locale %>"
|
|
|
|
label="<%= caption.name.simpleText %>" <% if i == 0 %>default<% end %>>
|
2018-08-11 15:52:13 +00:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% captions.each do |caption| %>
|
2019-05-02 01:03:39 +00:00
|
|
|
<track kind="captions" src="/api/v1/captions/<%= video.id %>?label=<%= caption.name.simpleText %>&hl=<%= env.get("preferences").as(Preferences).locale %>"
|
|
|
|
label="<%= caption.name.simpleText %>">
|
2018-08-11 15:52:13 +00:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2018-12-09 02:12:22 +00:00
|
|
|
</video>
|
2018-08-11 15:52:13 +00:00
|
|
|
|
|
|
|
<script>
|
2019-05-06 16:23:14 +00:00
|
|
|
var player_data = {
|
|
|
|
aspect_ratio: '<%= aspect_ratio %>',
|
2019-05-02 01:03:39 +00:00
|
|
|
title: "<%= video.title.dump_unquoted %>",
|
2019-06-08 20:08:27 +00:00
|
|
|
description: "<%= HTML.escape(video.short_description) %>",
|
2019-05-06 16:23:14 +00:00
|
|
|
thumbnail: "<%= thumbnail %>"
|
2018-11-28 03:18:20 +00:00
|
|
|
}
|
2018-08-11 15:52:13 +00:00
|
|
|
</script>
|
2019-05-09 16:52:37 +00:00
|
|
|
<script src="/js/player.js?v=<%= ASSET_COMMIT %>"></script>
|