diff --git a/frontend/src/pages/posts/PostDetailPage.tsx b/frontend/src/pages/posts/PostDetailPage.tsx index 828e09e..741f8dd 100644 --- a/frontend/src/pages/posts/PostDetailPage.tsx +++ b/frontend/src/pages/posts/PostDetailPage.tsx @@ -1,6 +1,6 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query' import { motion } from 'framer-motion' -import { useEffect, useState } from 'react' +import { useEffect, useRef, useState } from 'react' import { Helmet } from 'react-helmet-async' import { useParams } from 'react-router-dom' @@ -21,7 +21,7 @@ import ServiceUnavailable from '@/pages/ServiceUnavailable' import type { FC } from 'react' -import type { User } from '@/types' +import type { NiconicoViewerHandle, User } from '@/types' type Props = { user: User | null } @@ -38,6 +38,8 @@ export default (({ user }: Props) => { const qc = useQueryClient () + const embedRef = useRef (null) + const [status, setStatus] = useState (200) const changeViewedFlg = useMutation ({ @@ -120,7 +122,10 @@ export default (({ user }: Props) => { className="object-cover w-full h-full"/> )} - + embedRef.current?.play ()}/>