Notifications
Clear all

Paid Addons Support Forum Only

Please note, that here we only support Paid Addons issues and questions.

gVectors Support staff works from 6am to 6pm (GMT+0)

All questions related to wpForo and wpDiscuz free plugins should be asked in the corresponding plugin support forum:

 

wpDiscuz Support Forum wpForo Support Forum

[Solved] Video preload

Page 1 / 3

Gary Yates
Posts: 26
Customer
Topic starter
(@gary-yates)
Member
Joined: 1 year ago

@kylew,

 

I've tried this and it's not working. I've cleared all cookies and cache. Is there a different way to accomplish this?

Topic Tags
20 Replies
Gary Yates
Posts: 26
Customer
Topic starter
(@gary-yates)
Member
Joined: 1 year ago

I noticed too late to delete my comment that this solution is for wpDiscuz. I found this answer by searching the forum for preload but I haven't been able to find a similar solution for wpForo. Is there a way to set all the videos in wpForo to preload=none?

 

P.S. I have Advanced Attachments

1 Reply
Kyle
 Kyle
Admin
(@kylew)
Joined: 3 months ago

Member
Posts: 88

@gary-yates,

Please put the following code in the current active theme functions.php file:

add_filter('wpforo_content_filter', function($content){
    return preg_replace('#(<video)(\s?[^<>]*?>)#iu', '$1 preload="none"$2', $content);
}, 99);

Don't forget to delete all caches and press CTRL+F5(twice) on the frontend before checking.

Also please note the code works only for the front-end

Gary Yates
Posts: 26
Customer
Topic starter
(@gary-yates)
Member
Joined: 1 year ago

@kylew

 

The preload attribute does not stay equal to none. Eventually, it always reverts back to metadata.

 

Thanks

1 Reply
Kyle
 Kyle
Admin
(@kylew)
Joined: 3 months ago

Member
Posts: 88

@gary-yates,

Can you provide an example with screenshots and links?

Gary Yates
Posts: 26
Customer
Topic starter
(@gary-yates)
Member
Joined: 1 year ago

@kylew,

 

What are you looking for screenshots and links of? The site is stbfitnesscenter.com if that helps. The code is in my active theme's functions.php file.

I posted the coding above:

add_filter('wpforo_content_filter', function($content){
return preg_replace('#(<video)(\s?[^<>]*?>)#iu', '$1 preload="none"$2', $content);
}, 99);

And after a while, I'm not sure exactly how long, the coding reverted back to what I believe is its default setting:

add_filter('wpforo_content_filter', function($content){
return preg_replace('#(<video)(\s?[^<>]*?>)#iu', '$1 preload="metadata"$2', $content);
}, 99);

Since I just changed the coding back to preload=none this morning, this is not an issue right now but it happened twice already and I believe it will happen again.

Gary Yates
Posts: 26
Customer
Topic starter
(@gary-yates)
Member
Joined: 1 year ago

I also just noticed another issue while checking the preload attribute. If you want me to post it as another topic just let me know. 

 

Once I fullscreen a video, then return the video to its normal size, the video is no longer visible. You can still hear the video playing in the background tho. You can use any of the videos here as an example... https://stbfitnesscenter.com/community/she-shed/test-jackie/

1 Reply
Tom
 Tom
Admin
(@tomson)
Joined: 7 years ago

Support Team
Posts: 3723

@gary-yates,

I see the problem comes from FitVids plugin, this plugin adds some wrapper div around wpForo videos, and it controls wpForo videos. All problems of wpForo videos come from this plugin. You should find a way to disable this plugin on forum pages or remove it totally. We don't support such conflicts, you should contact FitVids plugin developers and ask them an option to totally disable their plugin on certain pages.

2021 09 23 16 29 34
Page 1 / 3
Share:
Scroll to top