2

I can use the nodownload video attribute on a VF page. Can't seem to get it to work on component. Is there a way to get nodownload attribute to work?

<aura:component>
<aura:html tag="div">
    <video width="640" height="480" poster="{!$Resource.NIIMBL_Logo}" controls="true" controlsList="nodownload" >
        <source src="/resource/video" type="video/mp4"  />
    </video>
</aura:html>

4
  • Even I am facing the same problem – Yogesh Malbhage Aug 16 '18 at 6:03
  • By not working do you mean it just doesn't appear in the rendered markup? Is there a way you could add it via JS after rendering? – Matt Lacey Aug 16 '18 at 6:28
  • Matt - It is not appearing in the rendered markup. I haven't looked into JS yet. – Michele Kleinhomer Aug 16 '18 at 13:55
  • I did not find a way to do it with a lightning component. I use Visualforce components to display my videos. – Michele Kleinhomer Sep 27 '20 at 2:14
0

we found the solution for it! yes salesforce is escaping some attributes from video tag after loading the page.

it works if we do it like below:

    <aura:component>
    <aura:attribute name="vidVal" type="String"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    
    <aura:unescapedHtml value="{!v.vidVal}"> </aura:unescapedHtml>
    
    <aura:component/>

 doInit : function(component,event){

            var vid = component.get("v.slide.mediaUrl");


            var ele = '<video aura:id="videoRenderer" disablePictureInPicture="true" controls="Play,Pause" controlsList="nodownload"> <source src="'+vid+'" type="video/mp4"> </source>Browser dont support Videos.</video> '
            component.set("v.vidVal" , ele);

            }
            
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.