Tagged: autoplay, easy slider, video
-
AuthorPosts
-
November 27, 2017 at 4:30 pm #882267
Hi,
At the website of Huize te Gaste we had to publish a video, but it had not to auto-play.
I found out that when I use the Avia Video option, the video will auto-play, so I looked at various topics in the forum how to not auto-play a video and found a solution to use an Easy Slider where you can set the video to not auto-play.
However, I just noticed that a video in an Easy Slider will not be shown on tablet and mobile (see home page). And it should…
Since I learned that video will not auto-play on tablet and mobile anyway, I thought to be clever and created a test page (see link below) where I used in the same column:
- (1) Easy Slider with a video, with screen options > element hidden on medium, small and very small screens.
- (2) Video element, with screen options > element hidden on large screens.
I thought this would solve the problem…
However, now when you open the (test) page on a large screen, you will only see the video from the Easy Slider, but you can HEAR the video from the video element.
What solution is there to stop the sound of the video in video element to auto-play?
Or what other solution is there to present a video on the site without it immediately starts to play when the page is opened?Thanks for your advise.
Kind regards,
MoniquePS: the < ol > option in this forum is not working properly…
November 30, 2017 at 12:17 pm #883354Hey Monique,
Thank you for using Enfold.
The video element should not autoplay by default. Why did you add the “ava_iframe_parameters” function in the functions.php file?
Best regards,
IsmaelFebruary 21, 2018 at 3:07 pm #915488Hi Ismael,
Sorry for my late reply. Picking up a few old pending issues :p
I looked into this again. I am not sure why I put the “ava_iframe_parameters” function in the functions.php file. Maybe because I thought I could make changes to the autoplay. The autoplay (or in fact not autoplay) seems to work fine now.
One more issue though. I have now moved the avia layout of the test page (as mentioned above) to the home page:
(1) Easy Slider with a video, with screen options > element hidden on medium, small and very small screens.
(2) Video element, with screen options > element hidden on large screens.For 2) video element (used on medium, small en very small screens) the video stops showing a You Tube grid for other video’s. Is it possible also to show here the thumb/image of the video instead?
Thanks & regards,
MoniqueFebruary 21, 2018 at 8:42 pm #915677Hi,
Yes it is possible.
here is how you can add an image based on the URL / ID of youtube.Each YouTube video has 4 generated images. They are predictably formatted as follows:
https://img.youtube.com/vi/
/0.jpg
https://img.youtube.com/vi//1.jpg
https://img.youtube.com/vi//2.jpg
https://img.youtube.com/vi//3.jpg The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:
https://img.youtube.com/vi/
/default.jpg For the high quality version of the thumbnail use a url similar to this:
https://img.youtube.com/vi/
/hqdefault.jpg There is also a medium quality version of the thumbnail, using a url similar to the HQ:
https://img.youtube.com/vi/
/mqdefault.jpg For the standard definition version of the thumbnail, use a url similar to this:
https://img.youtube.com/vi/
/sddefault.jpg For the maximum resolution version of the thumbnail use a url similar to this:
https://img.youtube.com/vi/
/maxresdefault.jpg All of the above urls are available over http too. Additionally, the slightly shorter hostname i3.ytimg.com works in place of img.youtube.com in the example urls above.
Alternatively, you can use the YouTube Data API (v3) to get thumbnail images.
Best regards,
BasilisFebruary 21, 2018 at 10:58 pm #915755Hi Basilis,
Thanks you for your extensive reply. I am not certain though that this is an answer to my question. Perhaps I have not been clear enough? See also my explanation here above. I had to create two ways in order to properly show the video:
(1) Easy Slider with a video, with screen options > element hidden on medium, small and very small screens, so used for showing on large screens.
(2) Video element, with screen options > element hidden on large screens, so for showing on medium, small and very small screens.(1) shows the video-image after it’s finished, (2) shows the You Tube grid at the end. We also want for (2) to show the image.
As far as I’m concerned I should not have to do something with the You Tube video itself, should I? As a matter of fact I don’t even have access to the You Tube video itself.
Since the image is shown for (1), my conclusion is that there is something in the code of Enfold that makes (2) to have a different ending. And I was hoping you could give me a work around to “fix” this.
Please advise.
Regards,
MoniqueFebruary 26, 2018 at 4:27 am #917655Hi,
Are you referring to the related or suggested items at the end of the video? I think that’s why you have the “ava_iframe_parameters”.
add_action('wp_footer', 'ava_iframe_parameters'); function ava_iframe_parameters(){ ?> <script> (function($){ function avia_iframe_parameters_mod(container) { var iframe = $('iframe[src*="youtube.com"]', container), youtubeEmbed = $('iframe[src*="youtube.com"] object, iframe[src*="youtube.com"] embed', container).attr('wmode','opaque'); iframe.each(function() { var current = $(this), src = current.attr('src'); if(src) { if(src.indexOf('?') !== -1) { src += "&autoplay=1&showinfo=1&rel=0"; } current.attr('src', src); } }); } avia_iframe_parameters_mod('body'); })(jQuery); </script> <?php }
This is the previous thread.
// https://kriesi.at/support/topic/question-about-using-video-for-featured-media/
Best regards,
IsmaelMarch 1, 2018 at 10:18 am #919506Hi Ismael,
The previous thread you mentioned was for a site based on Sentence theme. I don’t know whether that makes a difference?
That having said I also think I’ve used that code to try if that work for this website too. And it works for large screens we I have used option (1). However, it does not work the same way for smaller screens where I have used option (2).
Any more suggestions to have the poster image also when using option (2)?
Thanks & regards,
MoniqueMarch 2, 2018 at 10:57 am #920213Hi,
Thank you for the update. Are you using the same video for both elements? Please check the login credentials above. They’re not working, unfortunately.
Best regards,
IsmaelMarch 9, 2018 at 12:37 pm #924452Hi Ismael,
Sorry for the missing login credentials. Please find new ones below.
Yes, I am using the same video in both options.
I wonder… I noticed in the Enfold change log of 2018 March 1st – Version 4.2.5
– improved: we try to hide related youtube videos by defaultHas this to do with my issue too? In that case updating Enfold from 4.2.4 to 4.2.5 would perhaps solve this issue? Let me do that first and I’ll come back to you thereafter if the problem still exists or not.
Have a nice weekend,
MoniqueMarch 14, 2018 at 7:26 am #926446Hi,
– improved: we try to hide related youtube videos by default
Yes, it’s included in the “avia_iframe_fix” function inside the js > avia.js file. Please let us know if it helps.
Best regards,
IsmaelMarch 14, 2018 at 11:17 am #926545Hi Ismael,
Thanks, yes that worked!
Would you advise me to delete the “ava_iframe_parameters” from functions.php? Or would that not cause any harm?
You may flag this topic as closed now. Thanks a lot for your help!
Regards,
MoniqueMarch 15, 2018 at 6:28 am #927065 -
AuthorPosts
- The topic ‘Video not to autoplay’ is closed to new replies.