-
AuthorPosts
-
September 7, 2023 at 4:11 am #1418318
Hi
I couldn’t find anything about this from the past few years.
I want to use the video element because I can use a cover image but related videos show at the end, which I don’t want.
Here is a page with the simple link on top and the video element below. The both have the exact same url with ?rel=0. The simple link have no related videos and the video element does.
Several years ago the video element disabled related videos by default if I remember correctly.
Thank you for any suggestions that would allow me to use the video element without related videos
DavidSeptember 7, 2023 at 7:49 pm #1418397Yes – thats only a matter of youtube (Google) settings. In the past, it was possible to prevent various things by adding an attachment to the video url. They have decided not to allow this any more.
z.B.:
https://www.youtube.com/embed/1YQ8iP0DiUk?autoplay=1
So the Google people decided to patronise their users even more. i didn’t find anything on https://developers.google.com/youtube/iframe_api_reference.
I really do wish that I was wrong about all this.
September 7, 2023 at 8:29 pm #1418398Thank you for this, but please have a look at the link I sent:
https://adoptionvoicesthebook.com/video-test/
I was able to prevent the recommended videos by pasting the link into the page with ?rel=0 at the end.
That is the first video on the page and it does NOT show related videos at the end.
The enfold video element with the same url DOES show related videos at the end.
I would like to use the enfold element because I can use a cover image.So it is indeed something that can be prevented with normal embeds but not with the enfold element
Thanks again
DavidSeptember 7, 2023 at 8:33 pm #1418399OK – i did not know that it still works – but you had to go the way over embed then. Nice
September 7, 2023 at 8:57 pm #1418401This is how the first video on the page is done:
Is there anything I can add to get the enfold video element to do the same thing?
Thank you!
September 8, 2023 at 1:27 pm #1418462Hi,
Thank you for the update.
This is possible but you may have to modify the enfold/config-templatebuilder/avia-shortcodes/video/video.php file directly. The query parameters for Youtube videos are located around line 651.
$params[] = 'autoplay=' . $video_attributes['autoplay']; $params[] = 'loop=' . $video_attributes['loop']; $params[] = 'controls=' . $video_attributes['controls']; $params[] = $youtube ? 'mute=' . $video_attributes['muted'] : 'muted=' . $video_attributes['muted'];
You can append the rel parameter by adding this line.
$params[] = 'rel=0';
Best regards,
IsmaelSeptember 8, 2023 at 5:50 pm #1418495but please if it is possible this should be default setting !!!
And perhaps only a checkmark if you realy need that.But if i inspect the DOM before that change – f.e. on autoplay even there – no parameters were set at the url
just that f.e.src="https://www.youtube.com/embed/G0k3kHtyoqc?feature=oembed"
no autoplay=1 is set to the url etc. – with the changes above – no rel=0
PS: on sliders there are those $video_data’s going to the output of the video url:
September 8, 2023 at 11:51 pm #1418515That worked! Thank you Ismael.
The only problem is that I can’t put that in the child theme.
I second what Guenni007 said about making it default. Especially since I can’t put the solution in the child theme. I’m sure that it was default a few years ago. This really matters to so many of my clients – that the related videos don’t show at the end.
Thanks again
DavidSeptember 9, 2023 at 12:35 am #1418516put this to your child-theme functions.php:
(see on docu: https://kriesi.at/documentation/enfold/intro-to-layout-builder/#customization )function avia_include_shortcode_template($paths){ $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; } add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
and copy that edited video.php to that folder : shortcodes
September 15, 2023 at 9:45 pm #1419313Perfect! Thank you, Guenni007!
That is great to know about and it worked!September 16, 2023 at 11:20 am #1419326Hi,
Great, I’m glad that @guenni007 could help you out :-)
Please let us know if you should need any further help on the topic, or if we can close it.
Best regards,
Rikard -
AuthorPosts
- You must be logged in to reply to this topic.