AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Solved] Hide menu "download" from video player

5 Posts
3 Users
0 Reactions
604 Views
Posts: 6
 fufy
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@fufy)
Active Member
Joined: 6 months ago
[#65043]

I have this code in my wordpress theme's functions.php to disable download menu from video player which works great on my posts, i.e. video plays normally and has all functions except the download menu - just what I need.

add_filter( 'render_block', 'video_block_render', 10, 2 );
function video_block_render( $output, $block ) {
    if ( 'core/video' !== $block['blockName'] ) {
      return $output;
    }
    $output = str_replace(
      '<video controls',
        '<video controls controlslist="nodownload"', $output
    );
    return $output;
}

But in wpForo posts, the video player's download menu shows normally. Not sure if there's anything from wpForo that overcomes or has higher priorty that blocks this function not working properly. I've also tried adding the code to wpForo's functions.php instead of Wordpress's but didn't work either.

Please kindly advise.

 

Many thanks.

 


4 Replies
4 Replies
wpForo Support
Moderator
(@wpforo-support)
Joined: 6 months ago

Member
Posts: 53
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@fufy,
To hide or disable the download menu from the video player in wpForo posts, you can use custom CSS to target the video player's controls and hide the download option, since the default WordPress function does not work in wpForo posts. For example, you can add CSS like this:

#wpforo .wp-video::-webkit-media-controls-enclosure { /* Hide download button in WebKit browsers */
  overflow: hidden;
}
#wpforo .wp-video::-webkit-media-controls-download-button {
  display: none !important;
}

This CSS targets the video controls inside wpForo posts and hides the download button. You may need to adjust selectors depending on your theme or video player.

If you need more advanced control or customization, consider contacting the Gvectors Custom Work Team for custom development, as wpForo does not have built-in integration for changing video player controls directly.


Reply
 fufy
(@fufy)
Joined: 6 months ago

Active Member
Posts: 6
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@wpforo-support Thank you for looking at my issue. I've put the code to wpForo's custom CSS but the download menu still appears. I've attached the pictures here for your checking.

wpforo css
video player

Reply
Sofy
 Sofy
Admin
(@sofy)
Joined: 8 years ago

Support Team
Posts: 5774
wpForo Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@fufy 

Use this hook-code: 

add_filter( 'wpforo_content_after', function($content){ return str_replace( '<video ', '<video controlslist="nodownload" ', $content ); }, 999 );

Reply
 fufy
(@fufy)
Joined: 6 months ago

Active Member
Posts: 6
wpForo Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@sofy Yes this one works perfectly. So many thanks!


Reply
Share: