πŸš€ Introducing React Video & Audio Player: A Customisable Media Component for Modern Web Apps

πŸš€ Introducing React Video & Audio Player: A Customisable Media Component for Modern Web Apps

If you are constructing a video platform, podcast app, or simply want versatile media elements – meet your new favorite instrument:

React Video & Audio Player

A light-weight, open-source video & audio participant element constructed with React and styled with TailwindCSS.

It additionally works in plain HTML by way of CDN, with full management over types and performance.

βœ… Features

  • Supports a number of media codecs: MP4, MP3, OGG, WEBM, WAV, and extra
  • Customisable controls: Play, pause, skip, obtain, fullscreen, and quantity
  • Keyboard shortcuts: For accessible and intuitive playback
  • Visual waveform rendering: For audio information
  • Responsive and theme-aware: Styled with TailwindCSS
  • Plug-and-play: Works in React, Next.js, or standalone HTML/JS tasks

πŸ“¦ Installation

npm set up react-video-audio-player

or use CDN:

<script src="https://cdn.jsdelivr.web/npm/react-video-audio-player/dist/index.umd.min.js"></script>
<hyperlink
  rel="stylesheet"
  href="https://cdn.jsdelivr.web/npm/react-video-audio-player/dist/video-audio-player.min.css"
/>

⚑ Quick Usage (React Example)

import { VideoPlayer, AudioPlayer } from 'react-video-audio-player';

perform App() {

  return (
    <VideoPlayer
      src="video.mp4"
    />
     <AudioPlayer
       src="audio.mp3"
    />
  );

}

🧩 Or in plain HTML

<head>
<!-- UMD -->
<script src="https://cdn.jsdelivr.web/npm/react-video-audio-player/dist/index.umd.min.js"></script>
<hyperlink
  rel="stylesheet"
  href="https://cdn.jsdelivr.web/npm/react-video-audio-player/dist/video-audio-player.min.css"
/>
</head>
<physique>
    <div id="video-player-container"></div>
    <div id="audio-player-container"></div>

    <script>
      // Initialise the VideoPlayer
      const videoPlayerContainer = doc.getElementById('video-player-container');
      const videoPlayer = VideoPlayer({
        src: 'video.mp4',
      });
      videoPlayerContainer.appendChild(videoPlayer);

      // Initialise the AudioPlayer
      const audioPlayerContainer = doc.getElementById('audio-player-container');
      const audioPlayer = AudioPlayer({
        src: 'audio.mp3',
      });
      audioPlayerContainer.appendChild(audioPlayer);
    </script>
</physique>

🌐 Useful Links

πŸ™Œ Contribution

I’d love suggestions, contributions, or ideas!

If this element helps your undertaking, a star on GitHub would imply lots.

Thanks for studying – blissful coding!

#ReactJS #WebDev #OpenSource #JavaScript #Frontend #MediaPlayer #AudioPlayer #VideoPlayer #nextjs #react #html

HI-FI News

by way of DEV Community https://dev.to

April 8, 2025 at 06:38PM