mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 18:13:25 +00:00
chore: add this for when I find media with tracks
This commit is contained in:
@@ -15,7 +15,7 @@ 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 { ScrapeMedia, Stream } from "@movie-web/provider-utils";
|
||||||
import { findHighestQuality } from "@movie-web/provider-utils";
|
import { extractTracksFromHLS, findHighestQuality } from "@movie-web/provider-utils";
|
||||||
|
|
||||||
import type { ItemData } from "~/components/item/item";
|
import type { ItemData } from "~/components/item/item";
|
||||||
import type { HeaderData } from "~/components/player/Header";
|
import type { HeaderData } from "~/components/player/Header";
|
||||||
@@ -166,6 +166,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({ data }) => {
|
|||||||
|
|
||||||
let highestQuality;
|
let highestQuality;
|
||||||
let url;
|
let url;
|
||||||
|
let tracks;
|
||||||
|
|
||||||
switch (stream.type) {
|
switch (stream.type) {
|
||||||
case "file":
|
case "file":
|
||||||
@@ -174,13 +175,12 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({ data }) => {
|
|||||||
return url ?? null;
|
return url ?? null;
|
||||||
case "hls":
|
case "hls":
|
||||||
url = stream.playlist;
|
url = stream.playlist;
|
||||||
|
tracks = await extractTracksFromHLS(url, { ...stream.preferredHeaders, ...stream.headers });
|
||||||
}
|
}
|
||||||
|
|
||||||
// setTextTracks(
|
if (tracks) {
|
||||||
// stream.captions && stream.captions.length > 0
|
console.log(tracks);
|
||||||
// ? convertCaptionsToTextTracks(stream.captions)
|
}
|
||||||
// : [],
|
|
||||||
// );
|
|
||||||
|
|
||||||
setVideoSrc({
|
setVideoSrc({
|
||||||
uri: url,
|
uri: url,
|
||||||
|
Reference in New Issue
Block a user