mackavi wrote:
You can tap directly in the HTML5 audio element with JavaScript.
Code:
myAudio = new Audio('music.mp3');
myAudio.play()
Note, that the play function belongs to JavaScript not Opus and therefore uses the lowercase 'p'. The Opus editor will auto-correct - so make sure to change it back.
Additionally, if you wish to use the audio as a publication resource rather than a page resource you will need to define myAudio as a publication variable.
</mack>
It seems that I do something wrong: I have used the code as above. Instead of 'music.mp3' I have used 'click30_snap.mp3' for example.
Unfortunately I always get an error message "Undefined identifier 'Audio'" in the script console.
Mack, do you have an idea what causes this?