class MediaPeer extends stringly_typed_event_emitter_1.default {
constructor (peer, settings) {
super();
this.peer = peer;
this.settings = settings;
this.remoteAddress = "";
this.downloadingSegmentId = null;
this.downloadingSegment = null;
this.segmentsMap = new Map ();
this.debug = Debug ("p2pml: media-peer");
this.timer = null;
//! at this point this.peer (peer too) here is a string like "179.187.29.127:9736", not an object
this.peer.on ("connect", () => this.onPeerConnect ());
Uncaught TypeError: this.peer.on is not a function
at new MediaPeer (/home/efox/Downloads/nwjs-sdk-v0.35.4-linux-x64/package.nw/other_modules/p2p-media-loader-core/dist/media-peer.js:54)
at P2PMediaManager.onTrackerPeer (/home/efox/Downloads/nwjs-sdk-v0.35.4-linux-x64/package.nw/other_modules/p2p-media-loader-core/dist/p2p-media-manager.js:217)
at Client.emit (events.js: 188)
at /home/efox/Downloads/nwjs-sdk-v0.35.4-linux-x64/package.nw/node_modules/bittorrent-tracker/lib/client/http-tracker.js:208
at Array.forEach (<anonymous>)
at HTTPTracker._onAnnounceResponse (/home/efox/Downloads/nwjs-sdk-v0.35.4-linux-x64/package.nw/node_modules/bittorrent-tracker/lib/client/http-tracker.js:207)
at /home/efox/Downloads/nwjs-sdk-v0.35.4-linux-x64/package.nw/node_modules/bittorrent-tracker/lib/client/http-tracker.js:60
at onResponse (/home/efox/Downloads/nwjs-sdk-v0.35.4-linux-x64/package.nw/node_modules/bittorrent-tracker/lib/client/http-tracker.js:177)
at concat (/home/efox/Downloads/nwjs-sdk-v0.35.4-linux-x64/package.nw/node_modules/bittorrent-tracker/node_modules/simple-get/index.js:89)
at IncomingMessage. <anonymous> (/home/efox/Downloads/nwjs-sdk-v0.35.4-linux-x64/package.nw/node_modules/simple-concat/index.js:7)