phoboslab / jsmpeg

MPEG1 Video Decoder in JavaScript
MIT License
6.38k stars 1.43k forks source link

Help!! I'm trying to display more than one canvas #153

Open oussamaabbas opened 7 years ago

oussamaabbas commented 7 years ago

by mixing the the jsmpeg call script with php and it works, but not for more than 9 canvas, if I choose to display 10 canvas the first one will disappear and WebGL error appears saying : WARNING: Too many active WebGL contexts. Oldest context will be lost. WebGLRenderer.IsSupported @ jsmpeg.min.js:3 jsmpeg.min.js:2 WARNING: Too many active WebGL contexts. Oldest context will be lost. WebGLRenderer @ jsmpeg.min.js:2

<?php $lin = 4; $col = 4; $streamport=8082;?>

<?php
$x=1;$y=1;$left="0px";$top="";

function drawCam($iTop, $iLeft,$canvas_ID) { $top = ($iTop240)."px"; $left = ($iLeft320)."px";

echo "<canvas id='$canvas_ID' style='margin-left: 0;
width: 320px;
height: 240px;
position: fixed;
left: $left;
margin: 0px;
padding: 0px;
top: $top;'></canvas>
<script type='text/javascript'>
    var streamport=8082;
    loadvideo('#$canvas_ID',streamport);
</script>
";

} for ($i=0; $i < $lin; $i++) {
for ($j=0; $j< $col; $j++) { $canvas_ID="video-canvas".$i.$j; drawCam($i,$j,$canvas_ID); } } ?>

Githubissues.
  • Githubissues is a development platform for aggregating issues.