From 2d1794889aa3591b31a62f325a0c11a8553ba2d9 Mon Sep 17 00:00:00 2001 From: Umimaso Date: Mon, 21 Jun 2021 00:56:26 +0100 Subject: feat: autoplay for related videos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add autoplay support for related videos. Move the playlist autoplay code into this shared script. Add the SameSite=Strict attribute to the autoplay cookie due to Firefox soon rejecting cookies which use SameSite=None without the secure attribute. Closes: #50 Signed-off-by: Jesús --- youtube/static/watch.css | 8 ++ youtube/templates/watch.html | 262 ++++++++++++++++++++++++------------------- 2 files changed, 152 insertions(+), 118 deletions(-) diff --git a/youtube/static/watch.css b/youtube/static/watch.css index 90c08d5..60abd21 100644 --- a/youtube/static/watch.css +++ b/youtube/static/watch.css @@ -345,6 +345,14 @@ label[for=options-toggle-cbox] { .side-videos { grid-area: side-videos; } +.side-videos .related-autoplay { + list-style: none; + display: grid; + grid-template-columns: repeat(2, auto); + justify-content: start; + grid-column-gap: 0.5rem; +} + /* playlist items */ .side-videos .site-playlist { border-style: solid; diff --git a/youtube/templates/watch.html b/youtube/templates/watch.html index 0b61f92..47880b8 100644 --- a/youtube/templates/watch.html +++ b/youtube/templates/watch.html @@ -150,124 +150,42 @@ {% if playlist %} -
-
-

{{ playlist['title'] }}

- -
- - {% if playlist['current_index'] is not none %} - - {% endif %} - {% if playlist['id'] is not none %} - - {% endif %} -
+ // @license-end + + {% endif %} + + {% elif settings.related_videos_mode != 0 %} + + {% endif %} + + {% if settings.related_videos_mode != 0 or playlist %} + {% endif %} -- cgit v1.2.3