16 changed files with 102 additions and 10 deletions
@ -0,0 +1,5 @@ |
|||||||
|
/* |
||||||
|
X-Frame-Options: DENY |
||||||
|
X-XSS-Protection: 1; mode=block |
||||||
|
X-Content-Type-Options: nosniff |
||||||
|
Referrer-Policy: origin-when-cross-origin |
@ -1,7 +1,6 @@ |
|||||||
window.__CONFIG__ = { |
window.__CONFIG__ = { |
||||||
// url must NOT end with a slash
|
// url must NOT end with a slash
|
||||||
VITE_CORS_PROXY_URL: "", |
VITE_CORS_PROXY_URL: "", |
||||||
|
|
||||||
VITE_TMDB_API_KEY: "b030404650f279792a8d3287232358e3", |
VITE_TMDB_API_KEY: "b030404650f279792a8d3287232358e3", |
||||||
VITE_OMDB_API_KEY: "aa0937c0", |
VITE_OMDB_API_KEY: "aa0937c0", |
||||||
}; |
}; |
||||||
|
@ -1,4 +1,4 @@ |
|||||||
export const DISCORD_LINK = "https://discord.gg/Jhqt4Xzpfb"; |
export const DISCORD_LINK = "https://discord.gg/Jhqt4Xzpfb"; |
||||||
export const GITHUB_LINK = "https://github.com/movie-web/movie-web"; |
export const GITHUB_LINK = "https://github.com/movie-web/movie-web"; |
||||||
export const APP_VERSION = "3.0.4"; |
export const APP_VERSION = "3.0.5"; |
||||||
export const GA_ID = "G-44YVXRL61C"; |
export const GA_ID = "G-44YVXRL61C"; |
||||||
|
@ -0,0 +1,40 @@ |
|||||||
|
import { Icons } from "@/components/Icon"; |
||||||
|
import { useIsMobile } from "@/hooks/useIsMobile"; |
||||||
|
import { useTranslation } from "react-i18next"; |
||||||
|
import { useControls } from "@/video/state/logic/controls"; |
||||||
|
import { useVideoPlayerDescriptor } from "@/video/state/hooks"; |
||||||
|
import { useCallback } from "react"; |
||||||
|
import { |
||||||
|
canPictureInPicture, |
||||||
|
canWebkitPictureInPicture, |
||||||
|
} from "@/utils/detectFeatures"; |
||||||
|
import { VideoPlayerIconButton } from "../parts/VideoPlayerIconButton"; |
||||||
|
|
||||||
|
interface Props { |
||||||
|
className?: string; |
||||||
|
} |
||||||
|
|
||||||
|
export function PictureInPictureAction(props: Props) { |
||||||
|
const { isMobile } = useIsMobile(); |
||||||
|
const { t } = useTranslation(); |
||||||
|
|
||||||
|
const descriptor = useVideoPlayerDescriptor(); |
||||||
|
const controls = useControls(descriptor); |
||||||
|
|
||||||
|
const handleClick = useCallback(() => { |
||||||
|
controls.togglePictureInPicture(); |
||||||
|
}, [controls]); |
||||||
|
|
||||||
|
if (!canPictureInPicture() && !canWebkitPictureInPicture()) return null; |
||||||
|
|
||||||
|
return ( |
||||||
|
<VideoPlayerIconButton |
||||||
|
className={props.className} |
||||||
|
icon={Icons.PICTURE_IN_PICTURE} |
||||||
|
onClick={handleClick} |
||||||
|
text={ |
||||||
|
isMobile ? (t("videoPlayer.buttons.pictureInPicture") as string) : "" |
||||||
|
} |
||||||
|
/> |
||||||
|
); |
||||||
|
} |
Loading…
Reference in new issue