dont play event music when twitter or reddit embeds are present (they have videos with sound)

master
Aevann 2024-11-13 18:01:57 +02:00
parent 1960d5ee11
commit c75d467468
2 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
if (!playing_music()) {
if (!playing_music() && !document.getElementsByClassName('twitter-embed') && !document.getElementsByClassName('reddit-embed')) {
addEventListener("load", () => {
const audio = document.getElementById('event-song');

View File

@ -139,7 +139,7 @@
{% endif %}
{% endif %}
{% if IS_MUSICAL_EVENT() and not IS_LOCALHOST and not (SITE_NAME == 'WPD' and not v) and (not v or v.event_music) and not (hole and hole.name == 'music') and not (u and u.song) and not (IS_HOMOWEEN() and p and p.award_count("haunt", v)) and not (p and p.embed and p.domain == 'x.com') and err != 406 %}
{% if IS_MUSICAL_EVENT() and not IS_LOCALHOST and not (SITE_NAME == 'WPD' and not v) and (not v or v.event_music) and not (hole and hole.name == 'music') and not (u and u.song) and not (IS_HOMOWEEN() and p and p.award_count("haunt", v)) and err != 406 %}
{% set path = "assets/events/" ~ IS_EVENT() ~ "/music" %}
{% set song = SITE_FULL ~ "/" ~ path ~ "/" ~ listdir('files/'~path)|seeded_random(id) ~ '?x=45' %}
<audio id="event-song" hidden preload="none" src="{{song}}" loop></audio>