mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-03-17 23:19:14 -04:00
Fix player for unmatched videos
This commit is contained in:
parent
9af7e070d1
commit
38d1583950
@ -36,10 +36,12 @@ export const FullVideo = t.Composite([
|
||||
),
|
||||
),
|
||||
show: t.Optional(
|
||||
t.Union([
|
||||
t.Composite([t.Object({ kind: t.Literal("movie") }), Movie]),
|
||||
t.Composite([t.Object({ kind: t.Literal("serie") }), Serie]),
|
||||
]),
|
||||
t.Nullable(
|
||||
t.Union([
|
||||
t.Composite([t.Object({ kind: t.Literal("movie") }), Movie]),
|
||||
t.Composite([t.Object({ kind: t.Literal("serie") }), Serie]),
|
||||
]),
|
||||
),
|
||||
),
|
||||
}),
|
||||
]);
|
||||
|
||||
@ -50,7 +50,7 @@ export const FullVideo = Video.extend({
|
||||
}),
|
||||
previous: z.object({ video: z.string(), entry: Entry }).nullable().optional(),
|
||||
next: z.object({ video: z.string(), entry: Entry }).nullable().optional(),
|
||||
show: Show.optional(),
|
||||
show: Show.optional().nullable(),
|
||||
});
|
||||
export type FullVideo = z.infer<typeof FullVideo>;
|
||||
|
||||
|
||||
@ -50,18 +50,25 @@ export const BottomControls = ({
|
||||
|
||||
return (
|
||||
<View className={cn("flex-row p-2", className)} {...props}>
|
||||
<View className="m-4 w-1/5 max-w-50 max-sm:hidden">
|
||||
{poster !== undefined ? (
|
||||
<Poster
|
||||
src={poster}
|
||||
quality="low"
|
||||
className="absolute bottom-0 w-full"
|
||||
/>
|
||||
) : (
|
||||
<Poster.Loader className="absolute bottom-0 w-full" />
|
||||
{poster !== null && (
|
||||
<View className="m-4 w-1/5 max-w-50 max-sm:hidden">
|
||||
{poster !== undefined ? (
|
||||
<Poster
|
||||
src={poster}
|
||||
quality="low"
|
||||
className="absolute bottom-0 w-full"
|
||||
/>
|
||||
) : (
|
||||
<Poster.Loader className="absolute bottom-0 w-full" />
|
||||
)}
|
||||
</View>
|
||||
)}
|
||||
<View
|
||||
className={cn(
|
||||
"my-1 mr-4 flex-1 max-sm:ml-4 sm:my-6",
|
||||
poster === null && "ml-4",
|
||||
)}
|
||||
</View>
|
||||
<View className="my-1 mr-4 flex-1 max-sm:ml-4 sm:my-6">
|
||||
>
|
||||
{!bottomSeek &&
|
||||
(name ? (
|
||||
<H2 numberOfLines={1} className="pb-2 text-slate-200">
|
||||
|
||||
@ -36,7 +36,7 @@ export const Player = () => {
|
||||
? entry.kind === "movie"
|
||||
? entry.name
|
||||
: `${entry.name} (${entryDisplayNumber(entry)})`
|
||||
: null;
|
||||
: data?.path;
|
||||
|
||||
const { apiUrl, authToken } = useToken();
|
||||
const [defaultPlayMode] = useLocalSetting<"direct" | "hls">(
|
||||
@ -187,14 +187,14 @@ export const Player = () => {
|
||||
<Controls
|
||||
player={player}
|
||||
showHref={data?.show?.href}
|
||||
name={data?.show?.name}
|
||||
poster={data?.show?.poster}
|
||||
name={data?.show?.name ?? data?.path}
|
||||
poster={data ? (data.show?.poster ?? null) : undefined}
|
||||
subName={
|
||||
entry
|
||||
? [entryDisplayNumber(entry), entry.name]
|
||||
.filter((x) => x)
|
||||
.join(" - ")
|
||||
: undefined
|
||||
: data?.path
|
||||
}
|
||||
chapters={info?.chapters ?? []}
|
||||
previous={data?.previous?.video}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user