From 152380bd057d256bcd6cf3ececefcf5826fecaf9 Mon Sep 17 00:00:00 2001 From: aidenlx <31102694+aidenlx@users.noreply.github.com> Date: Tue, 26 Apr 2022 21:42:41 +0800 Subject: [PATCH] fix nplayer url not working when protocol is included (#620) --- components/previews/VideoPreview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/previews/VideoPreview.tsx b/components/previews/VideoPreview.tsx index aa86364..139d798 100644 --- a/components/previews/VideoPreview.tsx +++ b/components/previews/VideoPreview.tsx @@ -164,7 +164,7 @@ const VideoPreview: FC<{ file: OdFileObject }> = ({ file }) => { btnImage="/players/potplayer.png" /> window.open(`nplayer-http://${getBaseUrl()}${videoUrl}`)} + onClickCallback={() => window.open(`nplayer-http://${window?.location.hostname ?? ""}${videoUrl}`)} btnText="nPlayer" btnImage="/players/nplayer.png" />