Open ghost opened 5 years ago
you can‘’t use import
module syntax to use sipml5. you should use <script>
in the root.
Put the code inside the index.html and use window.XXX to call the methods from the API.
Like @RicardoSouzaMoura said, just import const SIPml = window.SIPml;
and you can use it without problem.
Hello,
I am building a web app using reactJS and I want to add audio and video functionality to it. I added sipml5 package using yarn, but when I initialized the engine like so:
import SIPml from 'sipml' export default class AppContainer extends Component { constructor(props) { super(props); this.state = { registerSession: null, callSession: null, sipStack: null }; SIPml.init(this.ready, this.error).bind(this); }
I get the error:
TypeError: __WEBPACK_IMPORTED_MODULE_7_sipml___default.a.init is not a function new AppContainer src/components/app/AppContainer.js:41 38 | callSession: null, 39 | sipStack: null 40 | };