From 9177a349e087cdc60b22e2338146caaefd377694 Mon Sep 17 00:00:00 2001 From: Whitewater Date: Tue, 13 Aug 2024 16:43:49 +0800 Subject: [PATCH] fix: use official embed player in bilibili video when use web (#219) --- src/renderer/src/lib/url-to-iframe.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/lib/url-to-iframe.ts b/src/renderer/src/lib/url-to-iframe.ts index e040b9276..7493ce168 100644 --- a/src/renderer/src/lib/url-to-iframe.ts +++ b/src/renderer/src/lib/url-to-iframe.ts @@ -1,6 +1,9 @@ export const urlToIframe = (url?: string | null, mini?: boolean) => { if (url?.match(/\/\/www.bilibili.com\/video\/BV\w+/)) { - return `https://www.bilibili.com/blackboard/newplayer.html?${new URLSearchParams({ + const player = window.electron ? + "https://www.bilibili.com/blackboard/newplayer.html" : + "https://player.bilibili.com/player.html" + return `${player}?${new URLSearchParams({ isOutside: "true", autoplay: "true", danmaku: "true",