Lyd: Tillad autostart
Tillader autostart af lyd for 1-3 URL'er.
Source: Download script
Last Updated: 11. September 2025 by Agnete Moos (agms@sonderborg.dk)
Parameters:
Navn | Type | Standardværdi | Påkrævet |
---|---|---|---|
Click to see the source code
#! /usr/bin/env sh
# AutoplayAllowed should enable autoplay globally while the other makes an exception and allows it for a specific
# webpage. So really, both shouldn't be needed.
# AudioOutputAllowed is probably irrelevant, but might as well start out with the sledge hammer approach and then refine
# from there
ACTIVATE="$1"
URL_1="$2"
URL_2="$3"
URL_3="$4"
URLS="$URL_1 $URL_2 $URL_3"
AUDIO_POLICY="/etc/opt/chrome/policies/managed/os2borgerpc-audio-allow.json"
set -x
if [ "$ACTIVATE" = "False" ]; then
rm --force $AUDIO_POLICY
exit
fi
# Add the head
cat > "$AUDIO_POLICY" <> $AUDIO_POLICY
else
echo " \"$url\"" >> $AUDIO_POLICY
fi
done
# Add the tail
cat >> "$AUDIO_POLICY" <
Beskrivelse
Normalt vil aktivering af lyd ellers kræve brugerinteraktion på de fleste sider, såsom at der trykkes på en knap før afspilningning starter.
Et eksempel på brug er hvis BorgerPC’en bruges til at modtage beskeder fra Frontdesk.