mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
@@ -2,39 +2,24 @@ import 'package:PiliPlus/models_new/live/live_room_play_info/url_info.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
|
||||
class CodecItem {
|
||||
String? codecName;
|
||||
int? currentQn;
|
||||
List<int>? acceptQn;
|
||||
String? baseUrl;
|
||||
List<UrlInfo>? urlInfo;
|
||||
dynamic hdrQn;
|
||||
int? dolbyType;
|
||||
String? attrName;
|
||||
int? hdrType;
|
||||
|
||||
CodecItem({
|
||||
this.codecName,
|
||||
this.currentQn,
|
||||
this.acceptQn,
|
||||
this.baseUrl,
|
||||
this.urlInfo,
|
||||
this.hdrQn,
|
||||
this.dolbyType,
|
||||
this.attrName,
|
||||
this.hdrType,
|
||||
});
|
||||
|
||||
factory CodecItem.fromJson(Map<String, dynamic> json) => CodecItem(
|
||||
codecName: json['codec_name'] as String?,
|
||||
currentQn: json['current_qn'] as int?,
|
||||
acceptQn: (json['accept_qn'] as List?)?.fromCast(),
|
||||
baseUrl: json['base_url'] as String?,
|
||||
urlInfo: (json['url_info'] as List<dynamic>?)
|
||||
?.map((e) => UrlInfo.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
hdrQn: json['hdr_qn'] as dynamic,
|
||||
dolbyType: json['dolby_type'] as int?,
|
||||
attrName: json['attr_name'] as String?,
|
||||
hdrType: json['hdr_type'] as int?,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
import 'package:PiliPlus/models_new/live/live_room_play_info/codec.dart';
|
||||
|
||||
class Format {
|
||||
String? formatName;
|
||||
List<CodecItem>? codec;
|
||||
String? masterUrl;
|
||||
|
||||
Format({this.formatName, this.codec, this.masterUrl});
|
||||
Format({this.codec});
|
||||
|
||||
factory Format.fromJson(Map<String, dynamic> json) => Format(
|
||||
formatName: json['format_name'] as String?,
|
||||
codec: (json['codec'] as List<dynamic>?)
|
||||
?.map((e) => CodecItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
masterUrl: json['master_url'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
import 'package:PiliPlus/models_new/live/live_room_play_info/stream.dart';
|
||||
|
||||
class Playurl {
|
||||
int? cid;
|
||||
List<Stream>? stream;
|
||||
|
||||
Playurl({
|
||||
this.cid,
|
||||
this.stream,
|
||||
});
|
||||
|
||||
factory Playurl.fromJson(Map<String, dynamic> json) => Playurl(
|
||||
cid: json['cid'] as int?,
|
||||
stream: (json['stream'] as List<dynamic>?)
|
||||
?.map((e) => Stream.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import 'package:PiliPlus/models_new/live/live_room_play_info/format.dart';
|
||||
|
||||
class Stream {
|
||||
String? protocolName;
|
||||
List<Format>? format;
|
||||
|
||||
Stream({this.protocolName, this.format});
|
||||
Stream({this.format});
|
||||
|
||||
factory Stream.fromJson(Map<String, dynamic> json) => Stream(
|
||||
protocolName: json['protocol_name'] as String?,
|
||||
format: (json['format'] as List<dynamic>?)
|
||||
?.map((e) => Format.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
class UrlInfo {
|
||||
String? host;
|
||||
String? extra;
|
||||
int? streamTtl;
|
||||
|
||||
UrlInfo({this.host, this.extra, this.streamTtl});
|
||||
UrlInfo({this.host, this.extra});
|
||||
|
||||
factory UrlInfo.fromJson(Map<String, dynamic> json) => UrlInfo(
|
||||
host: json['host'] as String?,
|
||||
extra: json['extra'] as String?,
|
||||
streamTtl: json['stream_ttl'] as int?,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user