openlist支持视频预览方式播放

This commit is contained in:
mtvpls
2026-01-12 22:27:55 +08:00
parent 2c805e2522
commit 391d805a3b
4 changed files with 173 additions and 30 deletions
+25
View File
@@ -280,6 +280,31 @@ export class OpenListClient {
}
}
// 获取视频预览流
async getVideoPreview(path: string): Promise<any> {
const response = await this.fetchWithRetry(`${this.baseURL}/api/fs/other`, {
method: 'POST',
headers: await this.getHeaders(),
body: JSON.stringify({
path: path,
method: 'video_preview',
password: '',
}),
});
if (!response.ok) {
throw new Error(`视频预览请求失败: ${response.status}`);
}
const data = await response.json();
if (data.code !== 200) {
throw new Error(`视频预览失败: ${data.message}`);
}
return data;
}
// 检查连通性
async checkConnectivity(): Promise<{ success: boolean; message: string }> {
try {