mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
50 lines
2.7 KiB
Text
50 lines
2.7 KiB
Text
<video style="outline:none;width:100%;background-color:#000" playsinline poster="<%= thumbnail %>"
|
|
id="player" class="on-video_player video-js player-style-<%= params.player_style %>"
|
|
<% if params.autoplay %>autoplay<% end %>
|
|
<% if params.video_loop %>loop<% end %>
|
|
<% if params.controls %>controls<% end %>>
|
|
<% if (hlsvp = video.hls_manifest_url) && !CONFIG.disabled?("livestreams") %>
|
|
<source src="<%= URI.parse(hlsvp).request_target %><% if params.local %>?local=true<% end %>" type="application/x-mpegURL" label="livestream">
|
|
<% else %>
|
|
<% if params.listen %>
|
|
<% audio_streams.each_with_index do |fmt, i| %>
|
|
<source src="/latest_version?id=<%= video.id %>&itag=<%= fmt["itag"] %><% if params.local %>&local=true<% end %>" type='<%= fmt["mimeType"] %>' label="<%= fmt["bitrate"] %>k" selected="<%= i == 0 ? true : false %>">
|
|
<% end %>
|
|
<% else %>
|
|
<% if params.quality == "dash" %>
|
|
<source src="/api/manifest/dash/id/<%= video.id %>?local=true&unique_res=1" type='application/dash+xml' label="dash">
|
|
<% end %>
|
|
|
|
<% fmt_stream.each_with_index do |fmt, i| %>
|
|
<% if params.quality %>
|
|
<source src="/latest_version?id=<%= video.id %>&itag=<%= fmt["itag"] %><% if params.local %>&local=true<% end %>" type='<%= fmt["mimeType"] %>' label="<%= fmt["quality"] %>" selected="<%= params.quality == fmt["quality"] %>">
|
|
<% else %>
|
|
<source src="/latest_version?id=<%= video.id %>&itag=<%= fmt["itag"] %><% if params.local %>&local=true<% end %>" type='<%= fmt["mimeType"] %>' label="<%= fmt["quality"] %>" selected="<%= i == 0 ? true : false %>">
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<% preferred_captions.each do |caption| %>
|
|
<track kind="captions" src="/api/v1/captions/<%= video.id %>?label=<%= caption.name %>&hl=<%= env.get("preferences").as(Preferences).locale %>"
|
|
label="<%= caption.name %>">
|
|
<% end %>
|
|
|
|
<% captions.each do |caption| %>
|
|
<track kind="captions" src="/api/v1/captions/<%= video.id %>?label=<%= caption.name %>&hl=<%= env.get("preferences").as(Preferences).locale %>"
|
|
label="<%= caption.name %>">
|
|
<% end %>
|
|
<% end %>
|
|
</video>
|
|
|
|
<script id="player_data" type="application/json">
|
|
<%=
|
|
{
|
|
"aspect_ratio" => aspect_ratio,
|
|
"title" => video.title,
|
|
"description" => HTML.escape(video.short_description),
|
|
"thumbnail" => thumbnail,
|
|
"preferred_caption_found" => !preferred_captions.empty?
|
|
}.to_pretty_json
|
|
%>
|
|
</script>
|
|
<script src="/js/player.js?v=<%= ASSET_COMMIT %>"></script>
|