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

Media block: add an ability to define different media types for different screen size breakpoints #987

Open
danonechik94 opened this issue Aug 13, 2024 · 0 comments

Comments

@danonechik94
Copy link

The scenario is as follows: on a desktop size screen display a video, and on tablet/mobile display an image (different images). Right now the only possible solution is to turn video into an image and configure the media block like this:

  - type: 'media-block'
    animated: true
    mediaOnly: true
    title: '...'
    media:
        image:
            desktop: '{gif url}'
            tablet: '{tablet image url}'
            mobile: '{mobile image url}'

Although this will require a breaking change, this schema can be used in all media properties across several components. Here's the proposed change:

  - type: 'media-block'
    animated: true
    mediaOnly: true
    title: '...'
    media:
      desktop: 
        video: 
          src:
            - '{video url}'
            - '{video fallback image}'
      # by default use image type and get src from this field
      tablet: '{tablet image url}'
      mobile: 
        src: 
          - '{mobile image url webp}'
          - '{fallback mobile image url jpeg}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant