With Static Resources it works fine, but if I'm trying to use Documents and Url like /servlet/servlet.FileDownload?file=0698E0000008w5e
as source URL for <source>
tag – it prevents me from displaying it because of CSP (but for <img>
tag it's okay).
I understand that I can add my org URL to trusted whitelist, but is it the only way how can I display videos from Document and SF Files?
Here is my code template:
<video muted="true" aura:id="video" class="video" autoplay="autoplay" loop="loop" >
<source src="/servlet/servlet.FileDownload?file=0698E0000008w5e" type="video/mp4" />
</video>
Best Answer
If you have video stored in the salesforce files , you can use the lightning:fileCard component to show the preview of the video