Merge pull request #525 from clddup/master

fix:  #524 #526
This commit is contained in:
Archer 2024-09-03 10:11:01 +08:00 committed by GitHub
commit 0290d83f96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -21,7 +21,7 @@ const videoEl = ref<HTMLDivElement>()
const intiPlayer = () => {
if (!unref(videoEl)) return
new Player({
playerRef.value = new Player({
autoplay: false,
...props,
el: unref(videoEl)

View File

@ -95,9 +95,12 @@ export const isServer = typeof window === 'undefined'
export const isClient = !isServer
export const isUrl = (path: string): boolean => {
const reg =
/(((^https?:(?:\/\/)?)(?:[-:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&%@.\w_]*)#?(?:[\w]*))?)$/
return reg.test(path)
try {
new URL(path)
return true
} catch (_error) {
return false
}
}
export const isDark = (): boolean => {