audio file html5 user macro

Reto Eggenberger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 16, 2015

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.

2 answers

1 accepted

0 votes
Answer accepted
Reto Eggenberger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 17, 2015

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>
0 votes
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 17, 2015

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).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events