diff --git a/src/view/com/util/post-embeds/ActiveVideoContext.tsx b/src/view/com/util/post-embeds/ActiveVideoContext.tsx index ddf4fa6615..ecb4af6acf 100644 --- a/src/view/com/util/post-embeds/ActiveVideoContext.tsx +++ b/src/view/com/util/post-embeds/ActiveVideoContext.tsx @@ -8,6 +8,7 @@ import React, { } from 'react' import {useWindowDimensions} from 'react-native' +import {isNative} from '#/platform/detection' import {VideoPlayerProvider} from './VideoPlayerContext' const ActiveVideoContext = React.createContext<{ @@ -28,6 +29,8 @@ export function ActiveVideoProvider({children}: {children: React.ReactNode}) { const measurementCallbacks = useRef DOMRect | void>>({}) useEffect(() => { + if (isNative) return + const findAndActivateVideo = () => { if (Object.keys(measurementCallbacks.current).length === 0) { return diff --git a/src/view/com/util/post-embeds/VideoPlayerContext.tsx b/src/view/com/util/post-embeds/VideoPlayerContext.tsx index bc5d9d370c..3399d11444 100644 --- a/src/view/com/util/post-embeds/VideoPlayerContext.tsx +++ b/src/view/com/util/post-embeds/VideoPlayerContext.tsx @@ -22,7 +22,11 @@ export function VideoPlayerProvider({ // make sure we're playing every time the viewId changes // this means the video is different useEffect(() => { - player.play() + if (viewId === null) { + player.pause() + } else { + player.play() + } }, [viewId, player]) return (