热力图bug

This commit is contained in:
Developer
2026-03-12 23:57:01 +08:00
parent a55bcd46ea
commit 2e7578afde
7 changed files with 245 additions and 229 deletions

View File

@@ -2,7 +2,7 @@ import axios from 'axios';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { Platform } from 'react-native';
import pako from 'pako';
import type { VideoItem, Comment, PlayUrlResponse, QRCodeInfo, VideoShotData, HeatmapResponse, DanmakuItem } from './types';
import type { VideoItem, Comment, PlayUrlResponse, QRCodeInfo, VideoShotData, DanmakuItem } from './types';
import { signWbi } from '../utils/wbi';
import { parseDanmakuXml } from '../utils/danmaku';
@@ -123,13 +123,6 @@ export async function getComments(aid: number, pn = 1): Promise<Comment[]> {
return (res.data.data?.replies ?? []) as Comment[];
}
export async function getHeatmap(bvid: string): Promise<HeatmapResponse | null> {
try {
const res = await api.get('/pbp/data', { params: { bvid } });
return res.data.data as HeatmapResponse;
} catch { return null; }
}
export async function getVideoShot(bvid: string, cid: number): Promise<VideoShotData | null> {
try {
const res = await api.get('/x/player/videoshot', {

View File

@@ -91,11 +91,6 @@ export interface VideoShotData {
pvdata?: string; // base64 protobuf: packed float32 timestamps (seconds) per frame
}
export interface HeatmapResponse {
timestamp: number;
pb_data: string;
}
export interface DanmakuItem {
time: number; // 秒float弹幕出现时间
mode: 1 | 4 | 5; // 1=滚动, 4=底部固定, 5=顶部固定