put the volume script on the show notes page stub, rather than in the shortcode. Volume will ONLY get set on shownotes pages

This commit is contained in:
Greg Gauthier 2022-01-01 18:13:00 +00:00
parent f5607e3ff4
commit 52fdd033e6
2 changed files with 7 additions and 6 deletions

View File

@ -2,10 +2,4 @@
<audio id="audio_player" style="width:80%" onloadeddata="set_volume()" controls> <audio id="audio_player" style="width:80%" onloadeddata="set_volume()" controls>
<source src="{{ index .Params 0 }}" type="audio/mpeg"> <source src="{{ index .Params 0 }}" type="audio/mpeg">
</audio> </audio>
<script>
let audio = document.getElementById("audio_player");
function set_volume(){
audio.volume = 0.4;
}
</script>
</div> </div>

View File

@ -13,6 +13,13 @@
</span> </span>
{{ end }} {{ end }}
{{ .Content }} {{ .Content }}
<script>
let audio = document.getElementById("audio_player");
function set_volume(){
audio.volume = 0.4;
}
</script>
</div> </div>
{{ partial "footer.html" . }} {{ partial "footer.html" . }}