Closed nebucaz closed 3 years ago
I believe you are right about that. I found this issue in the PeerJS repo.
It suggests using window.peerjs.util
or just peerjs.util
.
Thanks for the suggestion, but none of them seem to work. Would it be possible to expose it explicitly in vue-peer/src/index.js
(sorry, I'm not familiar with creating Vue/NPM Modules, just an idea).
export default {
install(Vue, peer, options) {
if (!isPeerJS(peer)) {
throw new Error('[vue-peerjs] you have to pass a 'Peer' instance to the plugin');
}
Observe(peer, options);
// eslint-disable-next-line no-param-reassign
Vue.prototype.$peer = peer;
--> here
}
This package is just a wrapper around peerjs. So it's unable to import (and thus expose) the util object for the same reasons you are. I'm sorry about that.
Second try:
console.log(window.peerjs.util.browser);
now seems to work. Thanks
How can we access peer's util object from Vue? As far as I can see, it's not exported.