Home Forums Community Forum video controls customization

Only users with a registered purchase of Avada can post to the community forum. Please register your purchase here.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • azorlone
    Participant
    Post count: 1

    I was wondering if there is a way to disable some elements in the fusion-video controls (for a self-hosted video).
    In particular, I’d like to hide the button that allows Download and Picture in Picture options.

    Any hint anyone?
    Thanks

    mich44
    Participant
    Post count: 4

    I’ve the response but can’t write here …

    mich44
    Participant
    Post count: 4

    Hi !

    I asked myself the same question and I find stupid that this option was not natively integrated …

    So, after hours of research, here is a solution that works perfectly (for me) !
    We will modify the code (with javascript) after WP and Avada loading the video player on the page.

    -> If you are developer, you can create a js file and load in your footer.
    -> If you are not, you can add extension to help you inject code in your website.

    Here, I explain with the extension method :

    1. Download (and install) the “Woody ad Snippet” extension (or another one)

    2. Create a JS snippet

    3. Add this code:

    var vids = document.getElementsByTagName('video'); 
    for( var i = 0; i < vids.length; i++ ){ 
    	vids[i].setAttribute('controlsList','nodownload');
    }

    3b. If you wish to deactivate “PiP”, you must add this line:
    vids[i].disablePictureInPicture = true;

    4. Choose “Automatic insertion” and “footer” in the first 2 options

    5. The controls are juste masked, and anyone do reactivate in html with debugger …
    If you also want to block the download by URL, add this to your .htaccess file:

    RewriteEngine On
    RewriteCond %{REQUEST_URI} \.(mp4|mp3|avi)$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com/.*$ [NC]
    RewriteRule ^.* - [F,L]

    6. Sorry for my English 🙂

    • This reply was modified 2 weeks ago by mich44.
    • This reply was modified 2 weeks ago by mich44.
    mich44
    Participant
    Post count: 4

    All right, just the link (url) of extension … Find it 🙂

    • This reply was modified 2 weeks ago by mich44.
    mich44
    Participant
    Post count: 4

    Damn, the right click on the video player still allows you to download the video, even ignoring the .htaccess file ! It is possible to deactivate the contextual menu ONLY on the video player (and not on the whole website, wrong practice).

    Just add this line after :
    vids[i].setAttribute('oncontextmenu','return false');

Viewing 5 posts - 1 through 5 (of 5 total)
Only users with a registered purchase of Avada can post to the community forum. Please register your purchase here.