diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-01-21 18:59:13 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-21 18:59:13 +0000 |
commit | 45b5af604a17c42a9999ed94b8e981259f2cc2d1 (patch) | |
tree | 70a63aba8ef5ce6ce89986adf4611bea154147e8 /src/screens | |
parent | bdda3020f6ef8ef130580eb458ed734ae55b54ad (diff) | |
download | voidsky-45b5af604a17c42a9999ed94b8e981259f2cc2d1.tar.zst |
render adjacent players on ios (#7525)
Diffstat (limited to 'src/screens')
-rw-r--r-- | src/screens/VideoFeed/index.tsx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/screens/VideoFeed/index.tsx b/src/screens/VideoFeed/index.tsx index 7453aa5d4..b8403b737 100644 --- a/src/screens/VideoFeed/index.tsx +++ b/src/screens/VideoFeed/index.tsx @@ -76,7 +76,7 @@ import {List} from '#/view/com/util/List' import {PostCtrls} from '#/view/com/util/post-ctrls/PostCtrls' import {UserAvatar} from '#/view/com/util/UserAvatar' import {Header} from '#/screens/VideoFeed/components/Header' -import {atoms as a, platform, ThemeProvider, useTheme} from '#/alf' +import {atoms as a, ios, platform, ThemeProvider, useTheme} from '#/alf' import {setNavigationBar} from '#/alf/util/navigationBar' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {Divider} from '#/components/Divider' @@ -261,6 +261,7 @@ function Feed() { index === currentIndex && currentSource?.source === post.embed.playlist } + adjacent={index === currentIndex - 1 || index === currentIndex + 1} moderation={item.moderation} scrollGesture={scrollGesture} feedContext={item.feedContext} @@ -460,6 +461,7 @@ let VideoItem = ({ post, embed, active, + adjacent, scrollGesture, moderation, feedContext, @@ -468,6 +470,7 @@ let VideoItem = ({ post: AppBskyFeedDefs.PostView embed: AppBskyEmbedVideo.View active: boolean + adjacent: boolean scrollGesture: NativeGesture moderation?: ModerationDecision feedContext: string | undefined @@ -486,6 +489,11 @@ let VideoItem = ({ } }, [active, post.uri, feedContext, sendInteraction]) + // TODO: high-performance android phones should also + // be capable of rendering 3 video players, but currently + // we can't distinguish between them + const shouldRenderVideo = active || ios(adjacent) + return ( <View style={[a.relative, {height, width}]}> {postShadow === POST_TOMBSTONE ? ( @@ -512,7 +520,9 @@ let VideoItem = ({ ) : ( <> <VideoItemPlaceholder embed={embed} /> - {active && player && <VideoItemInner player={player} embed={embed} />} + {shouldRenderVideo && player && ( + <VideoItemInner player={player} embed={embed} /> + )} {moderation && ( <Overlay player={player} |