Hi all,
Is there a macro to insert the attached audio file as HTML5 onto a confluence page?
Something similar to https://answers.atlassian.com/questions/171822.
Greetings Reto E.
Yes. I tried a really simple user macro (based on the mentioned post) and it seams to work.
## Macro title: HTML5 Audio
## Macro has a body: N
##
## Output: HTML
##
## @param src:title=Source|type=string|required=true|desc=Attached audio filename
#set ($attachment = $content.getAttachmentNamed($paramsrc))
<audio controls>
<source type="audio/$attachment.getFileExtension()" src="$attachment.getDownloadPath()" />
Your browser does not support the audio element.
</audio>
<p>
<strong>Download audio:</strong> <a href="$attachment.getDownloadPath()">$attachment.getFileExtension() format</a>
</p>
Like that post you linked to, create your own User Macro and use the HTML5 audio tag (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.