kalwalt / jsartoolkit5

Javascript ARToolKit v5.x
https://kalwalt.github.io/jsartoolkit5/examples/
Other
44 stars 20 forks source link

FS is not defined in simple_video.html #16

Closed kalwalt closed 4 years ago

kalwalt commented 4 years ago

The simple_video.html fails with this error:

Uncaught ReferenceError: FS is not defined
    at writeByteArrayToFS (artoolkit.api.js:1914)
    at XMLHttpRequest.oReq.onload (artoolkit.api.js:1934)

not sure if i have to change a bit the example or someting in the code in artoolkit.api.js. Note that other examples, using the debug lib, fails because the omitted 'use strict' directive #14 . This should be fixed before meging it.

nicolocarpignoli commented 4 years ago

I think this example does not deserve this fix, I'd rather concentrate effort on other task and remove the example. What do you think?

kalwalt commented 4 years ago

I discovered that latest changes breaks other examples see: https://kalwalt.github.io/jsartoolkit5/examples/simple_rtc.html that worked... it fails at this line scope.Module = Module; added for the wasm + worker example :sob: The FS is not defined in simple_video.html i think could be solved but with the latest i have to make other tests.

kalwalt commented 4 years ago

I opened another issue #22 to keep track of this.

kalwalt commented 4 years ago

This issue can be solved wrapping all the code in a setTimeout function see this gist I will apply this fix as the test PR https://github.com/kalwalt/jsartoolkit5/pull/21 will be merged.

nicolocarpignoli commented 4 years ago

this can be a problem instead, because this example is one 'out' of the NFT scope.

kalwalt commented 4 years ago

this can be a problem instead, because this example is one 'out' of the NFT scope.

What do you mean in specific? Because the code is wrapped in the setTimeout function? This issue affect only this example with the debug library not other examples.

nicolocarpignoli commented 4 years ago

No I meant we have to be sure to not break other artoolkit feature like fiducial markers detection. Ok for the fix using setTimeout. We should check if we are not breaking anytjing else anyway. Maybe check if all other examples are working?

nicolocarpignoli commented 4 years ago

If the bug is only on that example, and the others are working and most of all this occurs only with the debug version, I think we should not consider this as a problem

kalwalt commented 4 years ago

If the bug is only on that example, and the others are working and most of all this occurs only with the debug version, I think we should not consider this as a problem

No it shouldn't be a problem. The problem occur only for some of the examples that use the debug version of jsartoolkit5 lib. I will check again when will be merge the PR with the tests #21

kalwalt commented 4 years ago

This is fixed with the latest commit https://github.com/kalwalt/jsartoolkit5/commit/c6f3d571a60fbfe27333a1fe3241b3650b7ffbd0 closing the issue.