How to have in place audio player

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.

How to have in place audio player

Postby swdev » Tue Dec 12, 2017 5:28 am

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
swdev
 
Posts: 3
Joined: Tue Aug 04, 2015 10:14 pm

Re: How to have in place audio player

Postby Webmaster » Tue Dec 12, 2017 9:06 am

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.
Webmaster
 
Posts: 10733
Joined: Fri Aug 06, 2004 5:59 pm

Re: How to have in place audio player

Postby swdev » Tue Dec 12, 2017 10:46 pm

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
swdev
 
Posts: 3
Joined: Tue Aug 04, 2015 10:14 pm

Re: How to have in place audio player

Postby Webmaster » Wed Dec 13, 2017 9:03 am

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.
Webmaster
 
Posts: 10733
Joined: Fri Aug 06, 2004 5:59 pm


Return to General Discussion (ASP.NET Maker)