diff options
Diffstat (limited to 'client/src/app/videos/video-watch/webtorrent.service.ts')
-rw-r--r-- | client/src/app/videos/video-watch/webtorrent.service.ts | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/client/src/app/videos/video-watch/webtorrent.service.ts b/client/src/app/videos/video-watch/webtorrent.service.ts index 211894bfd..8819e17d4 100644 --- a/client/src/app/videos/video-watch/webtorrent.service.ts +++ b/client/src/app/videos/video-watch/webtorrent.service.ts | |||
@@ -5,21 +5,17 @@ import * as WebTorrent from 'webtorrent' | |||
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class WebTorrentService { | 7 | export class WebTorrentService { |
8 | errors = new Subject<Error>() | 8 | errors = new Subject<string | Error>() |
9 | warnings = new Subject<Error>() | ||
10 | 9 | ||
11 | // TODO: use WebTorrent @type | 10 | private client: WebTorrent.Instance |
12 | // private client: WebTorrent.Client | ||
13 | private client: any | ||
14 | 11 | ||
15 | constructor () { | 12 | constructor () { |
16 | this.client = new WebTorrent({ dht: false }) | 13 | this.client = new WebTorrent({ dht: false }) |
17 | 14 | ||
18 | this.client.on('error', (err) => this.errors.next(err)) | 15 | this.client.on('error', err => this.errors.next(err)) |
19 | this.client.on('warning', (err) => this.warnings.next(err)) | ||
20 | } | 16 | } |
21 | 17 | ||
22 | add (magnetUri: string, callback: Function) { | 18 | add (magnetUri: string, callback: (torrent: WebTorrent.Torrent) => any) { |
23 | return this.client.add(magnetUri, callback) | 19 | return this.client.add(magnetUri, callback) |
24 | } | 20 | } |
25 | 21 | ||