Hello Jose.
This plugin seems to be what I’m looking for. But it will need some tweaking to work with my setup.
I use classic editor.
When I copy a YouTube link on it, it’s automatically picked up and embedded. This is seen on both back end editor and front end.
I would need to first have a function/snippet that completely disable this feature. No longer loading any of the assets WP uses for embedding.
(Maybe your plugin already does this?)
Second, I would need a code snippet to automatically add your short code to all YouTube links in the content. So I don’t have to manually type it every time. It will also take care of old links. Something like this:
function modify_youtube_links($content) {
$pattern = '/https:\/\/www\.youtube\.com\/watch\?v=([a-zA-Z0-9_-]+)/';
$replacement = '<p>[load_video_on_click link="https://www.youtube.com/watch?v=$1"]</p>';
$content = preg_replace_callback($pattern, function($matches) use ($replacement) {
return preg_replace('/\$1/', $matches[1], $replacement);
}, $content);
return $content;
}
add_filter('the_content', 'modify_youtube_links');
I hope to hear from you to see if I’m in the right track and what’s your opinion on this.
]]>Hello,
I am embedding a couple of videos on my website using the shortcode ?[load_video_on_click] I’m using an image_placeholder to load the video on click. But I need to add the dimensions of the video to avoid CLS issues. How do I add the dimensions (width & height) of the video to the shortcode?
Thank you for your answer in advance,
]]>Hello,
I found your plugin while looking for a solution to load two videos on click. Your plugin is great for displaying videos and not harm performance. You can see one of them here: https://mayangateway.com/#about
I have hosted both videos in BunnyCDN. I’m using the shortcode [load_video_on_click] with an image_placeholder using the link of the image. And as you can see it seems to be working well on desktop. However, I found two issues:
1. When I add the video using the shortcode, it still takes a lot of space on my server even though, I am hosting the videos in BunnyCDN.
2. One needs to click two times to make the video work on iPhones and iPads (and I guess in all other mobile devices?)
Would you please let me know if I’m missing something or if I’m doing something wrong?
Thank you in advance for your assistance.
]]>Cannt get it work with oxygen builder. Anyone tried it?
]]>Ciao, il numero dei video visualizzabili su ogni pagina è al massimo 1? se inserisco più video viene mostrato solo quello più in alto nella pagina, gli altri non compaiono. Grazie
]]>Ciao, come posso far visualizzare l’immagine place holder del video?
]]>