Page 1 of 1

How to have in place audio player

Posted: Tue Dec 12, 2017 5:28 am
by swdev

Hello,
we have a table with a field that contains full path to wav audio file.

How can we have a sound player, similar to audio.js, for the user to play the audio file while in list or view page?

Many thanks,

John


Re: How to have in place audio player

Posted: Tue Dec 12, 2017 9:06 am
by Webmaster

You can use Custom View Tag to display the field value by HTML 5 <audio> tag, see Field Setip -> View Tag in the help file.


Re: How to have in place audio player

Posted: Tue Dec 12, 2017 10:46 pm
by swdev

I implemented like that:

<audio controls>
<source src=@(CurrentPage.MY_FIELD.CurrentValue) type="audio/wav">
Your browser does not support the audio element.
</audio>

in order for you to check if it is correct way and to serve others who will have the same need.

Many thanks.

Kind regards,
John


Re: How to have in place audio player

Posted: Wed Dec 13, 2017 9:03 am
by Webmaster

Better use double quotes src="@CurrentPage.MY_FIELD.CurrentValue" in case the current value contains space. And this also assume current value contains the path of the file.