Tagged: ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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ünter

    #684664

    Hi Günter,

    Could you post a link to the site in question so that we can take a closer look please?

    Best regards,
    Rikard

    #684752

    Hi 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ünter

    #684820

    Hi 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ünter

    #685524

    Hi 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,
    Rikard

    #685601

    Hi 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ünter

    #686183

    Hi Günter,

    Great, thanks for sharing that, much appreciated :-)

    Regards,
    Rikard

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.