Add setting to autoplay videos

This commit is contained in:
Astound 2024-01-22 06:38:52 +08:00
parent 97972d6fa3
commit b215e2a3b2
Signed by: kaiser
GPG Key ID: 97504AF0027B1A56
2 changed files with 8 additions and 1 deletions

View File

@ -151,6 +151,13 @@ For security reasons, enabling this is not recommended.''',
'category': 'interface', 'category': 'interface',
}), }),
('autoplay_videos', {
'type': bool,
'default': False,
'comment': '',
'category': 'playback',
}),
('default_resolution', { ('default_resolution', {
'type': int, 'type': int,
'default': 720, 'default': 720,

View File

@ -40,7 +40,7 @@
</div> </div>
{% else %} {% else %}
<figure class="sc-video"> <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 %} {% if uni_sources %}
<source src="{{ uni_sources[uni_idx]['url'] }}" type="{{ uni_sources[uni_idx]['type'] }}" data-res="{{ uni_sources[uni_idx]['quality'] }}"> <source src="{{ uni_sources[uni_idx]['url'] }}" type="{{ uni_sources[uni_idx]['type'] }}" data-res="{{ uni_sources[uni_idx]['quality'] }}">
{% endif %} {% endif %}