このコミットが含まれているのは:
2026-06-07 01:24:44 +09:00
コミット 39d86f4778
4個のファイルの変更33行の追加33行の削除
+15 -4
ファイルの表示
@@ -22,6 +22,7 @@ import { useValidationErrors } from '@/lib/useValidationErrors'
import type { FC, FormEvent, ReactNode } from 'react'
import type { NiconicoMetadata,
NiconicoVideoInfo,
NiconicoViewerHandle,
Post,
Category,
@@ -459,6 +460,19 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
await advancePost ()
}
const handleNiconicoLoadComplete = (info: NiconicoVideoInfo) => {
const lengthMs = info.lengthInSeconds * 1_000
setVideoLength (lengthMs)
if (lengthMs <= 0)
{
void handlePlaybackError ()
return
}
embedRef.current?.play ()
}
const handleSkipVote = async () => {
if (!(id) || !(post))
return
@@ -797,10 +811,7 @@ const TheatreDetailPage: FC<Props> = ({ user }: Props) => {
key={post.id}
ref={embedRef}
post={post}
onLoadComplete={info => {
embedRef.current?.play ()
setVideoLength (info.lengthInSeconds * 1_000)
}}
onLoadComplete={handleNiconicoLoadComplete}
onMetadataChange={syncPlayback}
onError={handlePlaybackError}/>) : (
<div className="grid min-h-72 place-items-center text-zinc-400">