js/reactjs product to interface with a janus webrtc gateway. I'm trying to use the janus.js library provided in the meetecho janus-gateway sourcecode as I know that:
A: This library will check whether the browser is compatible with Janus. B: This library is maintained by the core team and kept up to date.
So I know I'm already going to have to give up JSX and use either jQuery or standard JavaScript to manipulate an empty provided by react.
I just need to know how to import scripts that are designed to be imported via a script tag in html, that in itself also has dependancies. Preferably I'd be attempting to not load it on every page of the website, by using a stub index.html file. The project is getting quite large and heavy as is.
Worst comes to worst I'll just have to use one of the other API's (Such as meetecho's restful API) and check browser compatibility myself. But I'd rather not repeat all that work if I don't have to. And also not have to try to work out how webrtc connections work this early in the prototyping stage.
Just trying to get the jQuery dependancy to work first:
//import $ from '../Api/janus/jquery.min.js';
//import $ from 'jquery';
//import jQuery from 'jquery';
//import adapter from 'webrtc-adapter';
const jQuery = require('jquery');
import {Janus as JanusAPI} from "../Api/janus/janus.js";
Error Log:
./src/Api/janus/janus.js
Line 55: 'error' is not defined no-undef
Line 56: 'error' is not defined no-undef
Line 57: 'error' is not defined no-undef
Line 98: 'adapter' is not defined no-undef
Line 161: 'jQuery' is not defined no-undef
Line 167: 'adapter' is not defined no-undef
Search for the keywords to learn more about each error.