Skip to content

Commit

Permalink
Merge pull request #525 from clddup/master
Browse files Browse the repository at this point in the history
fix:  #524 #526
  • Loading branch information
kailong321200875 authored Sep 3, 2024
2 parents 54622c5 + 3cd89bd commit 0290d83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/VideoPlayer/src/VideoPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 6 additions & 3 deletions src/utils/is.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 0290d83

Please sign in to comment.