[BUG] H5P Interactive Video: Default Text Track Fails to Load Correctly
Issue:
In H5P Interactive Video, the default text track fails to load the correct caption file, even though the caption list correctly displays the intended default caption.
Expected Behavior:
When a default caption is set, H5P should load and display the corresponding text track file.
Actual Behavior:
Despite the default caption being correctly set and displayed in the caption list, H5P incorrectly loads the English (or the first) text track file instead.
Steps to Reproduce:
- Set a specific caption (e.g., Thailand) as the default in the H5P Interactive Video settings.
- Play the video and check the loaded text track.
- Observe that H5P loads the English text track file instead of the intended default.
I initially discovered this error in the Moodle H5P content activity and reported it to the Moodle team (you can find the bug tracking link below).
Link: https://tracker.moodle.org/browse/MDL-84687
However, Moodle closed the report as 'Not a bug,' as the issue stems from H5P itself. Therefore, I am now reporting it directly to H5P.
otacke
Thu, 03/06/2025 - 11:40
Permalink
This is in fact a bug in
This is in fact a bug in Interactive Video (https://github.com/h5p/h5p-interactive-video/blob/6f0d20ea680935612aa278189316c1550c319f3b/src/scripts/interactive-video.js#L624-L641).
I have created a ticket.
The "SelectorControl" is instantiated (line 624), sets the default track visually in the selector and then triggers a `select` event intended for the main class to pick up and change the track for good. The listener to pick up that event, however, is not in place at that time (added in line 639-641). So, depending on the timing, this may work - or not.
This could easily be fixed, but in order to prevent touching things twice, the intended behavior overall should be made clear first, as there's a contradiction:
What's the real intended behavior? HFP-2534 leads me to believe that it is #1, but Svein-Tore mentions in a comment that '"The first text track will be used as the default." is problematic if you want the default to be no text track.' In fact, forcing a text track onto users is what I as a user hate.
Wouldn't this make more sense? (keeping the change small and not adding a "track picker").
As an author, I want to be able to select the default behavior for text tracks to either be "none", "automatic" or "custom" with a specific label.
BV52
Thu, 03/06/2025 - 18:29
Permalink
Thanks Oliver!
Thanks Oliver!
otacke
Thu, 03/06/2025 - 18:45
Permalink
Svein-Tore has already
Svein-Tore has already answered, pull request will be ready later today.
otacke
Thu, 03/06/2025 - 21:35
Permalink
The pull request with the fix
The pull request with the fix is ready. Please take a look at https://h5ptechnology.atlassian.net/browse/HFP-4221 to check progress. It's now in H5P Groups hands.