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

Aperta
#987 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

The change centres on the media-block block and its media schema, which the payload does not name by file. Start by finding where the block reads per-breakpoint image sources, then decide how a video entry and a nested src list fit the existing shape. The issue leaves the breaking-change scope open, so agree the schema with maintainers before coding. Done means one schema covers desktop, tablet and mobile with image or video entries and fallbacks.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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}'
Lingua principale
TypeScript
Stelle
65
Fork
27
Merge medio
5g 15m
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di gravity-ui/page-constructor

Tutte le issue di gravity-ui/page-constructor

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.