diff options
| -rw-r--r-- | src/invidious.cr | 11 | ||||
| -rw-r--r-- | src/invidious/views/embed.ecr | 5 | ||||
| -rw-r--r-- | src/invidious/views/subscription_manager.ecr | 8 |
3 files changed, 20 insertions, 4 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 14408a95..7254d9f5 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -397,6 +397,15 @@ get "/embed/:id" do |env| end listen ||= false + autoplay = env.params.query["autoplay"]?.try &.to_i + autoplay ||= 0 + + controls = env.params.query["controls"]?.try &.to_i + controls ||= 1 + + video_loop = env.params.query["loop"]?.try &.to_i + video_loop ||= 0 + client = make_client(YT_URL) begin video = get_video(id, client, PG_DB) @@ -502,7 +511,7 @@ get "/login" do |env| referer = "/feed/subscriptions" end - if referer.size > 32 + if referer.size > 64 referer = "/feed/subscriptions" end diff --git a/src/invidious/views/embed.ecr b/src/invidious/views/embed.ecr index 38eb5155..e9c09402 100644 --- a/src/invidious/views/embed.ecr +++ b/src/invidious/views/embed.ecr @@ -29,7 +29,7 @@ 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" controls> +<video playsinline poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>" id="player" class="video-js vjs-default-skin"> <% 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 %>"> @@ -44,6 +44,9 @@ 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/subscription_manager.ecr b/src/invidious/views/subscription_manager.ecr index 23afa609..e2335b37 100644 --- a/src/invidious/views/subscription_manager.ecr +++ b/src/invidious/views/subscription_manager.ecr @@ -11,9 +11,13 @@ <a href="/channel/<%= channel.id %>"><%= channel.author %></a> </div> <div class="pure-u-2-5"></div> - <div class="pure-u-1-5"> - <a style="vertical-align: right;" href="/subscription_ajax?action_remove_subscriptions=1&c=<%= channel.id %>">unsubscribe</a> + <div class="pure-u-1-5" style="text-align: right;"> + <a href="/subscription_ajax?action_remove_subscriptions=1&c=<%= channel.id %>">unsubscribe</a> </div> </div> </h3> + +<% if subscriptions[-1].author != channel.author %> +<hr style="margin-left:1em; margin-right:1em;"> +<% end %> <% end %>
\ No newline at end of file |
