V
V
Vlad ~2020-04-13 16:16:21
css
Vlad ~, 2020-04-13 16:16:21

Why does the video start every other time?

There is a video on the site that the user sees only once when he enters the site for the very first time did it like this

const cookieEl = document.querySelector('.privacy');


let cookies = () => {
    if (!Cookies.get('hide-cookie')) {
        setTimeout(() => {
            cookieEl.style.display = 'block';

        }, 100);
    }

    Cookies.set('hide-cookie', 'true', {
        expires: 30
    });
}

console.log( document.cookie );

cookies();


here is the html code how to embed the video
<video autoplay="" preload="" loop="">
      <source src="img/video/Opening-PC.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
  			<source src="img/video/Opening-PC.webm" type='video/webm; codecs="vp8, vorbis"' />
  			Video tag not supported. Download the video <a href="img/video/Opening-PC.webm">here</a>.
    </video>

this video works every other time sometimes everything is ok, and sometimes just a black screen

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2020-04-13
@HistoryART

I'm certainly not an expert, but something is clearly wrong in this line)

<source src="movie.ogv" type='img/video/Opening-PC/ogg; codecs="theora, vorbis"' />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question