diff --git a/components/common/posts/PostsFeed.tsx b/components/common/posts/PostsFeed.tsx index 8cf6e31..4bc2b68 100644 --- a/components/common/posts/PostsFeed.tsx +++ b/components/common/posts/PostsFeed.tsx @@ -224,12 +224,12 @@ export function PostEmbeds({ item }: { item: AppBskyFeedDefs.FeedViewPost }) { ? item.post.embed.media : item.post.embed - const imageRequiresBlur = doesLabelNeedBlur( + const mediaRequiresBlur = doesLabelNeedBlur( item.post.labels?.map(({ val }) => val), ) const imageClassName = classNames( `border border-gray-200 rounded`, - imageRequiresBlur ? 'blur-sm hover:blur-none' : '', + mediaRequiresBlur ? 'blur-sm hover:blur-none' : '', ) if (AppBskyEmbedVideo.isView(embed)) { @@ -240,6 +240,7 @@ export function PostEmbeds({ item }: { item: AppBskyFeedDefs.FeedViewPost }) { source={embed.playlist} thumbnail={embed.thumbnail} alt={embed.alt} + shouldBlur={mediaRequiresBlur} captions={captions ? (captions as AppBskyEmbedVideo.Caption[]) : []} /> diff --git a/components/common/posts/PostsTable.tsx b/components/common/posts/PostsTable.tsx index 53b76d6..4ecff4a 100644 --- a/components/common/posts/PostsTable.tsx +++ b/components/common/posts/PostsTable.tsx @@ -141,12 +141,12 @@ function PostEmbeds({ item }: { item: AppBskyFeedDefs.FeedViewPost }) { const embed = AppBskyEmbedRecordWithMedia.isView(item.post.embed) ? item.post.embed.media : item.post.embed - const imageRequiresBlur = doesLabelNeedBlur( + const mediaRequiresBlur = doesLabelNeedBlur( item.post.labels?.map(({ val }) => val), ) const imageClassName = classNames( `border border-gray-200 rounded`, - imageRequiresBlur ? 'blur-sm hover:blur-none' : '', + mediaRequiresBlur ? 'blur-sm hover:blur-none' : '', ) if (AppBskyEmbedImages.isView(embed)) { diff --git a/components/common/video/player.tsx b/components/common/video/player.tsx index b20a9e3..609cb08 100644 --- a/components/common/video/player.tsx +++ b/components/common/video/player.tsx @@ -8,14 +8,17 @@ export default function VideoPlayer({ alt, thumbnail, captions, + shouldBlur = false, }: { source: string alt?: string thumbnail?: string captions: AppBskyEmbedVideo.Caption[] + shouldBlur?: boolean }) { const [hls] = useState(() => new Hls()) const [isUnsupported, setIsUnsupported] = useState(false) + const [isHovered, setIsHovered] = useState(false) const figId = useId() const ref = useRef(null) @@ -41,19 +44,28 @@ export default function VideoPlayer({ }, [source, hls]) return ( -
+
setIsHovered(true)} + onMouseLeave={() => setIsHovered(false)} + >