muxinc / media-chrome

Custom elements (web components) for making audio and video player controls that look great in your website or app.
https://media-chrome.org
MIT License
1.77k stars 71 forks source link

feat: add role menu elements #785

Closed luwes closed 10 months ago

luwes commented 10 months ago

I propose to make this connection automatically for ease of use, less HTML needed but it can be made explicit with the invoketarget <-> id attributes or anchor <-> id for the positioning.

example of an automatic connection:

<media-controller>
  <media-captions-menu hidden></media-captions-menu>
  <media-control-bar>
    <media-play-button></media-play-button>
    <media-captions-menu-button></media-captions-menu-button>
  </media-control-bar>
</media-controller>

this menu captions button will automatically open the captions menu because the button finds a valid target. if there is no menu it falls back to the default behavior.

the captions menu is also automatically anchored to the captions menu button position as this is the most common behavior. it will be possible to opt out with anchor="" or similar.

vercel[bot] commented 10 months ago

@luwes is attempting to deploy a commit to the Mux Team on Vercel.

A member of the Team first needs to authorize it.

codecov[bot] commented 10 months ago

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (aa24858) 78.72% compared to head (934f271) 78.63%.

Files Patch % Lines
src/js/utils/element-utils.js 53.33% 21 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #785 +/- ## ========================================== - Coverage 78.72% 78.63% -0.10% ========================================== Files 58 58 Lines 10733 10781 +48 ========================================== + Hits 8450 8478 +28 - Misses 2283 2303 +20 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
media-chrome ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 9, 2024 8:08pm
media-chrome-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 9, 2024 8:08pm