mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 12:23:24 +00:00
chore: more cleanup
This commit is contained in:
@@ -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":
|
||||||
|
@@ -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(),
|
||||||
|
Reference in New Issue
Block a user