Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Lazy loaded MuxPlayer duplicates children <track/> elements #894

Open
1 task done
fredrik-sogaard opened this issue Apr 9, 2024 · 2 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@fredrik-sogaard
Copy link

fredrik-sogaard commented Apr 9, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Which Mux Elements/Packages does this apply to? Select all that apply

mux-player-react

Which browsers are you using?

Chrome

Which operating systems are you using?

macOS

Description

When using mux-player-react and adding a subtitle track as a child, the subtitle track gets duplicated:

CleanShot 2024-04-09 at 17 17 57@2x

Code structure:

import MuxPlayer from '@mux/mux-player-react';

 <MuxPlayer playbackId=...">
  <track
    kind="subtitles"
    label="Norsk"
    src="..."
    srcLang="no"
  />
</MuxPlayer>

Reduced test case

https://stackblitz.com/edit/vitejs-vite-fhn3wm?file=src%2FApp.tsx

Steps to reproduce

  1. Add a <track> as child of MuxPlayer
  2. See duplicated subtitle options.

Current Behavior

<track> children gets duplicated.

Expected Behavior

<track> children not getting duplicated.

Errors

No response

What version of the package are you using?

2.4.1

@fredrik-sogaard fredrik-sogaard added bug Something isn't working Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug labels Apr 9, 2024
@luwes
Copy link
Contributor

luwes commented Apr 9, 2024

it's because Mux player automatically loads them from the m3u8.
they can be removed with some API calls to the Mux video API
https://docs.mux.com/api-reference#video/operation/delete-asset-track

is your intention to manually override the subtitles?

@fredrik-sogaard
Copy link
Author

fredrik-sogaard commented Apr 9, 2024

No, I want to add my own subtitle tracks stored elsewhere to the video player. We don't add subtitles to Mux directly.

We're using Sanity as a CMS and the Mux plugin doesn't support uploading subtitle tracks, so we want to load them in as <track> elements.

It is so close to working perfectly, except the duplicating issue.

@luwes luwes removed the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants