Bug: `default-hidden-captions` attribute not working when using custom subtitles
Is there an existing issue for this?
- [x] I have searched the existing issues
Which Mux Elements/Packages does this apply to? Select all that apply
mux-player
Which browsers are you using?
Chrome, Safari, Firefox
Which operating systems are you using?
macOS
Description
When using custom subtitles that are not embedded inside a video, default-hidden-captions attribute does not work as expected.
In some cases, the subtitles will still be selected and shown.
And in other cases, subtitle will not be shown, but it will be selected inside the subtitle sub-menu. Requiring the user to first turn subtitles off and then select the subtitle again in order to have the subtitles shown inside the player.
Reduced test case
https://8cnj54-5173.csb.app/
Steps to reproduce
Code example
<mux-player
playback-id="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
metadata-video-title="Big Buck Bunny"
metadata-viewer-user-id="user-id-1234"
default-hidden-captions>
<track
src="https://raw.githubusercontent.com/brenopolanski/html5-video-webvtt-example/refs/heads/master/MIB2-subtitles-pt-BR.vtt"
kind="subtitles"
srclang="en"
label="English" />
</mux-player>
Current Behavior
When using custom external subtitles, default-hidden-captions attribute doesn't turn off subtitles by default.
Expected Behavior
When using custom external subtitles, default-hidden-captions attribute should turn subtitles off by default.
Errors
No response
What version of the package are you using?
No response
Hey @nikola-zitko , thanks for reporting this issue. We were able to reproduce the issue, and have been trying to fix it. However, upon much investigation, we detected that this is an issue that requires a larger refactor in mux-player, as well as the interactions with media-chrome, so it will be tackled in the future
Is there any timeframe for this, we've been suffering the same problem so I just subscribed to this issue to get notifications when it's solved.
Can you please comment here when solved @Jerricho93 ?
And are you aware of any workaround?
Sorry @raulvidzing no workaround that we were able to find so far.
I will comment here when this issue gets solved before closing it
this one should be resolved in the latest Mux player release in Vue, at least in my testing it worked like intended.
it was caused by a race condition where the option to disable subtitles was detected too late in media-chrome and the subtitles were already toggled on.
https://github.com/muxinc/media-chrome/blob/98f2dffaeda9610bce1845cf13bbad3224286fc3/src/js/media-store/state-mediator.ts#L688-L702
I've just did a quick test and it looks like it's working now. Thank you for the fix!
I've just did a quick test and it looks like it's working now. Thank you for the fix!
Hi there, where did you get it working?? Vue??
I'm using react and still happening