VideoIntroduction.tsx 943 B

12345678910111213141516171819202122232425262728
  1. import React from 'react';
  2. interface VideoIntroductionProps {
  3. videoUrl: string;
  4. posterUrl: string;
  5. }
  6. const VideoIntroduction: React.FC<VideoIntroductionProps> = ({ videoUrl, posterUrl }) => {
  7. return (
  8. <div className="bg-white rounded-2xl border border-slate-200 p-6">
  9. <h2 className="text-xl font-bold text-slate-800 mb-4">Video Introduction</h2>
  10. <div className="aspect-video w-full">
  11. <video
  12. controls
  13. poster={posterUrl}
  14. className="w-full h-full rounded-lg object-cover shadow-md bg-slate-200"
  15. preload="metadata"
  16. aria-label="Video Introduction"
  17. >
  18. <source src={videoUrl} type="video/mp4" />
  19. <p>Your browser does not support the video tag. You can <a href={videoUrl} download className="text-blue-600 hover:underline">download the video</a> instead.</p>
  20. </video>
  21. </div>
  22. </div>
  23. );
  24. };
  25. export default VideoIntroduction;