An easy-to-use and customizable HLS video player designed to be embedded via an iframe in any project. This player supports dynamic video and subtitle URLs, playback speed control, and responsive design.
- HLS Video Playback: Compatible with HLS video streams using
hls.js. - Subtitles Support: Add WebVTT subtitles dynamically via URL.
- Playback Speed Control: Adjust playback speed directly from the player.
- Responsive Design: The player adjusts to various screen sizes.
- Embeddable: Easily integrate the player into any project using an iframe.
Embed the player with a video and subtitles:
<iframe
src="https://your-hosted-url/iframe-player.html?video=https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8&subtitle=https://example.com/subtitles.vtt"
width="800"
height="450"
style="border: none;"
allowfullscreen>
</iframe>-
Clone the repository:
git clone https://github.com/yourusername/embeddable-hls-player.git cd embeddable-hls-player -
Host the
iframe-player.htmlfile:- Use a static hosting service like GitHub Pages, Vercel, or Netlify.
- Alternatively, serve it locally with any web server (e.g., http-server):
npx http-server
-
Use the hosted URL in your iframe's
srcattribute.
The player accepts the following query parameters:
| Parameter | Description | Example |
|---|---|---|
video |
URL of the HLS video source | https://example.com/video.m3u8 |
subtitle |
URL of the WebVTT subtitle file | https://example.com/subtitles.vtt |
To embed the player in your project, use the following iframe code:
<iframe
src="https://your-hosted-url/iframe-player.html?video=VIDEO_URL&subtitle=SUBTITLE_URL"
width="800"
height="450"
style="border: none;"
allowfullscreen>
</iframe>Replace:
VIDEO_URLwith the URL of your HLS video.SUBTITLE_URLwith the URL of your WebVTT subtitle file (optional).
To modify or extend the player:
- Open
iframe-player.htmlin a text editor. - Update the
scriptsection for additional features or customization. - Test the player locally or deploy it to your hosting environment.
Contributions are welcome! Feel free to fork the repository and submit a pull request.
- Fork the repo
- Create a new branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m "Add your feature" - Push to the branch:
git push origin feature/your-feature - Submit a pull request
This project is licensed under the MIT License.
- Built with Video.js and hls.js.
- Inspired by the need for a lightweight, embeddable video player with modern features.
### Instructions for Hosting
- Replace `https://your-hosted-url/` with the actual URL where the `iframe-player.html` file is hosted.
- Use the player wherever required