aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-watch/webtorrent.service.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-06-03 22:08:03 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-06-03 22:08:03 +0200
commit4a6995be18b15de1834a39c8921a0e4109671bb6 (patch)
treeb659661cea33687fcc6bd8fc2251cb7a15ab9f9d /client/src/app/videos/video-watch/webtorrent.service.ts
parent468892541175f9662f8b1b977e819dc1a496f282 (diff)
downloadPeerTube-4a6995be18b15de1834a39c8921a0e4109671bb6.tar.gz
PeerTube-4a6995be18b15de1834a39c8921a0e4109671bb6.tar.zst
PeerTube-4a6995be18b15de1834a39c8921a0e4109671bb6.zip
First draft to use webpack instead of systemjs
Diffstat (limited to 'client/src/app/videos/video-watch/webtorrent.service.ts')
-rw-r--r--client/src/app/videos/video-watch/webtorrent.service.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/client/src/app/videos/video-watch/webtorrent.service.ts b/client/src/app/videos/video-watch/webtorrent.service.ts
new file mode 100644
index 000000000..bf38b5aaa
--- /dev/null
+++ b/client/src/app/videos/video-watch/webtorrent.service.ts
@@ -0,0 +1,26 @@
1// Don't use webtorrent typings for now
2// It misses some little things I'll fix later
3// <reference path="../../../../typings/globals/webtorrent/index.d.ts" />
4
5import { Injectable } from '@angular/core';
6
7// import WebTorrent = require('webtorrent');
8declare var WebTorrent: any;
9
10@Injectable()
11export class WebTorrentService {
12 // private client: WebTorrent.Client;
13 private client: any;
14
15 constructor() {
16 this.client = new WebTorrent({ dht: false });
17 }
18
19 add(magnetUri: string, callback: Function) {
20 return this.client.add(magnetUri, callback);
21 }
22
23 remove(magnetUri: string) {
24 return this.client.remove(magnetUri);
25 }
26}