red-hat-design-system icon indicating copy to clipboard operation
red-hat-design-system copied to clipboard

[feat] `<rh-video>` element

Open markcaron opened this issue 2 years ago • 10 comments

We need a new Video element/component with the following criteria:

  • Accepts placeholder / thumbnail image (optional)
  • Overlays a play button
  • Handles cookie consent for YouTube
    • If no, "error messaging" with button to update preferences
    • If yes, plays video from YouTube embed
  • Plays video from <video> element (no need for cookie consent)

Mockups

markcaron avatar Oct 03 '23 19:10 markcaron

@marionnegp can you provide the assets for this? Seems like there's a logo backdrop behind the cookie consent.

markcaron avatar Oct 03 '23 19:10 markcaron

cookie-opt-in-video-thumbnail-bg

@markcaron

marionnegp avatar Oct 03 '23 20:10 marionnegp

prior art:

  • https://ux.redhat.com/elements/dialog/guidelines/#video-player-dialog
  • https://ux.redhat.com/elements/audio-player/ https://github.com/RedHat-UX/red-hat-design-system/blob/baa38206364b3c524b80e588720102fbec3c1a0a/elements/rh-dialog/yt-api.ts

bennypowers avatar Oct 09 '23 05:10 bennypowers

@nikkimk to do some discovery work around whether there is a need for separate components/elements for 3rd party videos vs. the native <video> element, and how we'd tackle the APIs.

markcaron avatar Oct 19 '23 14:10 markcaron

@nikkimk @hellogreg Proposing to move this to the Chansey release.

coreyvickery avatar Dec 05 '23 16:12 coreyvickery

@coreyvickery Done. Thanks! If we decide it needs to go to Charmander, we can do that, too.

hellogreg avatar Dec 05 '23 22:12 hellogreg

Questions for discussion at Monday's office hours:

  • Should the component open the cookies dialog out of the box, or is this a pattern that consumers have to implement?
  • Given there's a lot of microcopy, do we handle it like audio player with translations, have the consumers slot in their own text, or some other method?

nikkimk avatar Feb 29 '24 18:02 nikkimk

  • composition is better, we can maybe make a wrapper component at a later date. we can't know how the translation systems on different pages will work
  • probably prudent for the CMS devs to proactively fill in the defaults on all slots / content attributes, in their CMS patterns
  • transcript API should be as similar to rh-audio-player as possible, preferably using the very same rh-cue elements

bennypowers avatar Mar 04 '24 14:03 bennypowers

  • Should the component open the cookies dialog out of the box, or is this a pattern that consumers have to implement? Nikki will reach out to ask more about the cookies modal.
  • Given there's a lot of microcopy, do we handle it like audio player with translations, have the consumers slot in their own text, or some other method? Microcopy will be slotted. English will be default text in the slot, but patterns in Drupal should explicitly slot in microcopy for translations.

nikkimk avatar Mar 04 '24 14:03 nikkimk

For the opt-in part:

  • slots for consent-message and consent-button-text
  • properties require-consent and has-consent
  • consent-click event to open cookie dialog

nikkimk avatar Mar 05 '24 20:03 nikkimk