diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-07-19 10:30:54 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-07-19 10:30:54 -0500 |
| commit | 8861d31b217180f1f37a262b9af3ffd075fa0497 (patch) | |
| tree | c21d1eba6c113f7a5c95aa58368ca9345b80c21d | |
| parent | d997344f3e2e0282cbf3e1f2a3e4cffa3ff5be25 (diff) | |
| download | invidious-8861d31b217180f1f37a262b9af3ffd075fa0497.tar.gz invidious-8861d31b217180f1f37a262b9af3ffd075fa0497.tar.bz2 invidious-8861d31b217180f1f37a262b9af3ffd075fa0497.zip | |
Move video options to <video> element
| -rw-r--r-- | src/invidious/views/embed.ecr | 9 | ||||
| -rw-r--r-- | src/invidious/views/watch.ecr | 12 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/invidious/views/embed.ecr b/src/invidious/views/embed.ecr index e9c09402..81926c4a 100644 --- a/src/invidious/views/embed.ecr +++ b/src/invidious/views/embed.ecr @@ -29,8 +29,12 @@ video, #my_video, .video-js, .vjs-default-skin } </style> -<video playsinline poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>" id="player" class="video-js vjs-default-skin"> +<video playsinline poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>" id="player" + <% if autoplay == 1 %>autoplay<% end %> + <% if controls == 1 %>controls<% end %> + <% if video_loop == 1 %>loop<% end %> <% if listen %> + class="video-js vjs-default-skin"> <% audio_streams.each_with_index do |fmt, i| %> <source src="<%= fmt["url"] %>" type='<%= fmt["type"] %>' label="<%= fmt["bitrate"] %>k" selected="<%= i == 0 ? true : false %>"> <% end %> @@ -44,9 +48,6 @@ video, #my_video, .video-js, .vjs-default-skin <script> var options = { preload: "auto", - <% if autoplay == 1 %>autoplay: true, <% end %> - <% if controls == 1 %>controls: true, <% end %> - <% if video_loop == 1 %>loop: true, <% end %> playbackRates: [0.5, 1, 1.5, 2], controlBar: { children: [ diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index afbb5658..3fb7ecda 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -10,7 +10,13 @@ <% end %> <div class="h-box"> - <video style="width:100%" playsinline poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>" id="player" class="video-js vjs-16-9" data-setup="{}" controls> + <video style="width:100%" playsinline poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>" + id="player" class="video-js vjs-16-9" data-setup="{}" + <% if preferences %> + <% if preferences.autoplay %>autoplay<% end %> + <% if preferences.video_loop %>loop<% end %> + <% end %> + controls> <% if listen %> <% audio_streams.each_with_index do |fmt, i| %> <source src="<%= fmt["url"] %>" type='<%= fmt["type"] %>' label="<%= fmt["bitrate"] %>k" selected="<%= i == 0 ? true : false %>"> @@ -30,10 +36,6 @@ <script> var options = { preload: "auto", - <% if preferences %> - <% if preferences.autoplay %>autoplay: true, <% end %> - <% if preferences.video_loop %>loop: true, <% end %> - <% end %> playbackRates: [0.5, 1, 1.5, 2], controlBar: { children: [ |
