Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client.seed callback not called when tab is not focused. #1796

Open
LucCADORET opened this issue Dec 27, 2019 · 0 comments
Open

client.seed callback not called when tab is not focused. #1796

LucCADORET opened this issue Dec 27, 2019 · 0 comments

Comments

@LucCADORET
Copy link
Contributor

@LucCADORET LucCADORET commented Dec 27, 2019

Hi, I am using the WebTorrent Browser version in an Angular app.

From a web-torrent.service.ts, I have a function

  startTorrent(callback: any) {
    this.client = new WebTorrent();
    this.client.seed(this._filesToSeed, (torrent) => {
      this._magnet = torrent.magnetURI;
      callback(torrent)
    });
  }

This function is called from a component, simply like that:

this.webTorrentService.startTorrent(onTorrent)

It turns out that my callback 'onTorrent' is never triggered when the browser tab is not in focus. It will be triggered only when the tab gets the focus again. Is it a normal behavior ?

The issue appears in both firefox and chrome.

I couldn't build a gist to reproduce the error, since there's an error with the client.seed method when you use webtorrent.min.js as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.