from: 'src/assets',
to: 'assets'
},
- {
- from: 'node_modules/webtorrent/webtorrent.min.js',
- to: 'assets/webtorrent'
- },
{
from: 'src/standalone',
to: 'standalone'
libraryTarget: 'var'
},
- externals: {
- webtorrent: 'WebTorrent'
- },
-
module: {
// Too slow, life is short
node: {
global: true,
crypto: 'empty',
+ fs: 'empty',
process: true,
module: false,
clearImmediate: false,
publicPath: '/client/'
},
- externals: {
- webtorrent: 'WebTorrent'
- },
-
/**
* Add additional plugins to the compiler.
*
node: {
global: true,
crypto: 'empty',
+ fs: 'empty',
process: false,
module: false,
clearImmediate: false,
})
export class VideoWatchComponent implements OnInit, OnDestroy {
- private static LOADTIME_TOO_LONG: number = 20000;
+ private static LOADTIME_TOO_LONG = 20000;
@ViewChild('videoMagnetModal') videoMagnetModal: VideoMagnetComponent;
@ViewChild('videoShareModal') videoShareModal: VideoShareComponent;
@ViewChild('videoReportModal') videoReportModal: VideoReportComponent;
downloadSpeed: number;
- error: boolean = false;
- loading: boolean = false;
+ error = false;
+ loading = false;
numPeers: number;
player: videojs.Player;
playerElement: Element;
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject';
-declare const WebTorrent;
+import * as WebTorrent from 'webtorrent';
@Injectable()
export class WebTorrentService {
<!-- opengraph tags -->
<!-- Do not remove it! -->
- <!-- TODO: bundle it with webpack when https://github.com/webpack/webpack/pull/1931 will be merged -->
- <!-- <script src="/client/assets/webtorrent/webtorrent.min.js"></script> -->
-
<link rel="icon" type="image/png" href="/client/assets/favicon.png" />
<!-- base url -->