Fejlesztőknek
Kezdj bele
Témák/Theme SDK/Modules/media

media

Ez az oldal még csak angolul érhető el.

Images, videos, placeholders, media library files and theme assets.

Ezen az oldalon
import { … } from '@poltura/theme-sdk/media';

Hooks

NameWhat it is
useMediaThe media library file or theme asset a media field's value names.
useMediaDrawnWhether a media field's value draws a picture, so a layout can drop the frame when it does not.
useThemeAssetA theme asset as media renderers read it.
useAssetUrlThe URL a theme asset loads from: one rendition of an image with a role, otherwise the file whole.
useVideoSettingA video setting resolved to the file or player it plays, with its poster and how it plays.

Parts

NameWhat it is
MediaImageA responsive image in every format the browser takes, with blur-up and broken-link recovery.
MediaPlaceholderThe neutral drawing shown where an image is not chosen yet.
SettingVideoDraws a video setting: the file with its poster, autoplay, loop and mute, or the YouTube or Vimeo player, with its text alternative.

Functions

NameWhat it is
assetA reference to a file under the theme's assets/ folder, by its path there.
mediaUrlThe URL of one rendition of a stored image; any other URL comes back as it is.

Constants

NameWhat it is
MEDIA_ROLESEvery rendition a merchant or a setting can pick.

Types

NameWhat it is
AssetRefA reference to a file under the theme's assets/ folder, as asset() returns it.
MediaFormatAn image file format a rendition can be served in.
MediaImageRefAn image a view model carries: the stored URL plus what was measured when it was uploaded.
MediaRoleThe rendition an image is drawn at; each role has its own size and crop.
ResolvedMediaA media library file or theme asset, resolved for drawing.
VideoValueThe value of a video setting: the source alone, or the source with how it plays.
MediaImagePropsProps of MediaImage.
MediaPlaceholderPropsProps of MediaPlaceholder.
VideoSettingViewA video setting ready to draw.
SettingVideoPropsProps of SettingVideo.
Utoljára frissítve