P2pConfig constructor
P2pConfig({
- P2pLogLevel logLevel = P2pLogLevel.warn,
- Map<
String, dynamic> webRTCConfig = const {}, - String? wsSignalerAddr,
- String? announce,
- int diskCacheLimit = 1024 * 1024 * 1024,
- int memoryCacheLimit = 100 * 1024 * 1024,
- int memoryCacheCountLimit = 30,
- bool p2pEnabled = true,
- Duration downloadTimeout = const Duration(seconds: 30),
- Duration dcDownloadTimeout = const Duration(seconds: 6),
- String? tag,
- int localPort = 0,
- int maxPeerConnections = 20,
- bool useHttpRange = true,
- bool wifiOnly = false,
- Map<
String, String> ? httpHeaders, - bool isSetTopBox = false,
- int httpLoadTime = 2000,
- bool logPersistent = false,
- bool waitForPeerInAndroid = false,
- int waitForPeerTimeoutInAndroid = 4500,
- List<
String> hlsMediaFiles = const ["ts", "mp4", "m4s"], - String? logFilePathInIos,
- AnnounceLocation? announceLocation,
- List<
String> ? hlsMediaFileExtensions,
Implementation
P2pConfig({
this.logLevel: P2pLogLevel.warn,
this.webRTCConfig: const {}, // TODO: 默认值缺少
this.wsSignalerAddr, //: 'wss://signal.cdnbye.com',
this.announce, //: 'https://tracker.cdnbye.com/v1',
this.diskCacheLimit: 1024 * 1024 * 1024,
this.memoryCacheLimit: 100 * 1024 * 1024,
this.memoryCacheCountLimit: 30,
this.p2pEnabled: true,
this.downloadTimeout: const Duration(seconds: 30),
this.dcDownloadTimeout: const Duration(seconds: 6),
this.tag,
this.localPort: 0,
this.maxPeerConnections: 20,
this.useHttpRange: true,
this.wifiOnly: false,
this.httpHeaders,
this.isSetTopBox: false,
this.httpLoadTime: 2000,
this.logPersistent: false,
this.sharePlaylist: false,
this.waitForPeerInAndroid: false,
this.waitForPeerTimeoutInAndroid: 4500,
this.hlsMediaFiles: const ["ts", "mp4", "m4s"],
this.logFilePathInIos,
// 新
this.announceLocation,
this.hlsMediaFileExtensions,
});