X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2Fvideo-watch%2Fwebtorrent.service.ts;h=211894bfd3e546559c13955745d9fc957a29b7de;hb=8b13c289f8db1666a3970882797d42f6cfd6128b;hp=8936e79925f4daa5f02c7c2fc6dfb1e512eb7472;hpb=294f80f21e8a77d25f6fb5f0f26887fb4618ee2e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/videos/video-watch/webtorrent.service.ts b/client/src/app/videos/video-watch/webtorrent.service.ts index 8936e7992..211894bfd 100644 --- a/client/src/app/videos/video-watch/webtorrent.service.ts +++ b/client/src/app/videos/video-watch/webtorrent.service.ts @@ -1,33 +1,33 @@ -import { Injectable } from '@angular/core'; -import { Subject } from 'rxjs/Subject'; +import { Injectable } from '@angular/core' +import { Subject } from 'rxjs/Subject' -import * as WebTorrent from 'webtorrent'; +import * as WebTorrent from 'webtorrent' @Injectable() export class WebTorrentService { - errors = new Subject(); - warnings = new Subject(); + errors = new Subject() + warnings = new Subject() // TODO: use WebTorrent @type - // private client: WebTorrent.Client; - private client: any; + // private client: WebTorrent.Client + private client: any - constructor() { - this.client = new WebTorrent({ dht: false }); + constructor () { + this.client = new WebTorrent({ dht: false }) - this.client.on('error', (err) => this.errors.next(err)); - this.client.on('warning', (err) => this.warnings.next(err)); + this.client.on('error', (err) => this.errors.next(err)) + this.client.on('warning', (err) => this.warnings.next(err)) } - add(magnetUri: string, callback: Function) { - return this.client.add(magnetUri, callback); + add (magnetUri: string, callback: Function) { + return this.client.add(magnetUri, callback) } - remove(magnetUri: string) { - return this.client.remove(magnetUri); + remove (magnetUri: string) { + return this.client.remove(magnetUri) } - has(magnetUri: string) { - return this.client.get(magnetUri) !== null; + has (magnetUri: string) { + return this.client.get(magnetUri) !== null } }