ameerazam08 commited on
Commit
bb62f4c
1 Parent(s): 98d687b

video and image

Browse files
Files changed (1) hide show
  1. src/components/about-card.tsx +18 -2
src/components/about-card.tsx CHANGED
@@ -25,14 +25,27 @@ export function AboutCard({ title, description, subTitle,imageName,paper_links }
25
  {title}
26
 
27
  </Typography>
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- <Image
30
  src={`/paper_image/${imageName}`}
31
  width={500}
32
  height={500}
33
  alt="next/image"
34
 
35
- />
36
  <Typography variant="h6" className="mb-4 text-center" color="white" placeholder="">
37
 
38
  {subTitle}
@@ -60,5 +73,8 @@ export function AboutCard({ title, description, subTitle,imageName,paper_links }
60
  );
61
  }
62
 
 
 
 
63
 
64
  export default AboutCard;
 
25
  {title}
26
 
27
  </Typography>
28
+ {isVideo(imageName) ? (
29
+ <video width="500" height="500" controls>
30
+ <source src={`/paper_image/${imageName}`} type="video/mp4" />
31
+ Your browser does not support the video tag.
32
+ </video>
33
+ ) : (
34
+ <Image
35
+ src={`/paper_image/${imageName}`}
36
+ width={500}
37
+ height={500}
38
+ alt="next/image"
39
+ />
40
+ )}
41
 
42
+ {/* <Image
43
  src={`/paper_image/${imageName}`}
44
  width={500}
45
  height={500}
46
  alt="next/image"
47
 
48
+ /> */}
49
  <Typography variant="h6" className="mb-4 text-center" color="white" placeholder="">
50
 
51
  {subTitle}
 
73
  );
74
  }
75
 
76
+ function isVideo(filename) {
77
+ return ['.mp4', '.webm', '.ogg'].some(extension => filename.endsWith(extension));
78
+ }
79
 
80
  export default AboutCard;