mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-28 20:29:18 +03:00
Try use dangerouslySetInnerHTML again
And… fix the loop attribute value
This commit is contained in:
parent
983dd6623f
commit
febd04dd54
1 changed files with 20 additions and 16 deletions
|
@ -426,7 +426,7 @@ function Media({
|
||||||
autoplay
|
autoplay
|
||||||
muted
|
muted
|
||||||
playsinline
|
playsinline
|
||||||
loop="${loopable}"
|
${loopable ? 'loop' : ''}
|
||||||
ondblclick="this.paused ? this.play() : this.pause()"
|
ondblclick="this.paused ? this.play() : this.pause()"
|
||||||
${
|
${
|
||||||
showProgress
|
showProgress
|
||||||
|
@ -436,6 +436,21 @@ function Media({
|
||||||
></video>
|
></video>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const videoHTML = `
|
||||||
|
<video
|
||||||
|
src="${url}"
|
||||||
|
poster="${previewUrl}"
|
||||||
|
width="${width}"
|
||||||
|
height="${height}"
|
||||||
|
data-orientation="${orientation}"
|
||||||
|
preload="auto"
|
||||||
|
autoplay
|
||||||
|
playsinline
|
||||||
|
${loopable ? 'loop' : ''}
|
||||||
|
controls
|
||||||
|
></video>
|
||||||
|
`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Figure>
|
<Figure>
|
||||||
<Parent
|
<Parent
|
||||||
|
@ -508,21 +523,10 @@ function Media({
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div class="video-container">
|
<div
|
||||||
<video
|
class="video-container"
|
||||||
slot="media"
|
dangerouslySetInnerHTML={{ __html: videoHTML }}
|
||||||
src={url}
|
/>
|
||||||
poster={previewUrl}
|
|
||||||
width={width}
|
|
||||||
height={height}
|
|
||||||
data-orientation={orientation}
|
|
||||||
preload="auto"
|
|
||||||
autoPlay
|
|
||||||
playsinline
|
|
||||||
loop={loopable}
|
|
||||||
controls
|
|
||||||
></video>
|
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
) : isGIF ? (
|
) : isGIF ? (
|
||||||
<video
|
<video
|
||||||
|
|
Loading…
Add table
Reference in a new issue