chore: more cleanup

This commit is contained in:
Adrian Castro
2024-02-15 20:09:19 +01:00
parent 53106d8b7b
commit b3dbb7f334
2 changed files with 4 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ import * as NavigationBar from "expo-navigation-bar";
import { useLocalSearchParams, useRouter } from "expo-router"; import { useLocalSearchParams, useRouter } from "expo-router";
import * as StatusBar from "expo-status-bar"; import * as StatusBar from "expo-status-bar";
import type { ScrapeMedia, Stream } from "@movie-web/provider-utils"; import type { HLSTracks, ScrapeMedia, Stream } from "@movie-web/provider-utils";
import { import {
extractTracksFromHLS, extractTracksFromHLS,
findHighestQuality, findHighestQuality,
@@ -169,7 +169,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({ data }) => {
let highestQuality; let highestQuality;
let url; let url;
let _tracks; let _tracks: HLSTracks | null;
switch (stream.type) { switch (stream.type) {
case "file": case "file":

View File

@@ -106,7 +106,7 @@ export function findHighestQuality(
return undefined; return undefined;
} }
export interface HLSPlaylist { export interface HLSTracks {
video: Item[]; video: Item[];
audio: Item[]; audio: Item[];
subtitles: Item[]; subtitles: Item[];
@@ -115,7 +115,7 @@ export interface HLSPlaylist {
export async function extractTracksFromHLS( export async function extractTracksFromHLS(
playlistUrl: string, playlistUrl: string,
headers: Record<string, string>, headers: Record<string, string>,
): Promise<HLSPlaylist | null> { ): Promise<HLSTracks | null> {
try { try {
const response = await fetch(playlistUrl, { headers }).then((res) => const response = await fetch(playlistUrl, { headers }).then((res) =>
res.text(), res.text(),