mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-13 10:52:28 -04:00
Fix rnv startup
This commit is contained in:
@@ -4,7 +4,7 @@ import { Genre } from "./utils/genre";
|
||||
import { KImage } from "./utils/images";
|
||||
import { Metadata } from "./utils/metadata";
|
||||
import { zdate } from "./utils/utils";
|
||||
import { EmbeddedVideo } from "./video";
|
||||
import { EmbeddedVideo } from "./video-embed";
|
||||
|
||||
export const Movie = z
|
||||
.object({
|
||||
@@ -39,7 +39,18 @@ export const Movie = z
|
||||
updatedAt: zdate(),
|
||||
|
||||
studios: z.array(Studio).optional(),
|
||||
videos: z.array(EmbeddedVideo).optional(),
|
||||
videos: z
|
||||
.array(
|
||||
z.object({
|
||||
id: z.string(),
|
||||
slug: z.string(),
|
||||
path: z.string(),
|
||||
rendering: z.string(),
|
||||
part: z.number().int().gt(0).nullable(),
|
||||
version: z.number().gt(0),
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
watchStatus: z
|
||||
.object({
|
||||
status: z.enum([
|
||||
|
||||
@@ -15,7 +15,7 @@ export const Quality = z
|
||||
.default("original");
|
||||
export type Quality = z.infer<typeof Quality>;
|
||||
|
||||
export const Video = z.object({
|
||||
export const VideoTrack = z.object({
|
||||
index: z.number(),
|
||||
title: z.string().nullable(),
|
||||
language: z.string().nullable(),
|
||||
@@ -27,9 +27,9 @@ export const Video = z.object({
|
||||
isDefault: z.boolean(),
|
||||
});
|
||||
|
||||
export type Video = z.infer<typeof Video>;
|
||||
export type VideoTrack = z.infer<typeof VideoTrack>;
|
||||
|
||||
export const Audio = z.object({
|
||||
export const AudioTrack = z.object({
|
||||
index: z.number(),
|
||||
title: z.string().nullable(),
|
||||
language: z.string().nullable(),
|
||||
@@ -38,7 +38,7 @@ export const Audio = z.object({
|
||||
bitrate: z.number(),
|
||||
isDefault: z.boolean(),
|
||||
});
|
||||
export type Audio = z.infer<typeof Audio>;
|
||||
export type AudioTrack = z.infer<typeof AudioTrack>;
|
||||
|
||||
export const Subtitle = z.object({
|
||||
// external subtitles don't have indexes
|
||||
@@ -46,7 +46,6 @@ export const Subtitle = z.object({
|
||||
title: z.string().nullable(),
|
||||
language: z.string().nullable(),
|
||||
codec: z.string(),
|
||||
mimeCodec: z.string(),
|
||||
extension: z.string(),
|
||||
isDefault: z.boolean(),
|
||||
isForced: z.boolean(),
|
||||
@@ -78,8 +77,8 @@ export const VideoInfo = z
|
||||
// in seconds
|
||||
duration: z.number(),
|
||||
container: z.string().nullable(),
|
||||
videos: z.array(Video),
|
||||
audios: z.array(Audio),
|
||||
videos: z.array(VideoTrack),
|
||||
audios: z.array(AudioTrack),
|
||||
subtitles: z.array(Subtitle),
|
||||
fonts: z.array(z.string()),
|
||||
chapters: z.array(Chapter),
|
||||
|
||||
@@ -49,13 +49,3 @@ export const FullVideo = Video.extend({
|
||||
show: Show.optional(),
|
||||
});
|
||||
export type FullVideo = z.infer<typeof FullVideo>;
|
||||
|
||||
export const EmbeddedVideo = z.object({
|
||||
id: z.string(),
|
||||
slug: z.string(),
|
||||
path: z.string(),
|
||||
rendering: z.string(),
|
||||
part: z.number().int().gt(0).nullable(),
|
||||
version: z.number().gt(0),
|
||||
});
|
||||
export type EmbeddedVideo = z.infer<typeof EmbeddedVideo>;
|
||||
|
||||
@@ -88,16 +88,18 @@ export const Player = () => {
|
||||
/>
|
||||
<Stack.Screen
|
||||
options={{
|
||||
// TODO: find a way to force fullscreen on mobile
|
||||
headerTransparent: true,
|
||||
headerStyle: { backgroundColor: undefined },
|
||||
headerShown: false,
|
||||
navigationBarHidden: true,
|
||||
statusBarHidden: true,
|
||||
orientation: "landscape",
|
||||
}}
|
||||
/>
|
||||
<VideoView
|
||||
player={player}
|
||||
pictureInPicture={true}
|
||||
autoEnterPictureInPicture={true}
|
||||
pictureInPicture
|
||||
autoEnterPictureInPicture
|
||||
resizeMode={"contain"}
|
||||
controls
|
||||
style={StyleSheet.absoluteFillObject}
|
||||
/>
|
||||
{/* <LoadingIndicator /> */}
|
||||
|
||||
Reference in New Issue
Block a user