Tagged: LayerSlider, video
-
AuthorPosts
-
September 9, 2016 at 1:29 pm #684161
A video in the slide #4 works fine. After starting the video by clicking it, the slideshow pauses its automatic rotation.
But I have also a big “start video”-button at slide #1. This button leads to slide #4 and starts the video with the DOM play() method. In this case the slideshow continues its autorotation.
Can I pause or stop the slideshow wth some extra code?
Regards,
GünterSeptember 11, 2016 at 6:57 am #684664Hi Günter,
Could you post a link to the site in question so that we can take a closer look please?
Best regards,
RikardSeptember 11, 2016 at 1:45 pm #684752Hi Rikard,
just in case I have created an admin account for you.
Meanwhile I have tried $(‘#layerslider_1’).layerSlider(‘stop’); from LayerSllider documentation, but it does not work. If you need, you will find everything including the function playVid() at the template front-page.php in my child theme.
Regards,
GünterSeptember 11, 2016 at 10:53 pm #684820Hi Rikard,
my problem is solved! I know a little bit javascript, but zero jquery. I think it was a simple syntax problem. Now I added this script to the play button:
<script type="text/javascript"> function playVid() { vid = document.getElementById("myVideo"); vid.play(); setTimeout(stopSlideshow, 3000); } function stopSlideshow() { (function($) { $("#layerslider_1").layerSlider("stop"); })(jQuery); } </script>
and it works.
Thank you,
GünterSeptember 13, 2016 at 6:59 am #685524Hi Günter,
Great, glad you got it working and thanks a lot for sharing :-)
Please let us know if you should need any further help on the topic.
Best regards,
RikardSeptember 13, 2016 at 9:39 am #685601Hi Rikard,
if someone needs to solve a similiar problem, with
<video onended="startSlideshow()" id="myVideo" (...) >
and<script type="text/javascript"> function startSlideshow() { (function($) { $("#layerslider_1").layerSlider("start"); })(jQuery); } </script>
you can start the slideshow again, when the video has finished.
Best regards,
GünterSeptember 14, 2016 at 8:01 am #686183 -
AuthorPosts
- You must be logged in to reply to this topic.