Update files
This commit is contained in:
parent
b244fdcf13
commit
73c91b4ec5
|
|
@ -347,6 +347,13 @@
|
|||
pointer-events: none;
|
||||
}
|
||||
|
||||
.viewer-content video {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
background: black;
|
||||
}
|
||||
|
||||
.swipe-hint {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,12 @@ export default function Search({ user }) {
|
|||
const touchStartX = useRef(0)
|
||||
const touchEndX = useRef(0)
|
||||
|
||||
const isVideoUrl = (url = '') => {
|
||||
if (!url) return false
|
||||
const clean = url.split('?')[0].toLowerCase()
|
||||
return clean.endsWith('.mp4') || clean.endsWith('.webm') || clean.endsWith('.mov') || clean.endsWith('.m4v')
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (query.length > 1) {
|
||||
loadTagSuggestions()
|
||||
|
|
@ -476,11 +482,24 @@ export default function Search({ user }) {
|
|||
onTouchMove={handleTouchMove}
|
||||
onTouchEnd={handleTouchEnd}
|
||||
>
|
||||
{isVideoUrl(results[currentIndex].url) ? (
|
||||
<video
|
||||
src={results[currentIndex].url}
|
||||
controls
|
||||
autoPlay
|
||||
loop
|
||||
muted
|
||||
playsInline
|
||||
poster={results[currentIndex].preview}
|
||||
draggable={false}
|
||||
/>
|
||||
) : (
|
||||
<img
|
||||
src={results[currentIndex].url}
|
||||
alt="Full view"
|
||||
draggable={false}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Индикатор свайпа */}
|
||||
<div className="swipe-hint">
|
||||
|
|
|
|||
Loading…
Reference in New Issue