Reputation: 1580
Problem:
Loading commonjs module in electron app and using it in the renderer code.
import './subc/simplewebrtc.3.1.0.js'
import './subc/adapter-8.2.2.js'
import './subc/simplewebrtc-mf.js'
// Above imports expose simplewebrtc
webrtc = new SimpleWebRTC({
target: streamKey,
url: "https://" + address,
autoRequestMedia: true,
debug: false,
detectSpeakingEvents: false,
autoAdjustMic: false,
media: { video: false, audio: false }
});
Error: Uncaught ReferenceError: SimpleWebRTC is not defined
https://gist.github.com/shayanc/9f29ad57b028a8168e14692b45ed5767/revisions
Code works fine when running dev but not does work when you build an executeable (I'm assuming dev instance is running in some kind of browser version where the dist version is node.js.
I tried importing in main and preload but can't get it to work (also played around with nodeIntegration and code isolation options but no help).
Any pointers would be much appreciated.
Upvotes: 0
Views: 29