KayleePop / vue-magnet

Adds a magnet attribute which acts like src but for torrent magnet links.
MIT License
4 stars 2 forks source link

Use webtorrent-hybrid instead of webtorrent #10

Open SrPatinhas opened 5 years ago

SrPatinhas commented 5 years ago

If this component used this webtorrent-hybrid it would have more compatibility

KayleePop commented 5 years ago

I'm not sure about the use case, but I think you could do this:

const Vue = require('vue')
const WebTorrent = require('webtorrent-hybrid')
const VueMagnet = require('vue-magnet')

Vue.WebTorrent = new WebTorrent()

Vue.use(VueMagnet)

Vue-magnet uses Vue.WebTorrent if it's defined instead of creating a new instance during installation. If Vue.Webtorrent is a webtorrent-hybrid instance, then everything should work as expected because it has the same API as webtorrent.