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

Feature Request: Named Slot for Custom Overlays in <mux-video> #956

Open
1 task done
Mohamed-Abbas opened this issue Jul 19, 2024 · 0 comments
Open
1 task done
Labels
enhancement New feature or request

Comments

@Mohamed-Abbas
Copy link

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, playback-core, new element

Description

Background

The <mux-video> component from Mux is a powerful tool for embedding video content into web applications. While the component currently supports basic video functionalities and some level of customization through attributes, it lacks the ability to directly integrate custom HTML elements such as overlays within its shadow DOM. This limitation restricts developers from adding interactive or informational content directly on top of the video in a seamless manner.

Feature Description

This feature request aims to introduce a named slot within the <mux-video> component’s shadow DOM structure. By adding this slot, developers will be able to insert custom elements, like interactive buttons, promotional banners, or additional informational content, directly overlaying the video element. A practical application of this feature includes the ability to display a notification when the player is in fullscreen mode, enhancing the user's viewing experience by providing timely information without interrupting the video playback.

Expected Behavior

Elements placed in the overlay slot should integrate seamlessly over the video, without causing any disruptions to video playback or control accessibility. Here is an example of how developers might use the new slot in the

 <PrimitiveMuxPlayer ref={innerPlayerRef} playbackId={playbackId}>
   <div
     slot="overlay"
     className="absolute inset-0 z-50 overflow-hidden pointer-events-none"
   >
     {children}
   </div>
 </PrimitiveMuxPlayer>
@Mohamed-Abbas Mohamed-Abbas added the enhancement New feature or request label Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant