Closed Invius closed 4 years ago
It is an open bug. On the file system-arjs.js
//////////////////////////////////////////////////////////////////////////////
// Code Separator
//////////////////////////////////////////////////////////////////////////////
// TODO this is crappy - code an exponential backoff - max 1 seconds
// KLUDGE: kludge to write a 'resize' event
var startedAt = Date.now()
var timerId = setInterval(function () {
if (Date.now() - startedAt > 10000 * 1000) {
clearInterval(timerId)
return
}
// onResize()
window.dispatchEvent(new Event('resize'));
}, 1000 / 30)
This snippet is a bad trick that triggers a resize event multiple times per seconds. It has to be removed. I tried long time ago to do that, listening to the browser 'resize' event but it is not enough, for some reason.
moved this issue in new AR.js repository: https://github.com/AR-js-org/AR.js/
I used jquery to try and size the video component that it generated from the a-scene, and it changes the value from the component, but i think that ar.js is triggering on resize event to ajust back to the window size. I've tried to change the arjs attribute but nothing happens. Is there a way to set a fixed size, instead of having it full screen/window sized? Or is this a bug from the framework?
I have reported this also to: a-frame And redirected to this git:
<a-scene embedded arjs='sourceType: webcam; sourceWidth: 600; sourceHeight: 400; displayWidth: 600; displayHeight: 400; canvasWidth: 600; canvasHeight: 400; debugUIEnabled: false;' >