Try use dangerouslySetInnerHTML again

And… fix the loop attribute value
pull/451/merge
Lim Chee Aun 2024-06-11 23:43:55 +08:00
rodzic 983dd6623f
commit febd04dd54
1 zmienionych plików z 20 dodań i 16 usunięć

Wyświetl plik

@ -426,7 +426,7 @@ function Media({
autoplay
muted
playsinline
loop="${loopable}"
${loopable ? 'loop' : ''}
ondblclick="this.paused ? this.play() : this.pause()"
${
showProgress
@ -436,6 +436,21 @@ function Media({
></video>
`;
const videoHTML = `
<video
src="${url}"
poster="${previewUrl}"
width="${width}"
height="${height}"
data-orientation="${orientation}"
preload="auto"
autoplay
playsinline
${loopable ? 'loop' : ''}
controls
></video>
`;
return (
<Figure>
<Parent
@ -508,21 +523,10 @@ function Media({
}}
/>
) : (
<div class="video-container">
<video
slot="media"
src={url}
poster={previewUrl}
width={width}
height={height}
data-orientation={orientation}
preload="auto"
autoPlay
playsinline
loop={loopable}
controls
></video>
</div>
<div
class="video-container"
dangerouslySetInnerHTML={{ __html: videoHTML }}
/>
)
) : isGIF ? (
<video