p2p-media-loader-core
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -18,5 +18,8 @@ "use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
} | ||
return function (d, b) { | ||
@@ -23,0 +26,0 @@ extendStatics(d, b); |
@@ -18,5 +18,8 @@ "use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
} | ||
return function (d, b) { | ||
@@ -29,2 +32,3 @@ extendStatics(d, b); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Debug = require("debug"); | ||
var loader_interface_1 = require("./loader-interface"); | ||
@@ -35,3 +39,2 @@ var events_1 = require("events"); | ||
var media_peer_1 = require("./media-peer"); | ||
var Debug = require("debug"); | ||
var segment_internal_1 = require("./segment-internal"); | ||
@@ -74,3 +77,3 @@ var speed_approximator_1 = require("./speed-approximator"); | ||
_this.debug("segment loaded", segment.id, segment.url); | ||
var segmentInternal = new segment_internal_1.default(segment.id, segment.url, segment.range, segment.priority, data, _this.speedApproximator.getSpeed(_this.now())); | ||
var segmentInternal = new segment_internal_1.SegmentInternal(segment.id, segment.url, segment.range, segment.priority, data, _this.speedApproximator.getSpeed(_this.now())); | ||
_this.segments.set(segment.id, segmentInternal); | ||
@@ -77,0 +80,0 @@ _this.emitSegmentLoaded(segmentInternal); |
@@ -18,5 +18,8 @@ "use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
} | ||
return function (d, b) { | ||
@@ -23,0 +26,0 @@ extendStatics(d, b); |
@@ -19,3 +19,3 @@ /** | ||
import { MediaPeerSegmentStatus } from "./media-peer"; | ||
import SegmentInternal from "./segment-internal"; | ||
import { SegmentInternal } from "./segment-internal"; | ||
export declare class P2PMediaManager extends STEEmitter<"peer-connected" | "peer-closed" | "peer-data-updated" | "segment-loaded" | "segment-error" | "bytes-downloaded" | "bytes-uploaded"> { | ||
@@ -22,0 +22,0 @@ readonly cachedSegments: Map<string, SegmentInternal>; |
@@ -18,5 +18,8 @@ "use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
} | ||
return function (d, b) { | ||
@@ -23,0 +26,0 @@ extendStatics(d, b); |
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
export default class SegmentInternal { | ||
export declare class SegmentInternal { | ||
readonly id: string; | ||
@@ -19,0 +19,0 @@ readonly url: string; |
@@ -33,2 +33,2 @@ "use strict"; | ||
}()); | ||
exports.default = SegmentInternal; | ||
exports.SegmentInternal = SegmentInternal; |
@@ -18,5 +18,8 @@ "use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
} | ||
return function (d, b) { | ||
@@ -23,0 +26,0 @@ extendStatics(d, b); |
{ | ||
"name": "p2p-media-loader-core", | ||
"description": "P2P Media Loader core functionality", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"license": "Apache-2.0", | ||
@@ -26,6 +26,8 @@ "author": "Novage", | ||
"scripts": { | ||
"compile": "rimraf ./dist && tsc && copyfiles -f ./lib/*.js ./dist && rimraf ./build && mkdirp ./build", | ||
"browserify": "browserify -r ./dist/index.js:p2p-media-loader-core ./dist/browser-init.js > ./build/p2p-media-loader-core.js", | ||
"compile": "tsc && copyfiles -f ./lib/*.js ./dist", | ||
"browserify": "mkdirp ./build && browserify -r ./dist/index.js:p2p-media-loader-core ./dist/browser-init.js > ./build/p2p-media-loader-core.js", | ||
"minify": "uglifyjs ./build/p2p-media-loader-core.js -m -c --comments > ./build/p2p-media-loader-core.min.js", | ||
"build": "npm run compile && npm run browserify && npm run minify", | ||
"webpack:build": "webpack --progress", | ||
"webpack:watch": "webpack --watch --progress", | ||
"lint": "tslint -c ./tslint.json -p ./tsconfig.test.json", | ||
@@ -39,5 +41,5 @@ "test": "mocha -r ts-node/register test/*.test.ts" | ||
"dependencies": { | ||
"bittorrent-tracker": "^9.6.0", | ||
"crypto-browserify": "^3.11.1", | ||
"debug": "^3.0.0", | ||
"bittorrent-tracker": "^9.10.1", | ||
"crypto-browserify": "^3.12.0", | ||
"debug": "^3.2.6", | ||
"events": "^3.0.0", | ||
@@ -47,16 +49,18 @@ "get-browser-rtc": "^1.0.2" | ||
"devDependencies": { | ||
"@types/debug": "^0.0.30", | ||
"@types/debug": "^0.0.31", | ||
"@types/mocha": "^5.2.5", | ||
"@types/node": "^10.5.4", | ||
"browserify": "^16.2.2", | ||
"@types/node": "^10.12.9", | ||
"browserify": "^16.2.3", | ||
"browserify-versionify": "^1.0.6", | ||
"copyfiles": "^2.0.0", | ||
"copyfiles": "^2.1.0", | ||
"mkdirp": "^0.5.1", | ||
"mocha": "^5.2.0", | ||
"rimraf": "^2.6.1", | ||
"ts-mockito": "^2.3.0", | ||
"ts-node": "^7.0.0", | ||
"tslint": "^5.5.0", | ||
"typescript": "^2.7.2", | ||
"uglify-js": "^3.3.12" | ||
"ts-loader": "^5.3.0", | ||
"ts-mockito": "^2.3.1", | ||
"ts-node": "^7.0.1", | ||
"tslint": "^5.11.0", | ||
"typescript": "^3.1.6", | ||
"uglify-js": "^3.4.9", | ||
"webpack": "^4.25.1", | ||
"webpack-cli": "^3.1.2" | ||
}, | ||
@@ -63,0 +67,0 @@ "browserify": { |
# P2P Media Loader Core | ||
[![npm version](https://badge.fury.io/js/p2p-media-loader-core.svg)](https://npmjs.com/package/p2p-media-loader-core) | ||
Core functionality for P2P sharing of segmented media streams (i.e. HLS, DASH) using WebRTC. | ||
@@ -49,5 +51,5 @@ | ||
| `trackerAnnounce` | String[] | [ "wss://tracker.btorrent.xyz/", "wss://tracker.openwebtorrent.com/" ] | Torrent trackers (announcers) to use | ||
| `webRtcMaxMessageSize` | number | 64 * 1024 - 1 | Max WebRTC message size. 64KiB - 1B should work with most of recent browsers. Set it to 16KiB for older browsers support. | ||
| `p2pSegmentDownloadTimeout` | number | 60000 | Timeout to download a segment from a peer. If exceeded the peer is dropped. | ||
| `rtcConfig` | RTCConfiguration | Object | An RTCConfiguration dictionary providing options to configure WebRTC connections. | ||
| `webRtcMaxMessageSize` | Integer | 64 * 1024 - 1 | Max WebRTC message size. 64KiB - 1B should work with most of recent browsers. Set it to 16KiB for older browsers support. | ||
| `p2pSegmentDownloadTimeout` | Integer | 60000 | Timeout to download a segment from a peer. If exceeded the peer is dropped. | ||
| `rtcConfig` | [RTCConfiguration](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection#RTCConfiguration_dictionary) | Object | An [RTCConfiguration](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection#RTCConfiguration_dictionary) dictionary providing options to configure WebRTC connections. | ||
@@ -102,3 +104,3 @@ ### `loader.load(segments, swarmId)` | ||
Listener args: | ||
Listener args: | ||
- `method` - downloading method, possible values: `http`, `p2p`; | ||
@@ -105,0 +107,0 @@ - `bytes` - amount of bytes downloaded; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1608118
26
27222
194
16
3
Updatedbittorrent-tracker@^9.10.1
Updatedcrypto-browserify@^3.12.0
Updateddebug@^3.2.6