capnmidnight / Calla

Virtual Meetups through Jitsi
https://www.calla.chat
MIT License
1.08k stars 77 forks source link

Variables not declared #111

Closed manang closed 3 years ago

manang commented 4 years ago

Hi, in a lot of files there are variables not declared. I found 3 variables in CallaClient.js https://github.com/capnmidnight/Calla/blob/2a6d97025810355a1a5d7324174226d3fb42f423/Calla/src/CallaClient.js#L917

maybe it is a typo.

what is the solution on this case?

other varaibles are in jquery.js lib: https://github.com/capnmidnight/Calla/blob/2a6d97025810355a1a5d7324174226d3fb42f423/Calla/lib/jquery.js#L10832 my solution is:

const define = typeof(define) == 'undefined' ? null : define;
if ( typeof define === "function" && define.amd ) {
    define( "jquery", [], function() {
        return jQuery;
    } );
}

I found other variables not declared: ambisonicOrder: https://github.com/capnmidnight/omnitone/blob/7a459630fce52797ff5b9d8725b1e71977d5d5a7/src/hoa-rotator.js#L350

mode: https://github.com/capnmidnight/omnitone/blob/7a459630fce52797ff5b9d8725b1e71977d5d5a7/src/foa-renderer.js#L127 https://github.com/capnmidnight/omnitone/blob/7a459630fce52797ff5b9d8725b1e71977d5d5a7/src/hoa-renderer.js#L125

options: https://github.com/capnmidnight/resonance-audio-web-sdk/blob/8a666fadf4209ea6d524ac6af0cdfcf1f86a4dd0/src/encoder.js#L213

can you tell me how I can solve this list of errors? in this way it is possible to import the lib inside a reactjs project, without disabling the errors in package.json thank you very much

capnmidnight commented 4 years ago

Thank you for finding these.

The one in Calla is indeed a typo. It should be all the parameters that are passed into the setLocalOrientation method. { x, y, z } needs to be { fx, fy, fz, ux, uy, uz }.

For jQuery, I'm not sure what to do. It's a dependency of lib-jitsi-meet, which is kind of annoying. I have a local copy of it in the repo to fix issues with not being able to get the standard version to work with ES Modules. So I would say, feel free to chop it up in any way that is necessary to fix it.

This ambisonicOrder one needs to be i <= this._ambisonicOrder.

The mode ones need to be this.getRenderingMode() === RenderingMode.BYPASS.

The options one needs to change options.ambisonicOrder to just ambisonicOrder.

If you don't mind, could you make these changes and submit a PR? My current copy of Calla for my VR project has a significant number of other changes. I'm 'working on integrating them now, but I'm not entirely sure how long that will take.

capnmidnight commented 4 years ago

The log from your other issue mentioned a bData variable. Were you able to find that one?

capnmidnight commented 4 years ago

Actually, scratch making a PR. I almost have the changes done myself.

capnmidnight commented 4 years ago

Ok, all the suggested fixes are in the latest master branch, with the fixes to Resonance and Omnitone.

manang commented 4 years ago

I was correcting, thank you.

manang commented 4 years ago

The log from your other issue mentioned a bData variable. Were you able to find that one?

https://github.com/capnmidnight/omnitone/blob/0d316149c5eed10678c4f8e63e3c4322a8016a45/src/buffer-list.js#L88

bdata, in the catch, is not available. It is inside in the body of "map".

capnmidnight commented 4 years ago

got it, it's available now

manang commented 4 years ago

thanks