fix nplayer url not working when protocol is included (#620)

This commit is contained in:
aidenlx 2022-04-26 21:42:41 +08:00 committed by GitHub
parent 26945f554e
commit 152380bd05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,7 +164,7 @@ const VideoPreview: FC<{ file: OdFileObject }> = ({ file }) => {
btnImage="/players/potplayer.png"
/>
<DownloadButton
onClickCallback={() => window.open(`nplayer-http://${getBaseUrl()}${videoUrl}`)}
onClickCallback={() => window.open(`nplayer-http://${window?.location.hostname ?? ""}${videoUrl}`)}
btnText="nPlayer"
btnImage="/players/nplayer.png"
/>