Skip to content

HLS (HTTP Live Streaming) support#157

Open
eduardokraus wants to merge 1 commit intoh5p:masterfrom
EduardoKrausME:master
Open

HLS (HTTP Live Streaming) support#157
eduardokraus wants to merge 1 commit intoh5p:masterfrom
EduardoKrausME:master

Conversation

@eduardokraus
Copy link

@eduardokraus eduardokraus commented Aug 20, 2025

This PR adds support for HLS (HTTP Live Streaming) in the H5P video player.
Now, .m3u8 files can be used as a video source, enabling adaptive playback across different bandwidths and devices.

Main changes:

  • Added automatic detection of .m3u8 URLs.
  • Integrated hls.js for browsers without native HLS support.
  • Kept fallback to the HTML5 player when native support is available (e.g., Safari).
  • Updated the player initialization logic to handle HLS streams transparently for the user.

What I did:

  • The edit was made directly in the original html5.js file of H5P, now rewritten in ES6.
  • The validation now only checks for the .m3u8 extension before verifying if the file has native browser support.
  • There is no need to modify the AV Widget file, especially because H5P html5 does not have a specific entry for it.
  • The tests were performed with both simple and interactive videos, tested standalone as well as inside the Interactive Book resource.
  • Although the [h5p.classes.php](https://github.com/h5p/h5p-php-library/blob/1afd89a8bd1df4843dd946a82aaff35d62fdc507/h5p.classes.php#L2108) file contains the list of allowed extensions, everything worked normally during testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant