chore: fix video element syntax

This commit is contained in:
Steven
2023-10-07 22:01:07 +08:00
parent 087e631dd8
commit 73980e9644
2 changed files with 2 additions and 6 deletions

View File

@ -20,9 +20,7 @@ const MemoResource: React.FC<Props> = (props: Props) => {
<div className={`w-auto flex flex-row justify-start items-center text-gray-500 dark:text-gray-400 hover:opacity-80 ${className}`}> <div className={`w-auto flex flex-row justify-start items-center text-gray-500 dark:text-gray-400 hover:opacity-80 ${className}`}>
{resource.type.startsWith("audio") ? ( {resource.type.startsWith("audio") ? (
<> <>
<audio controls> <audio src={resourceUrl} controls></audio>
<source src={resourceUrl} type={resource.type} />
</audio>
</> </>
) : ( ) : (
<> <>

View File

@ -84,9 +84,7 @@ const MemoResourceListView: React.FC<Props> = (props: Props) => {
const url = getResourceUrl(resource); const url = getResourceUrl(resource);
return ( return (
<SquareDiv key={resource.id} className="memo-resource"> <SquareDiv key={resource.id} className="memo-resource">
<video preload="metadata" controls key={resource.id}> <video preload="metadata" crossOrigin="anonymous" src={absolutifyLink(url)} controls></video>
<source src={absolutifyLink(url)} type={resource.type} />
</video>
</SquareDiv> </SquareDiv>
); );
})} })}