From 12f66d77a49547ee7b15941197935644565d5590 Mon Sep 17 00:00:00 2001 From: Alexander Harding Date: Mon, 2 Dec 2024 23:46:02 -0600 Subject: [PATCH] Moooore progress --- src/features/media/InlineMedia.tsx | 2 +- .../media/external/redgifs/redgifsSlice.ts | 2 +- src/features/media/gallery/GalleryMedia.tsx | 8 +++--- .../media/gallery/GalleryProvider.tsx | 19 +++++++++++--- src/features/media/useMediaLoadObserver.ts | 6 ++--- src/features/media/video/Player.module.css | 2 ++ src/features/media/video/Player.tsx | 12 +++++++-- .../media/video/VideoPortalProvider.tsx | 25 +++++++++++-------- .../post/inFeed/large/media/BlurOverlay.tsx | 2 +- src/features/shared/markdown/MarkdownImg.tsx | 5 ++-- 10 files changed, 54 insertions(+), 29 deletions(-) diff --git a/src/features/media/InlineMedia.tsx b/src/features/media/InlineMedia.tsx index c0efe11063..eede53f67f 100644 --- a/src/features/media/InlineMedia.tsx +++ b/src/features/media/InlineMedia.tsx @@ -63,7 +63,7 @@ export default function InlineMedia({ src={src} className={cx(mediaPlaceholderStyles.media, mediaClassName)} style={buildStyle()} - ref={mediaRef} + ref={mediaRef as React.Ref} onError={() => { if (src) dispatch(imageFailed(src)); }} diff --git a/src/features/media/external/redgifs/redgifsSlice.ts b/src/features/media/external/redgifs/redgifsSlice.ts index 499806325c..ee1de3bd66 100644 --- a/src/features/media/external/redgifs/redgifsSlice.ts +++ b/src/features/media/external/redgifs/redgifsSlice.ts @@ -134,7 +134,7 @@ export const getVideoSrc = createAsyncThunk( export const initializeIfNeeded = createAsyncThunk( "redgifs/initialize", async (_, { dispatch }) => { - const providerData = await db.getProvider("redgifs"); + const providerData = (await db.getProvider("redgifs")) as RedgifsProvider; if (!providerData) return; diff --git a/src/features/media/gallery/GalleryMedia.tsx b/src/features/media/gallery/GalleryMedia.tsx index bc46611b5d..74780919d0 100644 --- a/src/features/media/gallery/GalleryMedia.tsx +++ b/src/features/media/gallery/GalleryMedia.tsx @@ -1,18 +1,17 @@ import { PostView } from "lemmy-js-client"; import { PreparedPhotoSwipeOptions } from "photoswipe"; -import { ComponentProps, HTMLProps, MouseEvent, useContext } from "react"; +import { ComponentProps, MouseEvent, useContext } from "react"; import useShouldAutoplay from "#/core/listeners/network/useShouldAutoplay"; import { useAutohidePostIfNeeded } from "#/features/feed/PageTypeContext"; +import Video, { VideoProps } from "#/features/media/video/Video"; import { isUrlPotentialAnimatedImage, isUrlVideo } from "#/helpers/url"; -import Video from "../video/Video"; import GalleryGif from "./GalleryGif"; import GalleryImg from "./GalleryImg"; import { GalleryContext } from "./GalleryProvider"; -export interface GalleryMediaProps - extends Omit, "ref" | "onClick"> { +export interface GalleryMediaProps extends Omit { src?: string; alt?: string; className?: string; @@ -80,6 +79,7 @@ export default function GalleryMedia({ return (