Flashing images in Chromium 61

The page connects through the WebSocket to the server and requests a constantly changing frame of the broadcast webcam:

<script>
    function Initialize(){
        var Screen = document.createElement('img');
        Screen.onload = function(){URL.revokeObjectURL(Screen.src);};
        document.body.appendChild(Screen);
        var Rate = 50;
        var Preload = new Image();
        var Request = 'GetFrame';
        var Socket = new WebSocket(<?php echo $host;?>);
        Socket.onopen = function(){Socket.send(Request);};
        Socket.onmessage = function(event){
            if (Preload.src.length > 0){Screen.src = Preload.src;}
            Preload.src = URL.createObjectURL(event.data);
            setTimeout(function(){Socket.send(Request);},Rate);
        };
    }
</script>
...
<body onload="Initialize();"></body>

In ordinary Chrome, in Firefox and IE, images smoothly change like a video, even without it Preload- simply Screen.src = URL.createObjectURL(event.data). And in the version of Chromium 61 that clients insist on, frames flash at boot!

Is it possible to fix this blinking in Chromium 61?

+4
source share

Source: https://habr.com/ru/post/1681433/


All Articles