Okay
  Public Ticket #1307924
Play Video only when in viewport
Closed

Comments

  • cormip started the conversation

    I have a simple, single-slide slider with a video layer and an animated text layer above it. The animated text does begin playing only when entering the viewport like I specified, however, the video layer is already playing by the time I see it in the viewport. The video is also looping when I want it to play only once. The slider itself is not looping, only the video.

    1. How do I get the video to start playing only when entering the viewport?

    2. How do I stop the video from looping? The "loop" attribute of the video tag is NOT set.

  • [deleted] replied

    Hello cormip,

    To achieve the effects that you're looking for, you will have to add the video as a normal layer and not as a background. This way it will not loop, won't start without viewport, but you can still mute it if you want. You can also make it fullsized without setting it as a background, simply by entering 100% to the width and hight fields, so it will follow up on the slider's size changes.

  • cormip replied

    Adding the video as a normal layer and making it full-sized got me closer to the effect I want. However, despite the fact that I have the overall slider VIDEO / AUDIO "Automatically Play Media" setting set to disabled/off, the video still starts playing at page load. When I scroll down to the viewport, I can see the video has already started playing, but it restarts from the 1st frame (on entering the viewport) and plays the video without looping as desired.

    If I can get rid of that video "restart" on entering the viewport, that will have solved all the issues. My video tag is simply:

    <video width="100%" height="100%">
        <source src="/wp-content/uploads/doft-rosa.mp4" type="video/mp4">
    </video>

  •   cormip replied privately
  • [deleted] replied

    Thank you. We can see and reproduce the issue on your site. However if we try to use the same video with the same settings on our test site, the error does not occur. So we believe that there is a localized reason for this behavior on your installation.

    Could you please try to temporary switch to a default WP theme and disable other plugins to see if that helps ? It's possible that a 3rd party item is interfering with it.