From 6224f8b92d5631249b15768e94791b271f475194 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Mon, 18 Nov 2024 09:09:25 +0100 Subject: [PATCH] fix: use correct device profile for android --- app/(auth)/player/player.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/(auth)/player/player.tsx b/app/(auth)/player/player.tsx index 300aa4fc..8b1e9847 100644 --- a/app/(auth)/player/player.tsx +++ b/app/(auth)/player/player.tsx @@ -16,6 +16,7 @@ import { getBackdropUrl } from "@/utils/jellyfin/image/getBackdropUrl"; import { getStreamUrl } from "@/utils/jellyfin/media/getStreamUrl"; import { writeToLog } from "@/utils/log"; import native from "@/utils/profiles/native"; +import android from "@/utils/profiles/android"; import { msToTicks, ticksToMs } from "@/utils/time"; import { Api } from "@jellyfin/sdk"; import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; @@ -28,7 +29,13 @@ import * as Haptics from "expo-haptics"; import { useLocalSearchParams } from "expo-router"; import { useAtomValue } from "jotai"; import React, { useCallback, useMemo, useRef, useState } from "react"; -import { Alert, Pressable, useWindowDimensions, View } from "react-native"; +import { + Alert, + Platform, + Pressable, + useWindowDimensions, + View, +} from "react-native"; import { useSharedValue } from "react-native-reanimated"; export default function page() { @@ -112,7 +119,7 @@ export default function page() { maxStreamingBitrate: bitrateValue, mediaSourceId: mediaSourceId, subtitleStreamIndex: subtitleIndex, - deviceProfile: native, + deviceProfile: Platform.OS === "android" ? android : native, }); if (!res) return null; @@ -121,8 +128,6 @@ export default function page() { if (!sessionId || !mediaSource || !url) return null; - console.log(url); - return { mediaSource, sessionId, @@ -153,7 +158,7 @@ export default function page() { : "DirectStream", playSessionId: stream.sessionId, }); - console.log("ACtually marked as paused"); + console.log("Actually marked as paused"); } else { videoRef.current?.play(); await getPlaystateApi(api).onPlaybackProgress({