LivePlayer.tsx 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. 'use client';
  2. import { useState } from 'react';
  3. import type { BroadcastInfo } from '@/types/broadcast';
  4. import styles from './LivePlayer.module.scss';
  5. interface LivePlayerProps {
  6. broadcast: BroadcastInfo;
  7. }
  8. export default function LivePlayer({ broadcast }: LivePlayerProps) {
  9. const [isPlaying, setIsPlaying] = useState(true);
  10. return (
  11. <div className={styles.playerContainer}>
  12. {/* 비디오 플레이어 영역 */}
  13. <div className={styles.videoPlayer}>
  14. {/* 플레이어 배경 */}
  15. <div className={styles.playerBackground}>
  16. {/* 중앙 비디오 아이콘 */}
  17. <div className={styles.centerIcon}>
  18. <svg width="48" height="48" fill="currentColor" viewBox="0 0 24 24">
  19. <path d="M15 8v8H5V8h10m1-2H4a1 1 0 00-1 1v10a1 1 0 001 1h12a1 1 0 001-1V7a1 1 0 00-1-1z"/>
  20. <path d="M18 6h2a1 1 0 011 1v10a1 1 0 01-1 1h-2"/>
  21. </svg>
  22. </div>
  23. </div>
  24. {/* 플레이어 오버레이 컨트롤 */}
  25. <div className={styles.playerOverlay}>
  26. {/* 재생/일시정지 버튼 (중앙) */}
  27. <button
  28. className={styles.playButton}
  29. onClick={() => setIsPlaying(!isPlaying)}
  30. >
  31. {isPlaying ? (
  32. <svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
  33. <path d="M6 4h4v16H6V4zm8 0h4v16h-4V4z"/>
  34. </svg>
  35. ) : (
  36. <svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
  37. <path d="M8 5v14l11-7z"/>
  38. </svg>
  39. )}
  40. </button>
  41. {/* 하단 컨트롤 바 */}
  42. <div className={styles.controlBar}>
  43. {/* 진행 바 */}
  44. <div className={styles.progressBar}>
  45. <div className={styles.progressFill} style={{ width: '35%' }}></div>
  46. </div>
  47. {/* 컨트롤 버튼들 */}
  48. <div className={styles.controls}>
  49. <div className={styles.leftControls}>
  50. <button className={styles.controlBtn}>
  51. <svg width="20" height="20" fill="currentColor" viewBox="0 0 24 24">
  52. <path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/>
  53. </svg>
  54. </button>
  55. <span className={styles.timeDisplay}>LIVE</span>
  56. </div>
  57. <div className={styles.rightControls}>
  58. <button className={styles.controlBtn}>
  59. <svg width="20" height="20" fill="currentColor" viewBox="0 0 24 24">
  60. <path d="M19 12h-2v3h-3v2h5v-5zM7 9h3V7H5v5h2V9zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/>
  61. </svg>
  62. </button>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. );
  70. }