mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-26 16:52:12 +05:30
Split audio and video into seperate views
This commit is contained in:
parent
6adbcd050c
commit
489ae35f1d
9
src/views/player/audio.ecr
Normal file
9
src/views/player/audio.ecr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<audio id="player" class="video-js" data-setup="{}" style="width:100%;" controls>
|
||||||
|
<% adaptive_fmts.each do |fmt| %>
|
||||||
|
<% url = fmt["url"]? %>
|
||||||
|
<% type = fmt["type"]? ? fmt["type"].to_s.split(";")[0] : "" %>
|
||||||
|
<% if type.starts_with?("audio") %>
|
||||||
|
<source src="<%= url %>" type="<%= type %>">
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</audio>
|
5
src/views/player/video.ecr
Normal file
5
src/views/player/video.ecr
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<video id="player" class="video-js" data-setup="{}" style="width:100%;" controls>
|
||||||
|
<% fmt_stream.each do |fmt| %>
|
||||||
|
<source src="<%= fmt["url"]? %>" type="<%= fmt["type"]? ? fmt["type"].to_s.split(";")[0] : "" %>">
|
||||||
|
<% end %>
|
||||||
|
</video>
|
@ -6,21 +6,9 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if listen %>
|
<% if listen %>
|
||||||
<audio id="player" class="video-js" data-setup="{}" style="width:100%;" controls>
|
<%= render "src/views/player/audio.ecr" %>
|
||||||
<% adaptive_fmts.each do |fmt| %>
|
|
||||||
<% url = fmt["url"]? %>
|
|
||||||
<% type = fmt["type"]? ? fmt["type"].to_s.split(";")[0] : "" %>
|
|
||||||
<% if type.starts_with?("audio") %>
|
|
||||||
<source src="<%= url %>" type="<%= type %>">
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</audio>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<video id="player" class="video-js" data-setup="{}" style="width:100%;" controls>
|
<%= render "src/views/player/video.ecr" %>
|
||||||
<% fmt_stream.each do |fmt| %>
|
|
||||||
<source src="<%= fmt["url"]? %>" type="<%= fmt["type"]? ? fmt["type"].to_s.split(";")[0] : "" %>">
|
|
||||||
<% end %>
|
|
||||||
</video>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
Loading…
Reference in New Issue
Block a user