Change Youtube & JellyFin Player for default Volume
This commit is contained in:
1 parent
72e890fe5a
commit
7b6a181a17
3 files changed
+55
-199
No files matched your search
@@ -41,7 +41,6 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 mb-4">
|
||||
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header bg-dark text-white fw-bold">Das Panel</div>
|
||||
<div class="list-group list-group-flush">
|
||||
@@ -58,12 +57,11 @@
|
||||
|
||||
<div class="video-section mb-4">
|
||||
{% if video_mode == 'jellyfin' %}
|
||||
{# --- INTERNE ANSICHT (Jellyfin Native Player) --- #}
|
||||
<div class="card border-primary shadow-sm">
|
||||
<div class="card-header bg-primary text-white p-2 small fw-bold text-center">Lokalarchiv (Jellyfin)</div>
|
||||
<div class="card-body p-0 bg-black">
|
||||
<div class="ratio ratio-16x9">
|
||||
<video controls preload="metadata"
|
||||
<video id="jellyfin-player" controls preload="metadata"
|
||||
poster="{{ jellyfin_url }}/Items/{{ folge.zusatzinfo.jellyfin_item_id }}/Images/Primary"
|
||||
style="width: 100%; height: 100%;">
|
||||
<source src="{{ jellyfin_url }}/Videos/{{ folge.zusatzinfo.jellyfin_item_id }}/stream.mp4?static=true" type="video/mp4">
|
||||
@@ -72,19 +70,22 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var jfPlayer = document.getElementById('jellyfin-player');
|
||||
if (jfPlayer) {
|
||||
// <u>Wert zwischen 0.0 (stumm) und 1.0 (volle Lautstärke)</u>
|
||||
jfPlayer.volume = 0.5;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% elif video_mode == 'youtube' %}
|
||||
{# --- EXTERNE ANSICHT (YouTube mit Embed-Filter) --- #}
|
||||
<div class="card border-danger shadow-sm">
|
||||
<div class="card-header bg-danger text-white p-2 small fw-bold text-center">Video (YouTube)</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="ratio ratio-16x9">
|
||||
<iframe
|
||||
src="{{ folge.zusatzinfo.yt_adresse|as_embed }}"
|
||||
title="YouTube video player"
|
||||
frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
<div id="player"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -92,13 +93,12 @@
|
||||
<div class="d-flex flex-column flex-sm-row justify-content-between align-items-start align-items-sm-center">
|
||||
<p class="text-muted mb-2 mb-sm-0" style="font-size: 0.75rem; line-height: 1.2;">
|
||||
<i class="bi bi-youtube text-danger me-1"></i>
|
||||
<strong>Externer Inhalt:</strong> Dieses Video wird von YouTube bereitgestellt. Für Inhalte und Erreichbarkeit wird keine Haftung übernommen.
|
||||
<strong>Externer Inhalt:</strong><br> Dieses Video wird von YouTube bereitgestellt. Für Inhalte und Erreichbarkeit wird keine Haftung übernommen.
|
||||
</p>
|
||||
|
||||
{# --- MELDE-LOGIK --- #}
|
||||
<div id="report-section">
|
||||
{% if zusatzinfo.video_defekt_gemeldet %}
|
||||
<span class="badge bg-warning text-dark small animate__animated animate__fadeIn">
|
||||
<span class="badge bg-warning text-dark small">
|
||||
<i class="bi bi-exclamation-triangle-fill me-1"></i> Defekt bereits gemeldet
|
||||
</span>
|
||||
{% else %}
|
||||
@@ -111,9 +111,39 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn-close small" data-bs-dismiss="alert" aria-label="Schließen" style="padding: 0.75rem;"></button>
|
||||
<button type="button" class="btn-close small" data-bs-dismiss="alert" aria-label="Schließen"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var tag = document.createElement('script');
|
||||
tag.src = "https://www.youtube.com/iframe_api";
|
||||
var firstScriptTag = document.getElementsByTagName('script')[0];
|
||||
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
||||
|
||||
var player;
|
||||
function onYouTubeIframeAPIReady() {
|
||||
player = new YT.Player('player', {
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
videoId: '{{ folge.zusatzinfo.yt_adresse|get_yt_id }}',
|
||||
playerVars: {
|
||||
'playsinline': 1,
|
||||
'rel': 0,
|
||||
'modestbranding': 1
|
||||
},
|
||||
events: {
|
||||
'onReady': onPlayerReady
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function onPlayerReady(event) {
|
||||
// <u>Hier wird die Lautstärke auf 50% gesetzt</u>
|
||||
event.target.setVolume(50);
|
||||
}
|
||||
</script>
|
||||
|
||||
{% else %}
|
||||
<div class="alert alert-secondary text-center small">Kein Video verfügbar.</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in new issue
Block a user