コミットを比較
1
コミット
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
de34063fc5 |
@@ -196,10 +196,9 @@ const PostEmbed: FC<Props> = (
|
|||||||
return <TwitterEmbed userId={userId} statusId={statusId}/>
|
return <TwitterEmbed userId={userId} statusId={statusId}/>
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'bilibili.com':
|
case 'tiktok.com':
|
||||||
{
|
{
|
||||||
const videoId = url.pathname.match (
|
const videoId = url.pathname.match (/^\/@[^/]+\/video\/(\d+)\/?$/)?.[1]
|
||||||
/^\/video\/(BV[a-zA-Z0-9]{10}|av[1-9]\d*)\/?$/)?.[1]
|
|
||||||
if (!(videoId))
|
if (!(videoId))
|
||||||
break
|
break
|
||||||
|
|
||||||
@@ -208,24 +207,13 @@ const PostEmbed: FC<Props> = (
|
|||||||
if (shouldLoadEmbed === false)
|
if (shouldLoadEmbed === false)
|
||||||
return manualLoadControl
|
return manualLoadControl
|
||||||
|
|
||||||
const playerUrl = new URL ('https://player.bilibili.com/player.html')
|
|
||||||
const parameter = videoId.startsWith ('BV') ? 'bvid' : 'aid'
|
|
||||||
const identifier = parameter === 'bvid' ? videoId : videoId.slice (2)
|
|
||||||
playerUrl.searchParams.set (parameter, identifier)
|
|
||||||
playerUrl.searchParams.set ('autoplay', '1')
|
|
||||||
|
|
||||||
const page = url.searchParams.get ('p')
|
|
||||||
if (page != null && /^[1-9]\d*$/.test (page))
|
|
||||||
playerUrl.searchParams.set ('p', page)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<iframe
|
<iframe
|
||||||
src={playerUrl.toString ()}
|
src={`https://www.tiktok.com/player/v1/${ encodeURIComponent (videoId) }`}
|
||||||
title={post.title || post.url}
|
title={post.title || post.url}
|
||||||
width={640}
|
width={325}
|
||||||
height={360}
|
height={578}
|
||||||
className="aspect-video h-auto max-w-full"
|
className="max-w-full"
|
||||||
allow="autoplay; fullscreen"
|
|
||||||
allowFullScreen/>)
|
allowFullScreen/>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
新しいイシューから参照
ユーザーをブロックする