このコミットが含まれているのは:
@@ -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">
|
||||
|
||||
新しい課題から参照
ユーザをブロックする