feat: add error handling to player core functions
This commit is contained in:
@@ -32,7 +32,8 @@ const loadSubtitle = async (url: string): Promise<SubtitleCue[]> => {
|
||||
const res = await fetch(url);
|
||||
if (!res.ok) return [];
|
||||
return parseVtt(await res.text());
|
||||
} catch {
|
||||
} catch (error) {
|
||||
console.error("failed to load subtitle:", error);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user