Sort qualites on android

This commit is contained in:
Zoe Roux 2024-03-31 23:08:06 +02:00
parent a8d29b5b26
commit 0008aa95c2
No known key found for this signature in database

View File

@ -174,17 +174,19 @@ export const QualitiesMenu = (props: CustomMenu) => {
/>
{/* TODO: Support video tracks when the play mode is not hls. */}
{/* @ts-expect-error They forgot to type this. */}
{info?.videoTracks.map((x) => (
<Menu.Item
key={x.height}
label={`${x.height}p`}
selected={video === x.height}
onSelect={() => {
setPlayMode(PlayMode.Hls);
setVideo(x.height);
}}
/>
))}
{info?.videoTracks
.sort((a: any, b: any) => b.height - a.height)
.map((x: any, i: number) => (
<Menu.Item
key={i}
label={`${x.height}p`}
selected={video === x.height}
onSelect={() => {
setPlayMode(PlayMode.Hls);
setVideo(x.height);
}}
/>
))}
</Menu>
);
};