How to control HTML5 Audio Element from UI-Template?

I'm a newbie.
Would like some example code to get DOM Audio element basic custom control (play() / pause() methods from a button or clickable image) on HTML5 audio element rendered in browser.

I succeed to play audio file from audio controller with "autoplay" or "controls" properties sets in ui-template:

	<audio id="myaudio" src="myaudio_url" autoplay>
            Your browser does not support the
            <code>audio</code> element.
 </audio>

or 

<audio id="myaudio" src="myaudio_url" controls>
            Your browser does not support the
            <code>audio</code> element.
    </audio>

Unfortunately don't know how to script play() / pause () methods from a custom button in NR UI-template.

Any help welcome.
Thank's

Hi Herold,
Welcome to the forum!
Normally - unless I have something misunderstood about your case - you can use the ui_audio node (which is part of the dashboard node set) for this. Here is more information. Although pauzing is not possible this way (see here)...
Bart

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.