Skip to content

Commit

Permalink
fix: dynamic imports
Browse files Browse the repository at this point in the history
Thank you @gdamjan 

Rel: #211
  • Loading branch information
DiegoRBaquero committed Jan 4, 2022
1 parent 6ec4ca0 commit ad2f997
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,15 +464,15 @@ async function runDownload (torrentId) {
}

if (argv.airplay) {
const airplay = await import('airplay-js')
const airplay = (await import('airplay-js')).default

airplay.createBrowser()
.on('deviceOn', device => device.play(href, 0, () => { }))
.start()
}

if (argv.chromecast) {
const chromecasts = (await import('chromecasts'))()
const chromecasts = (await import('chromecasts')).default()

const opts = {
title: `WebTorrent - ${torrent.files[index].name}`
Expand Down Expand Up @@ -502,14 +502,14 @@ async function runDownload (torrentId) {
}

if (argv.xbmc) {
const xbmc = await import('nodebmc')
const xbmc = (await import('nodebmc')).default

new xbmc.Browser()
.on('deviceOn', device => device.play(href, () => { }))
}

if (argv.dlna) {
const dlnacasts = (await import('dlnacasts'))()
const dlnacasts = (await import('dlnacasts')).default()

dlnacasts.on('update', player => {
const opts = {
Expand Down

0 comments on commit ad2f997

Please sign in to comment.