AI Assistant
Notifications
Clear all

Video preload

2 Posts
2 Users
0 Reactions
1,905 Views
Posts: 4
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
(@igork82)
New Member
Joined: 5 years ago
[#6682]

Hi guys!

How to set the video html tag preload to none?

Thanks!


1 Reply
Elvina
Posts: 1403
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
(@elvina)
Support
Joined: 7 years ago

Hi @igork82,

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

add_filter("wpdiscuz_after_read_more", function ($content) {
return preg_replace('~(<video[^>]*)>~is', "$1preload='none'>", $content);
}, 999);

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


Reply
Share:
Scroll to top