Hello

Embedded video on the site:

<video autoplay id="bgvid" loop> <source src="videos/medoff-video.webm" type="video/webm"> <source src="videos/medoff-video.mp4" type="video/mp4"> </video> 

In Mozilla, it works as it should, but Chrome does not understand the loop and does not play the video from the beginning to its end.

I read that the problem is:

Yours is “200 OK” response, but it should not be sending “206 Partial Content”

But did not quite understand what it means.

What is the solution to this problem?

thank

    1 answer 1

    Chrome will play it only if the video responds to the video status 206 .
    This code says that it returned only a part of the requested one and you need to apply again for the addition using the Range header ( what is this? ).


    But you can do without this small hack:

     document.querySelector('video').addEventListener('ended', function(){ this.load(); this.play(); }); 

    Looked over here .

    • Thanks for the answer. Your example did not work, but by clicking on the link “podgyaldel here” earned an example - Nikita Shchypylov
    • @ Nikita Schipilov, this is the use of indicating the source! I just forgot to put a point, now it will work. - user207618
    • I'm not so stupid and I put a point) But yours did not work - Nikita Shchypylov
    • @ Nikita Schipilov, and also in addEventListener does not require an on prefix. - user207618 pm