mostly fix android flicker
This commit is contained in:
committed by
Eric Bailey
parent
05daef9c70
commit
be48da87cb
@@ -22,7 +22,7 @@ import Animated, {
|
|||||||
withTiming,
|
withTiming,
|
||||||
} from 'react-native-reanimated'
|
} from 'react-native-reanimated'
|
||||||
import {SafeAreaView, useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {SafeAreaView, useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {useEventListener} from 'expo'
|
import {useEvent, useEventListener} from 'expo'
|
||||||
import {Image, ImageStyle} from 'expo-image'
|
import {Image, ImageStyle} from 'expo-image'
|
||||||
import {LinearGradient} from 'expo-linear-gradient'
|
import {LinearGradient} from 'expo-linear-gradient'
|
||||||
import {createVideoPlayer, VideoPlayer, VideoView} from 'expo-video'
|
import {createVideoPlayer, VideoPlayer, VideoView} from 'expo-video'
|
||||||
@@ -49,6 +49,7 @@ import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
|||||||
import {CommonNavigatorParams, NavigationProp} from '#/lib/routes/types'
|
import {CommonNavigatorParams, NavigationProp} from '#/lib/routes/types'
|
||||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||||
|
import {isAndroid} from '#/platform/detection'
|
||||||
import {POST_TOMBSTONE, Shadow, usePostShadow} from '#/state/cache/post-shadow'
|
import {POST_TOMBSTONE, Shadow, usePostShadow} from '#/state/cache/post-shadow'
|
||||||
import {usePostLikeMutationQueue} from '#/state/queries/post'
|
import {usePostLikeMutationQueue} from '#/state/queries/post'
|
||||||
import {FeedPostSliceItem, usePostFeedQuery} from '#/state/queries/post-feed'
|
import {FeedPostSliceItem, usePostFeedQuery} from '#/state/queries/post-feed'
|
||||||
@@ -404,7 +405,6 @@ function VideoItem({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO maybe unused
|
|
||||||
function VideoItemInner({
|
function VideoItemInner({
|
||||||
player,
|
player,
|
||||||
embed,
|
embed,
|
||||||
@@ -414,19 +414,17 @@ function VideoItemInner({
|
|||||||
embed: AppBskyEmbedVideo.View
|
embed: AppBskyEmbedVideo.View
|
||||||
active: boolean
|
active: boolean
|
||||||
}) {
|
}) {
|
||||||
// const {status} = useEvent(player, 'statusChange', {status: player.status})
|
const {status} = useEvent(player, 'statusChange', {status: player.status})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/*
|
|
||||||
<VideoItemPlaceholder embed={embed} style={{
|
|
||||||
zIndex: status === 'loading' && isAndroid ? 1 : -1,
|
|
||||||
}} />
|
|
||||||
*/}
|
|
||||||
|
|
||||||
{active && player && (
|
{active && player && (
|
||||||
<VideoView
|
<VideoView
|
||||||
style={[a.absolute, a.inset_0]}
|
style={[
|
||||||
|
a.absolute,
|
||||||
|
a.inset_0,
|
||||||
|
isAndroid && status === 'loading' && {opacity: 0},
|
||||||
|
]}
|
||||||
player={player}
|
player={player}
|
||||||
nativeControls={false}
|
nativeControls={false}
|
||||||
contentFit={
|
contentFit={
|
||||||
|
|||||||
Reference in New Issue
Block a user