Skip to content

Commit

Permalink
fix: video auto playback (close AlistGo/alist#4673)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jul 1, 2023
1 parent a966a99 commit 5b8eef6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/pages/home/previews/aliyun_video.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, VStack } from "@hope-ui/solid"
import { Box } from "@hope-ui/solid"
import { onCleanup, onMount } from "solid-js"
import { useRouter, useLink, useFetch } from "~/hooks"
import { getSettingBool, objStore, password } from "~/store"
Expand Down Expand Up @@ -39,15 +39,15 @@ export interface Meta {
}

const Preview = () => {
const { replace } = useRouter()
const { replace, pathname } = useRouter()
const { proxyLink } = useLink()
let videos = objStore.objs.filter((obj) => obj.type === ObjType.VIDEO)
if (videos.length === 0) {
videos = [objStore.obj]
}
let player: Artplayer
let option: any = {
id: "player",
id: pathname(),
container: "#video-player",
title: objStore.obj.name,
volume: 0.5,
Expand Down Expand Up @@ -139,7 +139,6 @@ const Preview = () => {
}),
]
}
const { pathname } = useRouter()
const [loading, post] = useFetch(
(): PResp<Data> =>
r.post("/fs/other", {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/home/previews/video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import { currentLang } from "~/app/i18n"
import { VideoBox } from "./video_box"

const Preview = () => {
const { replace } = useRouter()
const { replace, pathname } = useRouter()
const { proxyLink } = useLink()
let videos = objStore.objs.filter((obj) => obj.type === ObjType.VIDEO)
if (videos.length === 0) {
videos = [objStore.obj]
}
let player: Artplayer
let option: Option = {
id: "player",
id: pathname(),
container: "#video-player",
url: objStore.raw_url,
title: objStore.obj.name,
Expand Down

0 comments on commit 5b8eef6

Please sign in to comment.