You need to sign in to do that
Don't have an account?
Mentee
Need inputs please?
Play audio files in Visualforce page which are saved in Files Object
<apex:page docType="html-5.0" standardController="Task"> <div> <audio controls="true" preload="auto"> <source src="https://mydomain.salesforce.com/servlet/servlet.FileDownload?file=0698c00000Allk9AAB"/> </audio> </div> <!-- <apex:outputLink value="https://mydomain.salesforce.com/servlet/servlet.FileDownload?file=0698c00000Allk9AAB" id="theLink" type="audio/mp3" rendered="" >Play Recording (mp3)</apex:outputLink>--> </apex:page>
Need inputs please?
Please elaborate on the challenge you are facing so we can suggest better?
code pasted in initial post, is not working
If the file is attached as type "File" then you need to give permission for playing the file in browser as below.
Go to Setup-> File Upload and Download Security->edit and update the mp3 setting as "execute in browser". Then only you will be able to play the file in browser.
Now go to file which you want to play and click on download mp3 button and you will see the url copy the url in the vf page. The Url looks like below.
If the file is upload as type attachment then anyway the file url will play as it is as the id starts with "00P".
If this information helps, please mark the answer as best. Thank you