mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 18:13:25 +00:00
feat: autoplay
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import type { AVPlaybackSourceObject, AVPlaybackStatus, Video } from "expo-av";
|
||||
import type { Asset } from "expo-media-library";
|
||||
|
||||
import type { ScrapeMedia } from "@movie-web/provider-utils";
|
||||
|
||||
import type { MakeSlice } from "./types";
|
||||
import { PlayerStatus } from "./interface";
|
||||
|
||||
@@ -43,30 +41,6 @@ export interface VideoSlice {
|
||||
resetVideo(): void;
|
||||
}
|
||||
|
||||
export const convertMetaToScrapeMedia = (meta: PlayerMeta): ScrapeMedia => {
|
||||
if (meta.type === "movie") {
|
||||
return {
|
||||
title: meta.title,
|
||||
releaseYear: meta.releaseYear,
|
||||
type: "movie",
|
||||
tmdbId: meta.tmdbId,
|
||||
imdbId: meta.imdbId,
|
||||
};
|
||||
}
|
||||
if (meta.type === "show") {
|
||||
return {
|
||||
title: meta.title,
|
||||
releaseYear: meta.releaseYear,
|
||||
type: "show",
|
||||
tmdbId: meta.tmdbId,
|
||||
season: meta.season!,
|
||||
episode: meta.episode!,
|
||||
imdbId: meta.imdbId,
|
||||
};
|
||||
}
|
||||
throw new Error("Invalid meta type");
|
||||
};
|
||||
|
||||
export const createVideoSlice: MakeSlice<VideoSlice> = (set) => ({
|
||||
videoRef: null,
|
||||
videoSrc: null,
|
||||
|
Reference in New Issue
Block a user