TTVideoEngineLoadCacheInfo.fromJson constructor

TTVideoEngineLoadCacheInfo.fromJson(
  1. Map json
)

Implementation

factory TTVideoEngineLoadCacheInfo.fromJson(Map<dynamic, dynamic> json) => TTVideoEngineLoadCacheInfo(
    cacheKey: json["cacheKey"] as String,
    mediaSize: json["mediaSize"] as int,
    preloadHeaderSize: json["preloadHeaderSize"] as int,
    preloadOffset: json["preloadOffset"] as int,
    preloadSize: json["preloadSize"] as int,
    cacheState: TTVideoEngineCacheState.values[json["cacheState"] as int],
    resolution: TTVideoEngineResolutionType.values[json['resolution'] as int],
    localFilePath: json["localFilePath"] as String,
    maxCacheEnd: json["maxCacheEnd"] as int,
    isFinished: json["isFinished"] ?? false,
    cacheRanges: json["cacheRanges"] == null
        ? []
        : List<TTVideoEngineCacheRange>.from(json["cacheRanges"]!.map((x) => TTVideoEngineCacheRange.fromJson(x))),
    error: json["error"] == null ? null : TTError(json["error"]["code"], json["error"]["msg"]));