elements icon indicating copy to clipboard operation
elements copied to clipboard

Bug: `default-hidden-captions` attribute not working when using custom subtitles

Open nikola-zitko opened this issue 1 year ago • 3 comments

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

nikola-zitko avatar Jan 16 '25 09:01 nikola-zitko

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

Jerricho93 avatar Mar 20 '25 20:03 Jerricho93

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?

raulvidzing avatar Mar 21 '25 01:03 raulvidzing

Sorry @raulvidzing no workaround that we were able to find so far.

I will comment here when this issue gets solved before closing it

Jerricho93 avatar Mar 21 '25 15:03 Jerricho93

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

luwes avatar Mar 31 '25 19:03 luwes

I've just did a quick test and it looks like it's working now. Thank you for the fix!

nikola-zitko avatar Apr 01 '25 13:04 nikola-zitko

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

raulvidzing avatar Apr 07 '25 05:04 raulvidzing