I have embedded an audio file within the text element. As a consequence, the audiofile of the question below it does not work anymore. Why is that? Here is my code in the text:
<style>
#playButton {
border-radius: 2px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
padding: 3px 12px;
}
</style>
.... some text...
<audio id="audioPlayer" preload="auto" controlsList="nodownload">
<source src="pro://second_pfu_2_d.flac" type="audio/mpeg" />
Il tuo browser non può riprodurre questo file audio. Prova ad aprire il questionario con un altro browser. Se il file continua a non essere riprodotto, abbandona l'esperimento
</audio>
<button id="playButton" type="button">▶</button>
<script type="text/javascript">
<!--
var audioPlayer = document.getElementById('audioPlayer');
var playButton = document.getElementById('playButton');
var playbackCounter = 0;
var currentlyPlaying = false;
SoSciTools.attachEvent(playButton, "click", playAudio);
SoSciTools.attachEvent(audioPlayer, "ended", audioEnded);
function playAudio() {
if(!currentlyPlaying) {
audioPlayer.play();
currentlyPlaying = true;
playbackCounter++;
document.getElementById("C311_01").value = playbackCounter;
}
}
function audioEnded() {
currentlyPlaying = false;
}
-->
</script>
... some text