diff --git a/app/(auth)/(tabs)/(home,libraries,search)/items/[id].tsx b/app/(auth)/(tabs)/(home,libraries,search)/items/[id].tsx index 02945db5..84958a90 100644 --- a/app/(auth)/(tabs)/(home,libraries,search)/items/[id].tsx +++ b/app/(auth)/(tabs)/(home,libraries,search)/items/[id].tsx @@ -114,6 +114,7 @@ const page: React.FC = () => { audioStreamIndex: selectedAudioStream, subtitleStreamIndex: selectedSubtitleStream, forceDirectPlay: settings?.forceDirectPlay, + height: maxBitrate.height, }); console.log("Transcode URL: ", url); diff --git a/components/BitrateSelector.tsx b/components/BitrateSelector.tsx index d5217611..e029500a 100644 --- a/components/BitrateSelector.tsx +++ b/components/BitrateSelector.tsx @@ -1,11 +1,11 @@ import { TouchableOpacity, View } from "react-native"; import * as DropdownMenu from "zeego/dropdown-menu"; import { Text } from "./common/Text"; -import { atom, useAtom } from "jotai"; export type Bitrate = { key: string; value: number | undefined; + height?: number; }; const BITRATES: Bitrate[] = [ @@ -16,22 +16,27 @@ const BITRATES: Bitrate[] = [ { key: "8 Mb/s", value: 8000000, + height: 1080, }, { - key: "4 Mb/s", + key: "4 Mb/s - 1080p", value: 4000000, + height: 1080, }, { - key: "2 Mb/s", + key: "2 Mb/s - 720p", value: 2000000, + height: 720, }, { - key: "500 Kb/s", + key: "500 Kb/s - 480p", value: 500000, + height: 480, }, { - key: "250 Kb/s", + key: "250 Kb/s - 480p", value: 250000, + height: 480, }, ]; diff --git a/utils/jellyfin/media/getStreamUrl.ts b/utils/jellyfin/media/getStreamUrl.ts index 86587677..6c5a6056 100644 --- a/utils/jellyfin/media/getStreamUrl.ts +++ b/utils/jellyfin/media/getStreamUrl.ts @@ -17,6 +17,7 @@ export const getStreamUrl = async ({ audioStreamIndex = 0, subtitleStreamIndex = 0, forceDirectPlay = false, + height, }: { api: Api | null | undefined; item: BaseItemDto | null | undefined; @@ -28,6 +29,7 @@ export const getStreamUrl = async ({ audioStreamIndex?: number; subtitleStreamIndex?: number; forceDirectPlay?: boolean; + height?: number; }) => { if (!api || !userId || !item?.Id) { return null; @@ -48,12 +50,16 @@ export const getStreamUrl = async ({ AllowVideoStreamCopy: maxStreamingBitrate ? false : true, AudioStreamIndex: audioStreamIndex, SubtitleStreamIndex: subtitleStreamIndex, + DeInterlace: true, + BreakOnNonKeyFrames: false, + CopyTimestamps: false, + EnableMpegtsM2TsMode: false, }, { headers: { Authorization: `MediaBrowser DeviceId="${api.deviceInfo.id}", Token="${api.accessToken}"`, }, - }, + } ); const mediaSource = response.data.MediaSources?.[0] as MediaSourceInfo; @@ -87,7 +93,9 @@ export const getStreamUrl = async ({ EnableRedirection: "true", EnableRemoteMedia: "false", }); - return `${api.basePath}/Audio/${itemId}/universal?${searchParams.toString()}`; + return `${ + api.basePath + }/Audio/${itemId}/universal?${searchParams.toString()}`; } }