Files
JKVideo/services/types.ts
Developer a46e63f0ba 1
2026-03-16 21:13:26 +08:00

158 lines
2.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export interface VideoItem {
bvid: string;
aid: number;
title: string;
pic: string;
owner: {
mid: number;
name: string;
face: string;
};
stat?: {
view: number;
danmaku: number;
reply: number;
like: number;
coin: number;
favorite: number;
} | null;
duration: number;
desc: string;
cid?: number;
pages?: Array<{ cid: number; part: string }>;
goto?: 'av' | 'live';
roomid?: number;
online?: number;
area_name?: string;
ugc_season?: {
id: number;
title: string;
cover: string;
ep_count: number;
sections: Array<{
episodes: Array<{
aid: number;
bvid: string;
cid: number;
title: string;
arc?: { pic: string; stat?: { view: number } };
}>;
}>;
};
}
export interface Comment {
rpid: number;
content: { message: string };
member: {
uname: string;
avatar: string;
};
like: number;
ctime: number;
replies: Comment[] | null;
}
export interface DashSegmentBase {
initialization: string;
index_range: string;
}
export interface DashVideoItem {
id: number;
baseUrl: string;
bandwidth: number;
mimeType: string;
codecs: string;
width: number;
height: number;
stat:any;
frameRate: string;
segment_base?: DashSegmentBase;
}
export interface DashAudioItem {
id: number;
baseUrl: string;
bandwidth: number;
mimeType: string;
codecs: string;
segment_base?: DashSegmentBase;
}
export interface PlayUrlResponse {
durl?: Array<{
url: string;
length: number;
size: number;
}>;
dash?: {
duration: number;
video: DashVideoItem[];
audio: DashAudioItem[];
};
quality: number;
accept_quality: number[];
accept_description: string[];
}
export interface QRCodeInfo {
url: string;
qrcode_key: string;
}
export interface VideoShotData {
img_x_len: number;
img_y_len: number;
img_x_size: number;
img_y_size: number;
image: string[];
index: number[]; // frame index per second: index[t] = frame idx at second t
pvdata?: string;
}
export interface DanmakuItem {
time: number; // 秒float弹幕出现时间
mode: 1 | 4 | 5; // 1=滚动, 4=底部固定, 5=顶部固定
fontSize: number;
color: number; // 0xRRGGBB 十进制整数
text: string;
}
export interface LiveRoom {
roomid: number;
uid: number;
title: string;
uname: string;
face: string;
cover: string;
online: number;
area_name: string;
parent_area_name: string;
}
export interface LiveRoomDetail {
roomid: number;
uid: number;
title: string;
description: string;
live_status: number; // 1=直播中, 0=未开播
online: number;
area_name: string;
parent_area_name: string;
keyframe: string;
}
export interface LiveAnchorInfo {
uid: number;
uname: string;
face: string;
}
export interface LiveStreamInfo {
hlsUrl: string;
flvUrl: string;
qn: number;
qualities: { qn: number; desc: string }[];
}