commit
0290d83f96
|
@ -21,7 +21,7 @@ const videoEl = ref<HTMLDivElement>()
|
||||||
|
|
||||||
const intiPlayer = () => {
|
const intiPlayer = () => {
|
||||||
if (!unref(videoEl)) return
|
if (!unref(videoEl)) return
|
||||||
new Player({
|
playerRef.value = new Player({
|
||||||
autoplay: false,
|
autoplay: false,
|
||||||
...props,
|
...props,
|
||||||
el: unref(videoEl)
|
el: unref(videoEl)
|
||||||
|
|
|
@ -95,9 +95,12 @@ export const isServer = typeof window === 'undefined'
|
||||||
export const isClient = !isServer
|
export const isClient = !isServer
|
||||||
|
|
||||||
export const isUrl = (path: string): boolean => {
|
export const isUrl = (path: string): boolean => {
|
||||||
const reg =
|
try {
|
||||||
/(((^https?:(?:\/\/)?)(?:[-:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&%@.\w_]*)#?(?:[\w]*))?)$/
|
new URL(path)
|
||||||
return reg.test(path)
|
return true
|
||||||
|
} catch (_error) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const isDark = (): boolean => {
|
export const isDark = (): boolean => {
|
||||||
|
|
Loading…
Reference in New Issue