Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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.

License

Notifications You must be signed in to change notification settings

avinashkranjan/HLS_VideoPlayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Embeddable HLS Video Player with Subtitles

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.

Features

  • 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.

Demo

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>

Installation and Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/embeddable-hls-player.git
    cd embeddable-hls-player
  2. Host the iframe-player.html file:

  3. Use the hosted URL in your iframe's src attribute.

Query Parameters

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

Usage

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_URL with the URL of your HLS video.
  • SUBTITLE_URL with the URL of your WebVTT subtitle file (optional).

Dependencies

  • Video.js: A powerful HTML5 video player.
  • hls.js: JavaScript library for HLS playback.

Development

To modify or extend the player:

  1. Open iframe-player.html in a text editor.
  2. Update the script section for additional features or customization.
  3. Test the player locally or deploy it to your hosting environment.

Contributing

Contributions are welcome! Feel free to fork the repository and submit a pull request.

  1. Fork the repo
  2. Create a new branch: git checkout -b feature/your-feature
  3. Commit your changes: git commit -m "Add your feature"
  4. Push to the branch: git push origin feature/your-feature
  5. Submit a pull request

License

This project is licensed under the MIT License.

Screenshots

Player Interface

Player Interface

Embedded Example

Embedded Example

Acknowledgments

  • 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

About

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.

Resources

License

Stars

Watchers

Forks

Languages