mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-19 16:04:41 +00:00
force to use landscale mode for selection
This commit is contained in:
parent
ac70db8de6
commit
ad6aba06d3
2 changed files with 32 additions and 66 deletions
|
@ -131,8 +131,19 @@
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
height: fit-content;
|
max-height: fit-content;
|
||||||
max-height: 50%;
|
}
|
||||||
|
|
||||||
|
@media (min-width: 640px) {
|
||||||
|
.media-source-dialog {
|
||||||
|
max-height: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1280px) {
|
||||||
|
.media-controller[mediaisfullscreen] .media-source-dialog {
|
||||||
|
max-height: 30%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.media-controller media-chrome-dialog > div {
|
.media-controller media-chrome-dialog > div {
|
||||||
|
|
|
@ -1,22 +1,8 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import Styles from "./MediaPlayer.module.css";
|
||||||
import { Button, Card } from "flowbite-react";
|
import { Button, Card } from "flowbite-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { ENDPOINTS } from "#/api/config";
|
|
||||||
|
|
||||||
// import { VoiceoverSelector } from "./VoiceoverSelector";
|
|
||||||
// import { SourceSelector } from "./SourceSelector";
|
|
||||||
// import { EpisodeSelector } from "./EpisodeSelector";
|
|
||||||
// import { useUserPlayerPreferencesStore } from "#/store/player";
|
|
||||||
|
|
||||||
import HlsVideo from "hls-video-element/react";
|
|
||||||
import VideoJS from "videojs-video-element/react";
|
|
||||||
// import MediaThemeSutro from "./MediaThemeSutro";
|
|
||||||
// import { getAnonEpisodesWatched } from "./ReleasePlayer";
|
|
||||||
// import { tryCatchPlayer, tryCatchAPI } from "#/api/utils";
|
|
||||||
|
|
||||||
import Styles from "./MediaPlayer.module.css";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MediaController,
|
MediaController,
|
||||||
MediaControlBar,
|
MediaControlBar,
|
||||||
|
@ -50,6 +36,11 @@ import {
|
||||||
_fetchSibnetManifest,
|
_fetchSibnetManifest,
|
||||||
} from "./PlayerParsing";
|
} from "./PlayerParsing";
|
||||||
import { EpisodeSelectorMenu } from "./EpisodeSelectorMenu";
|
import { EpisodeSelectorMenu } from "./EpisodeSelectorMenu";
|
||||||
|
import HlsVideo from "hls-video-element/react";
|
||||||
|
import VideoJS from "videojs-video-element/react";
|
||||||
|
|
||||||
|
// import { ENDPOINTS } from "#/api/config";
|
||||||
|
// import { getAnonEpisodesWatched } from "./ReleasePlayer";
|
||||||
|
|
||||||
export const ReleasePlayerCustom = (props: {
|
export const ReleasePlayerCustom = (props: {
|
||||||
id: number;
|
id: number;
|
||||||
|
@ -151,49 +142,6 @@ export const ReleasePlayerCustom = (props: {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="">
|
<Card className="">
|
||||||
{/* <div className="flex items-center justify-center w-full h-full">
|
|
||||||
{isLoading ?
|
|
||||||
!playerError ?
|
|
||||||
<Spinner />
|
|
||||||
: <div className="flex flex-col gap-2">
|
|
||||||
<p className="text-lg font-bold">Ошибка: {playerError.message}</p>
|
|
||||||
{!isErrorDetailsOpen ?
|
|
||||||
<Button
|
|
||||||
color="light"
|
|
||||||
size="xs"
|
|
||||||
onClick={() => setIsErrorDetailsOpen(true)}
|
|
||||||
>
|
|
||||||
Подробнее
|
|
||||||
</Button>
|
|
||||||
: <p className="text-gray-600 dark:text-gray-100">
|
|
||||||
{playerError.detail}
|
|
||||||
</p>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
: playerProps.useCustom ?
|
|
||||||
!playerError ?
|
|
||||||
|
|
||||||
: <div className="flex flex-col gap-2">
|
|
||||||
<p className="text-lg font-bold">Ошибка: {playerError.message}</p>
|
|
||||||
{!isErrorDetailsOpen ?
|
|
||||||
<Button
|
|
||||||
color="light"
|
|
||||||
size="xs"
|
|
||||||
onClick={() => setIsErrorDetailsOpen(true)}
|
|
||||||
>
|
|
||||||
Подробнее
|
|
||||||
</Button>
|
|
||||||
: <p className="text-gray-600 dark:text-gray-100">
|
|
||||||
{playerError.detail}
|
|
||||||
</p>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
</div> */}
|
|
||||||
|
|
||||||
<div className="flex items-center justify-center w-full h-full">
|
<div className="flex items-center justify-center w-full h-full">
|
||||||
<MediaController
|
<MediaController
|
||||||
breakpoints="md:480"
|
breakpoints="md:480"
|
||||||
|
@ -228,11 +176,11 @@ export const ReleasePlayerCustom = (props: {
|
||||||
)}
|
)}
|
||||||
{playerProps.type == null || playerProps.src == null ?
|
{playerProps.type == null || playerProps.src == null ?
|
||||||
<>
|
<>
|
||||||
<MediaPosterImage src="https://wallpapers.com/images/featured/cute-red-panda-pictures-sererbq0fdjum7rn.jpg"></MediaPosterImage>
|
{/* <MediaPosterImage src="https://wallpapers.com/images/featured/cute-red-panda-pictures-sererbq0fdjum7rn.jpg"></MediaPosterImage> */}
|
||||||
<VideoJS
|
<VideoJS
|
||||||
src={null}
|
src={null}
|
||||||
slot="media"
|
slot="media"
|
||||||
poster="https://wallpapers.com/images/featured/cute-red-panda-pictures-sererbq0fdjum7rn.jpg"
|
poster={null}
|
||||||
className="object-contain h-full aspect-video"
|
className="object-contain h-full aspect-video"
|
||||||
></VideoJS>
|
></VideoJS>
|
||||||
{!playerError && (
|
{!playerError && (
|
||||||
|
@ -318,7 +266,7 @@ export const ReleasePlayerCustom = (props: {
|
||||||
id="source"
|
id="source"
|
||||||
className={`${Styles["media-source-dialog"]}`}
|
className={`${Styles["media-source-dialog"]}`}
|
||||||
>
|
>
|
||||||
<div className="flex gap-2 overflow-hidden">
|
<div className="hidden gap-2 overflow-hidden sm:flex">
|
||||||
<VoiceoverSelectorMenu
|
<VoiceoverSelectorMenu
|
||||||
release_id={props.id}
|
release_id={props.id}
|
||||||
token={props.token}
|
token={props.token}
|
||||||
|
@ -349,6 +297,9 @@ export const ReleasePlayerCustom = (props: {
|
||||||
<p>Нет доступных вариантов для выбора</p>
|
<p>Нет доступных вариантов для выбора</p>
|
||||||
: ""}
|
: ""}
|
||||||
</div>
|
</div>
|
||||||
|
<div className="sm:hidden">
|
||||||
|
<p>Выбор доступен только в горизонтальном режиме</p>
|
||||||
|
</div>
|
||||||
</MediaChromeDialog>
|
</MediaChromeDialog>
|
||||||
<MediaControlBar className={`${Styles["media-control-bar"]}`}>
|
<MediaControlBar className={`${Styles["media-control-bar"]}`}>
|
||||||
<MediaPlayButton
|
<MediaPlayButton
|
||||||
|
@ -449,7 +400,7 @@ export const ReleasePlayerCustom = (props: {
|
||||||
className={`${Styles["media-preview-time-display"]}`}
|
className={`${Styles["media-preview-time-display"]}`}
|
||||||
></MediaPreviewTimeDisplay>
|
></MediaPreviewTimeDisplay>
|
||||||
</MediaTimeRange>
|
</MediaTimeRange>
|
||||||
<MediaSeekForwardButton className={`${Styles["media-button"]}`}>
|
<MediaSeekForwardButton className={`${Styles["media-button"]}`} seekOffset={90}>
|
||||||
<div slot="tooltip-content">Пропустить 1.5 минуты</div>
|
<div slot="tooltip-content">Пропустить 1.5 минуты</div>
|
||||||
<svg
|
<svg
|
||||||
{...({ slot: "icon" } as any)}
|
{...({ slot: "icon" } as any)}
|
||||||
|
@ -550,8 +501,12 @@ export const ReleasePlayerCustom = (props: {
|
||||||
</svg>
|
</svg>
|
||||||
</MediaAirplayButton>
|
</MediaAirplayButton>
|
||||||
<MediaCastButton className={`${Styles["media-button"]}`}>
|
<MediaCastButton className={`${Styles["media-button"]}`}>
|
||||||
<div slot="tooltip-enter">Включить трансляцию через Google Cast</div>
|
<div slot="tooltip-enter">
|
||||||
<div slot="tooltip-exit">Остановить трансляцию через Google Cast</div>
|
Включить трансляцию через Google Cast
|
||||||
|
</div>
|
||||||
|
<div slot="tooltip-exit">
|
||||||
|
Остановить трансляцию через Google Cast
|
||||||
|
</div>
|
||||||
<svg
|
<svg
|
||||||
{...({ slot: "icon" } as any)}
|
{...({ slot: "icon" } as any)}
|
||||||
className={`${Styles["svg"]}`}
|
className={`${Styles["svg"]}`}
|
||||||
|
|
Loading…
Add table
Reference in a new issue