Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
In the Safari browser, the script restarts, but does not play video on the event

Got bumped with a problem, maybe someone can help me with it.

There is a script that should restart and play a video on an event ( play video.play(); ). On other browsers like Chrome etc. it works, except Safari.

On Safari it just resets the video to 0, but doesn't play it.

Seems like video.play() doesn't work on that browser.

Autoplay and mured are on.

Has anyone had this problem?

Here is the website https://luna-wealth-3b31bac5f1f8e980696881bf9d5.webflow.io/client-online-access

<script>
  window.addEventListener('DOMContentLoaded', function () {

    const video = document.getElementById("573dfe8f-6592-57e6-c48c-8e93fbdae2e3-video");
    const trigger = document.getElementById("trigger");
    const observerVideo = new IntersectionObserver((entries) => {
      if (entries[0].isIntersecting) {
        if (video.currentTime === 0) {
          video.muted = true;
          video.play();
        }
      }
    }, { threshold: 1 });

    const observerTrigger = new IntersectionObserver((entries) => {
      if (entries[0].isIntersecting) {
        if (video.currentTime !== 0) {
          video.currentTime = 0
        }
      }
    }, { threshold: 0 });

    observerTrigger.observe(trigger);
    observerVideo.observe(video);
  })
</script>
almost 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The problem was solved this way. We removed the 100% width parameter from the video and set the container that contains the video to flex justify-center. And the script started playing the video on Safari correctly.

At some resolutions the video stretched beyond its real resolution and Safari did not want to replay it in the event...

Of course it was strange, but it worked =)

almost 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!