aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAstound <kirito@disroot.org>2024-01-22 06:38:52 +0800
committerAstound <kirito@disroot.org>2024-01-22 06:38:52 +0800
commitb215e2a3b235f167796355e10d48fa63fc61ce1f (patch)
tree00799efba07c12938b0262de8fe3d53b9f35af78
parent97972d6fa3bdbe4a02589345373c958e7b2f9c22 (diff)
downloadyt-local-b215e2a3b235f167796355e10d48fa63fc61ce1f.tar.lz
yt-local-b215e2a3b235f167796355e10d48fa63fc61ce1f.tar.xz
yt-local-b215e2a3b235f167796355e10d48fa63fc61ce1f.zip
Add setting to autoplay videos
-rw-r--r--settings.py7
-rw-r--r--youtube/templates/watch.html2
2 files changed, 8 insertions, 1 deletions
diff --git a/settings.py b/settings.py
index d8876e2..eb210c5 100644
--- a/settings.py
+++ b/settings.py
@@ -151,6 +151,13 @@ For security reasons, enabling this is not recommended.''',
'category': 'interface',
}),
+ ('autoplay_videos', {
+ 'type': bool,
+ 'default': False,
+ 'comment': '',
+ 'category': 'playback',
+ }),
+
('default_resolution', {
'type': int,
'default': 720,
diff --git a/youtube/templates/watch.html b/youtube/templates/watch.html
index 99dbc6d..9cf9657 100644
--- a/youtube/templates/watch.html
+++ b/youtube/templates/watch.html
@@ -40,7 +40,7 @@
</div>
{% else %}
<figure class="sc-video">
- <video id="js-video-player" playsinline controls>
+ <video id="js-video-player" playsinline controls {{ 'autoplay' if settings.autoplay_videos }}>
{% if uni_sources %}
<source src="{{ uni_sources[uni_idx]['url'] }}" type="{{ uni_sources[uni_idx]['type'] }}" data-res="{{ uni_sources[uni_idx]['quality'] }}">
{% endif %}