Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
sujata
/
Akruti-Frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 1707ea57
authored
2026-03-12 17:28:10 +0530
by
Ravindra Kanojiya
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
updated video or image option both in video section
1 parent
0c70de15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
components/Collection/Video.js
components/Collection/Video.js
View file @
1707ea5
...
...
@@ -11,6 +11,9 @@ const Video = ({ productData }) => {
const
isVideo
=
media
?.
mime
?.
startsWith
(
"video/"
);
const
isImage
=
media
?.
mime
?.
startsWith
(
"image/"
);
// ✅ Strapi default image path
const
defaultImage
=
"/image/default.svg"
;
useEffect
(()
=>
{
const
observer
=
new
IntersectionObserver
(
([
entry
])
=>
{
...
...
@@ -29,8 +32,6 @@ const Video = ({ productData }) => {
};
},
[]);
if
(
!
media
?.
url
)
return
null
;
return
(
<
section
className
=
"video_sec"
>
<
div
className
=
"custom_containers"
>
...
...
@@ -46,7 +47,6 @@ const Video = ({ productData }) => {
className
=
{
`w-100 video-animate
${
isVisible
?
"video-visible"
:
""
}
`
}
>
<
source
src
=
{
cleanImage
(
media
?.
url
)}
type
=
{
media
?.
mime
||
"video/mp4"
}
/
>
Your
browser
does
not
support
the
video
tag
.
<
/video
>
)}
...
...
@@ -58,11 +58,26 @@ const Video = ({ productData }) => {
>
<
Image
src
=
{
cleanImage
(
media
?.
url
)}
alt
=
{
media
?.
alternativeText
||
media
?.
name
||
"Media"
}
alt
=
{
media
?.
alternativeText
||
"Media"
}
width
=
{
media
?.
width
||
868
}
height
=
{
media
?.
height
||
560
}
className
=
"w-100"
style
=
{{
objectFit
:
"cover"
}}
/
>
<
/div
>
)}
{
/* DEFAULT IMAGE */
}
{
!
media
&&
(
<
div
ref
=
{
mediaRef
}
className
=
{
`w-100 video-animate
${
isVisible
?
"video-visible"
:
""
}
`
}
>
<
Image
src
=
{
cleanImage
()}
alt
=
"Default Image"
width
=
{
868
}
height
=
{
560
}
className
=
"w-100"
/
>
<
/div
>
)}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment